Loading include/config.hpp +7 −2 Original line number Diff line number Diff line Loading @@ -134,10 +134,15 @@ constexpr auto implicit_data_removal = true; // Check for existence of file metadata before create. This done on RocksDB // level constexpr auto create_exist_check = true; // Use inline data for small files constexpr auto use_inline_data = true; constexpr auto inline_data_size = 4096; // in bytes constexpr auto create_write_optimization = true; constexpr auto read_inline_prefetch = true; // Next options may break consistency, and definitely break tests. Use with // care. Optimize write operations for small files (files are not created until // a write appears) constexpr auto create_write_optimization = false; // Prefetch inline data on read operations constexpr auto read_inline_prefetch = false; } // namespace metadata Loading src/client/gkfs_functions.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1123,7 +1123,7 @@ gkfs_do_write(gkfs::filemap::OpenFile& file, const char* buf, size_t count, // clear inline data cache as it is stale if(!file.inline_data().empty()) file.inline_data(""); file.inline_data().clear(); // OPTIMIZATION: Inline Write Loading tests/integration/data/test_inline_read_opt.py +1 −14 Original line number Diff line number Diff line Loading @@ -5,8 +5,7 @@ from harness.logger import logger file01 = 'file01' data01 = 'data01' @pytest.mark.parametrize("restart_daemon", [False, True]) def test_inline_read_optimization(gkfs_daemon, gkfs_client, restart_daemon): def test_inline_read_optimization(gkfs_daemon, gkfs_client): """ Test the read optimization where inline data is cached during open. """ Loading @@ -20,15 +19,6 @@ def test_inline_read_optimization(gkfs_daemon, gkfs_client, restart_daemon): ret = gkfs_client.run('write', file01, data01, len(data01), '--creat') assert ret.retval == len(data01) if restart_daemon: # Restart daemon to clear any server-side caching effects if any (though client cache is what matters) # But crucially, we want to test that a FRESH client open fetches the data. # Actually restarts might be too heavy, just closing and reopening effectively tests the logic # because the OpenFile object is destroyed on close. pass # 2. Open file for reading # This should now fetch the inline data into the OpenFile object ret = gkfs_client.open(file01, Loading Loading @@ -62,6 +52,3 @@ def test_inline_read_optimization(gkfs_daemon, gkfs_client, restart_daemon): assert ret.retval == len(new_data) assert ret.buf == new_data.encode() # 6. Verify cleanup ret = gkfs_client.remove(file01) assert ret.retval == 0 include/client/open_file_map.hpp +1 −1 File changed.Contains only whitespace changes. Show changes Loading
include/config.hpp +7 −2 Original line number Diff line number Diff line Loading @@ -134,10 +134,15 @@ constexpr auto implicit_data_removal = true; // Check for existence of file metadata before create. This done on RocksDB // level constexpr auto create_exist_check = true; // Use inline data for small files constexpr auto use_inline_data = true; constexpr auto inline_data_size = 4096; // in bytes constexpr auto create_write_optimization = true; constexpr auto read_inline_prefetch = true; // Next options may break consistency, and definitely break tests. Use with // care. Optimize write operations for small files (files are not created until // a write appears) constexpr auto create_write_optimization = false; // Prefetch inline data on read operations constexpr auto read_inline_prefetch = false; } // namespace metadata Loading
src/client/gkfs_functions.cpp +1 −1 Original line number Diff line number Diff line Loading @@ -1123,7 +1123,7 @@ gkfs_do_write(gkfs::filemap::OpenFile& file, const char* buf, size_t count, // clear inline data cache as it is stale if(!file.inline_data().empty()) file.inline_data(""); file.inline_data().clear(); // OPTIMIZATION: Inline Write Loading
tests/integration/data/test_inline_read_opt.py +1 −14 Original line number Diff line number Diff line Loading @@ -5,8 +5,7 @@ from harness.logger import logger file01 = 'file01' data01 = 'data01' @pytest.mark.parametrize("restart_daemon", [False, True]) def test_inline_read_optimization(gkfs_daemon, gkfs_client, restart_daemon): def test_inline_read_optimization(gkfs_daemon, gkfs_client): """ Test the read optimization where inline data is cached during open. """ Loading @@ -20,15 +19,6 @@ def test_inline_read_optimization(gkfs_daemon, gkfs_client, restart_daemon): ret = gkfs_client.run('write', file01, data01, len(data01), '--creat') assert ret.retval == len(data01) if restart_daemon: # Restart daemon to clear any server-side caching effects if any (though client cache is what matters) # But crucially, we want to test that a FRESH client open fetches the data. # Actually restarts might be too heavy, just closing and reopening effectively tests the logic # because the OpenFile object is destroyed on close. pass # 2. Open file for reading # This should now fetch the inline data into the OpenFile object ret = gkfs_client.open(file01, Loading Loading @@ -62,6 +52,3 @@ def test_inline_read_optimization(gkfs_daemon, gkfs_client, restart_daemon): assert ret.retval == len(new_data) assert ret.buf == new_data.encode() # 6. Verify cleanup ret = gkfs_client.remove(file01) assert ret.retval == 0