summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorXuehan Xu <xuxuehan@qianxin.com>2024-02-21 07:50:47 +0100
committerXuehan Xu <xuxuehan@qianxin.com>2024-04-22 05:51:01 +0200
commitfd86b6976df28911a44e667d4795a25b635eaefb (patch)
tree374e412ef6319530f1de43f7f66c929bd67318b2 /src
parenttest/crimson/seastore/test_transaction_manager: disable max_extent_size for r... (diff)
downloadceph-fd86b6976df28911a44e667d4795a25b635eaefb.tar.xz
ceph-fd86b6976df28911a44e667d4795a25b635eaefb.zip
test/crimson/seastore/test_object_data_handler: disable max_extent_size
for remap related cases Signed-off-by: Xuehan Xu <xuxuehan@qianxin.com>
Diffstat (limited to 'src')
-rw-r--r--src/test/crimson/seastore/test_object_data_handler.cc27
1 files changed, 27 insertions, 0 deletions
diff --git a/src/test/crimson/seastore/test_object_data_handler.cc b/src/test/crimson/seastore/test_object_data_handler.cc
index 3066ac45921..2fab7b22ece 100644
--- a/src/test/crimson/seastore/test_object_data_handler.cc
+++ b/src/test/crimson/seastore/test_object_data_handler.cc
@@ -277,6 +277,17 @@ struct object_data_handler_test_t:
crimson::common::local_conf().set_val("seastore_data_delta_based_overwrite", "0").get();
}
+ void disable_max_extent_size() {
+ epm->set_max_extent_size(16777216);
+ crimson::common::local_conf().set_val(
+ "seastore_max_data_allocation_size", "16777216").get();
+ }
+ void enable_max_extent_size() {
+ epm->set_max_extent_size(8192);
+ crimson::common::local_conf().set_val(
+ "seastore_max_data_allocation_size", "8192").get();
+ }
+
laddr_t get_random_laddr(size_t block_size, laddr_t limit) {
return block_size *
std::uniform_int_distribution<>(0, (limit / block_size) - 1)(gen);
@@ -602,6 +613,7 @@ TEST_P(object_data_handler_test_t, no_overwrite) {
TEST_P(object_data_handler_test_t, remap_left) {
run_async([this] {
+ disable_max_extent_size();
write_right();
auto pins = get_mappings(0, 128<<10);
@@ -615,11 +627,13 @@ TEST_P(object_data_handler_test_t, remap_left) {
i++;
}
read(0, 128<<10);
+ enable_max_extent_size();
});
}
TEST_P(object_data_handler_test_t, overwrite_right) {
run_async([this] {
+ disable_max_extent_size();
enable_delta_based_overwrite();
write_right();
@@ -627,11 +641,13 @@ TEST_P(object_data_handler_test_t, overwrite_right) {
EXPECT_EQ(pins.size(), 1);
read(0, 128<<10);
disable_delta_based_overwrite();
+ enable_max_extent_size();
});
}
TEST_P(object_data_handler_test_t, remap_right) {
run_async([this] {
+ disable_max_extent_size();
write_left();
auto pins = get_mappings(0, 128<<10);
@@ -645,22 +661,26 @@ TEST_P(object_data_handler_test_t, remap_right) {
i++;
}
read(0, 128<<10);
+ enable_max_extent_size();
});
}
TEST_P(object_data_handler_test_t, overwrite_left) {
run_async([this] {
+ disable_max_extent_size();
enable_delta_based_overwrite();
write_left();
auto pins = get_mappings(0, 128<<10);
EXPECT_EQ(pins.size(), 1);
read(0, 128<<10);
disable_delta_based_overwrite();
+ enable_max_extent_size();
});
}
TEST_P(object_data_handler_test_t, remap_right_left) {
run_async([this] {
+ disable_max_extent_size();
write_right_left();
auto pins = get_mappings(0, 128<<10);
@@ -673,22 +693,26 @@ TEST_P(object_data_handler_test_t, remap_right_left) {
EXPECT_EQ(pin->get_key() - base, res[i]);
i++;
}
+ enable_max_extent_size();
});
}
TEST_P(object_data_handler_test_t, overwrite_right_left) {
run_async([this] {
+ disable_max_extent_size();
enable_delta_based_overwrite();
write_right_left();
auto pins = get_mappings(0, 128<<10);
EXPECT_EQ(pins.size(), 1);
read(0, 128<<10);
disable_delta_based_overwrite();
+ enable_max_extent_size();
});
}
TEST_P(object_data_handler_test_t, multiple_remap) {
run_async([this] {
+ disable_max_extent_size();
multiple_write();
auto pins = get_mappings(0, 128<<10);
EXPECT_EQ(pins.size(), 3);
@@ -701,17 +725,20 @@ TEST_P(object_data_handler_test_t, multiple_remap) {
i++;
}
read(0, 128<<10);
+ enable_max_extent_size();
});
}
TEST_P(object_data_handler_test_t, multiple_overwrite) {
run_async([this] {
+ disable_max_extent_size();
enable_delta_based_overwrite();
multiple_write();
auto pins = get_mappings(0, 128<<10);
EXPECT_EQ(pins.size(), 1);
read(0, 128<<10);
disable_delta_based_overwrite();
+ enable_max_extent_size();
});
}