From 126df9655803989476ef2a5550ee2e83f2756b25 Mon Sep 17 00:00:00 2001 From: myoungwon oh Date: Tue, 17 Aug 2021 21:51:29 +0900 Subject: [PATCH] test: allowing >= the real refcount to avoid false alarm MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Current dedup allow to contain multiple same sources using multiset, which results in inconsistent situation as follow (during set_chunk, but not confined in set_chunk). 1. User issues set_chunk 2. OSD receives the set_chunk, and sends increment message to an object in the low tier (INPROGRESS). 3. OSD map is changed (841 → 843) 3.5. on_change() is called 4. the set_chunk op is reenqueued by requeue_op() 5. OSD handles the duplicated set_chunk, but it is not able to know the set_chunk is duplicated because it does not log on the disk yet. 6. OSD issues increment message again to the object in the low tier. (increment operation is executed twice) To fix this, this commit allows >= the real refcount in test cases fixes: https://tracker.ceph.com/issues/51000 Signed-off-by: Myoungwon Oh --- src/test/librados/tier_cxx.cc | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/src/test/librados/tier_cxx.cc b/src/test/librados/tier_cxx.cc index ff87975ad3c60..e82b24c676e0e 100644 --- a/src/test/librados/tier_cxx.cc +++ b/src/test/librados/tier_cxx.cc @@ -139,7 +139,7 @@ void check_fp_oid_refcount(librados::IoCtx& ioctx, std::string foid, uint64_t co } catch (buffer::error& err) { ASSERT_TRUE(0); } - ASSERT_EQ(count, refs.count()); + ASSERT_LE(count, refs.count()); } string get_fp_oid(string oid, std::string fp_algo = NULL) @@ -3558,7 +3558,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestDedupRefRead) { } catch (buffer::error& err) { ASSERT_TRUE(0); } - ASSERT_EQ(2u, refs.count()); + ASSERT_LE(2u, refs.count()); } // wait for maps to settle before next test @@ -3655,7 +3655,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount) { } catch (buffer::error& err) { ASSERT_TRUE(0); } - ASSERT_EQ(1u, refs.count()); + ASSERT_LE(1u, refs.count()); } // create a snapshot, clone @@ -3721,7 +3721,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount) { } catch (buffer::error& err) { ASSERT_TRUE(0); } - ASSERT_EQ(2u, refs.count()); + ASSERT_LE(2u, refs.count()); } // and another @@ -3786,7 +3786,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount) { } catch (buffer::error& err) { ASSERT_TRUE(0); } - ASSERT_EQ(2u, refs.count()); + ASSERT_LE(2u, refs.count()); } // remove snap @@ -4026,7 +4026,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount2) { } catch (buffer::error& err) { ASSERT_TRUE(0); } - ASSERT_EQ(2u, refs.count()); + ASSERT_LE(2u, refs.count()); } // check chunk's refcount @@ -4047,7 +4047,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount2) { } catch (buffer::error& err) { ASSERT_TRUE(0); } - ASSERT_EQ(2u, refs.count()); + ASSERT_LE(2u, refs.count()); } // check chunk's refcount @@ -4068,7 +4068,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount2) { } catch (buffer::error& err) { ASSERT_TRUE(0); } - ASSERT_EQ(2u, refs.count()); + ASSERT_LE(2u, refs.count()); } // remove snap @@ -5532,7 +5532,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestFlushDupCount) { } catch (buffer::error& err) { ASSERT_TRUE(0); } - ASSERT_EQ(1u, refs.count()); + ASSERT_LE(1u, refs.count()); } bufferlist chunk2; @@ -5556,7 +5556,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestFlushDupCount) { } catch (buffer::error& err) { ASSERT_TRUE(0); } - ASSERT_EQ(1u, refs.count()); + ASSERT_LE(1u, refs.count()); } // make a dirty chunks -- 2.39.5