diff options
author | Laura Flores <lflores@redhat.com> | 2024-09-30 23:29:16 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-09-30 23:29:16 +0200 |
commit | 9afb314aaebe65e4280c65d212442a515d0eaa07 (patch) | |
tree | ad810c0c53636d83b2379a490d273f8ee916d299 /src/test | |
parent | Merge pull request #59998 from cbodley/wip-63935 (diff) | |
parent | osd: fix partial reading during multi-region EC reads (diff) | |
download | ceph-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.cc | 25 |
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}); + } +} |