]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
test: Verify a log trim trims the dup_index 26578/head
authorBrad Hubbard <bhubbard@redhat.com>
Wed, 20 Feb 2019 05:47:26 +0000 (15:47 +1000)
committerBrad Hubbard <bhubbard@redhat.com>
Thu, 21 Feb 2019 23:18:06 +0000 (09:18 +1000)
Fixes: https://tracker.ceph.com/issues/38406
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
(cherry picked from commit e91e2f81340846e98ab0704d92a7ad543c416f1b)

src/test/osd/TestPGLog.cc

index dfe457c69804b28b4f0929eb8858b2343ddf8df8..f1def5c2df54cf5016cf096dcc32591fad4233a7 100644 (file)
@@ -2835,6 +2835,7 @@ TEST_F(PGLogTrimTest, TestTrimAll)
 {
   SetUp(1, 2, 20);
   PGLog::IndexedLog log;
+  EXPECT_EQ(0u, log.dup_index.size()); // Sanity check
   log.head = mk_evt(24, 0);
   log.skip_can_rollback_to_to_head();
   log.head = mk_evt(9, 0);
@@ -2857,6 +2858,7 @@ TEST_F(PGLogTrimTest, TestTrimAll)
   EXPECT_EQ(6u, trimmed.size());
   EXPECT_EQ(5u, log.dups.size());
   EXPECT_EQ(0u, trimmed_dups.size());
+  EXPECT_EQ(0u, log.dup_index.size()); // dup_index entry should be trimmed
 }