READY: Optimize create, stat, remove operations
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 ashared_ptr
for theMetadata
object in the process which was not needed. A new functionget_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()
andremove_data()
. -
gkfs::config::metadata::implicit_data_removal
setting: Iftrue
, will remove data on the same node during theremove_metadata()
RPC. This is mainly an optimization, but will be useful for future asynchronous removal implementations.
Previously, the code path looked like this:
-
stat()
to getsize
andmode
. - Use these fields to determine if data needs to be removed or just metadata.
-
remove()
is called which, first, sends a single RPC to the daemon with the metadata. Afterwards, data is removed. - The daemon used one handler for both cases.
It now looks like this:
-
remove()
is called which, first, sends a single RPC to the daemon with the metadata. Before, removing the metadata, the daemon fetchesmode
andsize
. Ifimplicit_data_removal
is set as a configuration, the data is removed in this RPC as well.mode
andsize
are returned to the client. - The client determines if data needs to be removed as well.
- If yes, sends a
remove_data()
RPC as it was previously.
Depends on !66 (merged) and !74 (merged).
Closes #94 (closed)
Edited by Alberto Miranda