Skip to content

Commit

Permalink
test: allowing >= the real refcount to avoid false alarm
Browse files Browse the repository at this point in the history
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 <myoungwon.oh@samsung.com>
  • Loading branch information
myoungwon authored and pull[bot] committed Aug 19, 2021
1 parent 830d656 commit 1422362
Showing 1 changed file with 10 additions and 10 deletions.
20 changes: 10 additions & 10 deletions src/test/librados/tier_cxx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,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)
Expand Down Expand Up @@ -3573,7 +3573,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
Expand Down Expand Up @@ -3670,7 +3670,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
Expand Down Expand Up @@ -3736,7 +3736,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount) {
} catch (buffer::error& err) {
ASSERT_TRUE(0);
}
ASSERT_EQ(2u, refs.count());
ASSERT_LE(2u, refs.count());
}

// and another
Expand Down Expand Up @@ -3801,7 +3801,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount) {
} catch (buffer::error& err) {
ASSERT_TRUE(0);
}
ASSERT_EQ(2u, refs.count());
ASSERT_LE(2u, refs.count());
}

// remove snap
Expand Down Expand Up @@ -4041,7 +4041,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
Expand All @@ -4062,7 +4062,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
Expand All @@ -4083,7 +4083,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestSnapRefcount2) {
} catch (buffer::error& err) {
ASSERT_TRUE(0);
}
ASSERT_EQ(2u, refs.count());
ASSERT_LE(2u, refs.count());
}

// remove snap
Expand Down Expand Up @@ -5547,7 +5547,7 @@ TEST_F(LibRadosTwoPoolsPP, ManifestFlushDupCount) {
} catch (buffer::error& err) {
ASSERT_TRUE(0);
}
ASSERT_EQ(1u, refs.count());
ASSERT_LE(1u, refs.count());
}

bufferlist chunk2;
Expand All @@ -5571,7 +5571,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
Expand Down

0 comments on commit 1422362

Please sign in to comment.