Merge branch '94-remove-exist-check-when-creating-a-file' into 'master'
Optimization of create, stat, and remove operations. The following changes have been made: - `gkfs_open()` logic refactored. - create: Previously a stat RPC was send before each create to make sure the file doesn't exist. This logic is now implicit in the create operation on the daemon side. - `get_metadata()` was used on the client for all stat operation, creating a `shared_ptr` for the `Metadata` object in the process which was not needed. A new function `get_metadata_attr()` was created to only return the metadata binary string, which will only create the metadata object if actually required. - Remove logic was separated into two operations: `remove_metadata()` and `remove_data()`. - `gkfs::config::metadata::implicit_data_removal` setting: If `true`, will remove data on the same node during the `remove_metadata()` RPC. This is mainly an optimization, but will be useful for future asynchronous removal implementations. Previously, the code path looked like this: 1. `stat()` to get `size` and `mode`. 2. Use these fields to determine if data needs to be removed or just metadata. 3. `remove()` is called which, first, sends a single RPC to the daemon with the metadata. Afterwards, data is removed. 4. The daemon used one handler for both cases. It now looks like this: 1. `remove()` is called which, first, sends a single RPC to the daemon with the metadata. Before, removing the metadata, the daemon fetches `mode` and `size`. If `implicit_data_removal` is set as a configuration, the data is removed in this RPC as well. `mode` and `size` are returned to the client. 2. The client determines if data needs to be removed as well. 3. If yes, sends a `remove_data()` RPC as it was previously. Depends on !66 and !74. Closes #94 See merge request !60
No related branches found
No related tags found
Showing
- include/client/preload_util.hpp 1 addition, 1 deletioninclude/client/preload_util.hpp
- include/client/rpc/forward_metadata.hpp 1 addition, 2 deletionsinclude/client/rpc/forward_metadata.hpp
- include/client/rpc/rpc_types.hpp 134 additions, 10 deletionsinclude/client/rpc/rpc_types.hpp
- include/config.hpp 12 additions, 0 deletionsinclude/config.hpp
- include/daemon/backend/exceptions.hpp 5 additions, 0 deletionsinclude/daemon/backend/exceptions.hpp
- include/daemon/backend/metadata/db.hpp 4 additions, 1 deletioninclude/daemon/backend/metadata/db.hpp
- include/daemon/handler/rpc_defs.hpp 3 additions, 1 deletioninclude/daemon/handler/rpc_defs.hpp
- include/global/global_defs.hpp 2 additions, 1 deletioninclude/global/global_defs.hpp
- include/global/rpc/rpc_types.hpp 3 additions, 0 deletionsinclude/global/rpc/rpc_types.hpp
- src/client/gkfs_functions.cpp 62 additions, 59 deletionssrc/client/gkfs_functions.cpp
- src/client/hooks.cpp 4 additions, 3 deletionssrc/client/hooks.cpp
- src/client/preload_util.cpp 8 additions, 6 deletionssrc/client/preload_util.cpp
- src/client/rpc/forward_metadata.cpp 54 additions, 41 deletionssrc/client/rpc/forward_metadata.cpp
- src/client/rpc/rpc_types.cpp 2 additions, 2 deletionssrc/client/rpc/rpc_types.cpp
- src/daemon/backend/data/chunk_storage.cpp 2 additions, 2 deletionssrc/daemon/backend/data/chunk_storage.cpp
- src/daemon/backend/metadata/db.cpp 70 additions, 1 deletionsrc/daemon/backend/metadata/db.cpp
- src/daemon/daemon.cpp 4 additions, 2 deletionssrc/daemon/daemon.cpp
- src/daemon/handler/srv_metadata.cpp 58 additions, 7 deletionssrc/daemon/handler/srv_metadata.cpp
- src/daemon/ops/metadentry.cpp 8 additions, 5 deletionssrc/daemon/ops/metadentry.cpp
Loading
Please register or sign in to comment