summaryrefslogtreecommitdiffstats
path: root/src/test
diff options
context:
space:
mode:
authorLaura Flores <lflores@redhat.com>2024-09-30 23:29:16 +0200
committerGitHub <noreply@github.com>2024-09-30 23:29:16 +0200
commit9afb314aaebe65e4280c65d212442a515d0eaa07 (patch)
treead810c0c53636d83b2379a490d273f8ee916d299 /src/test
parentMerge pull request #59998 from cbodley/wip-63935 (diff)
parentosd: fix partial reading during multi-region EC reads (diff)
downloadceph-9afb314aaebe65e4280c65d212442a515d0eaa07.tar.xz
ceph-9afb314aaebe65e4280c65d212442a515d0eaa07.zip
Merge pull request #58749 from rzarzynski/wip-bug-67087
osd: fix partial reading during multi-region EC reads
Diffstat (limited to 'src/test')
-rw-r--r--src/test/osd/TestECBackend.cc25
1 files changed, 25 insertions, 0 deletions
diff --git a/src/test/osd/TestECBackend.cc b/src/test/osd/TestECBackend.cc
index d28d428fc06..f93ed7ff67a 100644
--- a/src/test/osd/TestECBackend.cc
+++ b/src/test/osd/TestECBackend.cc
@@ -230,3 +230,28 @@ TEST(ECCommon, get_min_want_to_read_shards)
ASSERT_TRUE(want_to_read == (std::set<int>{0, 1, 2, 3}));
}
}
+
+TEST(ECCommon, get_min_want_to_read_shards_bug67087)
+{
+ const uint64_t swidth = 4096;
+ const uint64_t ssize = 4;
+
+ ECUtil::stripe_info_t s(ssize, swidth);
+ ASSERT_EQ(s.get_stripe_width(), swidth);
+ ASSERT_EQ(s.get_chunk_size(), 1024);
+
+ const std::vector<int> chunk_mapping = {}; // no remapping
+
+ std::set<int> want_to_read;
+
+ // multitple calls with the same want_to_read can happen during
+ // multi-region reads.
+ {
+ ECCommon::ReadPipeline::get_min_want_to_read_shards(
+ 512, 512, s, chunk_mapping, &want_to_read);
+ ASSERT_EQ(want_to_read, std::set<int>{0});
+ ECCommon::ReadPipeline::get_min_want_to_read_shards(
+ 512+16*1024, 512, s, chunk_mapping, &want_to_read);
+ ASSERT_EQ(want_to_read, std::set<int>{0});
+ }
+}