]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
TestPGLog: add test for 13965
authorSamuel Just <sjust@redhat.com>
Thu, 3 Dec 2015 01:17:57 +0000 (17:17 -0800)
committerNathan Cutler <ncutler@suse.com>
Sat, 30 Apr 2016 17:00:20 +0000 (19:00 +0200)
Signed-off-by: Samuel Just <sjust@redhat.com>
(cherry picked from commit 66c7246491f4b6e5b95d80cc93c9157725a1a778)

src/test/osd/TestPGLog.cc

index cc9733ac28f13ff7ca08a860706b60315bd2ed00..5962b3614d4e717c6edfd25b17791c8f05953848 100644 (file)
@@ -446,6 +446,40 @@ TEST_F(PGLogTest, rewind_divergent_log) {
     EXPECT_TRUE(dirty_info);
     EXPECT_TRUE(dirty_big_info);
   }
+
+  // Test for 13965
+  {
+    clear();
+
+    ObjectStore::Transaction t;
+    list<hobject_t> remove_snap;
+    pg_info_t info;
+    info.log_tail = log.tail = eversion_t(1, 5);
+    info.last_update = eversion_t(1, 6);
+    bool dirty_info = false;
+    bool dirty_big_info = false;
+
+    {
+      pg_log_entry_t e;
+      e.mod_desc.mark_unrollbackable();
+      e.version = eversion_t(1, 5);
+      e.soid.set_hash(0x9);
+      add(e);
+    }
+    {
+      pg_log_entry_t e;
+      e.mod_desc.mark_unrollbackable();
+      e.version = eversion_t(1, 6);
+      e.soid.set_hash(0x10);
+      add(e);
+    }
+    TestHandler h(remove_snap);
+    trim_rollback_info(eversion_t(1, 6), &h);
+    rewind_divergent_log(t, eversion_t(1, 5), info, &h,
+                        dirty_info, dirty_big_info);
+    pg_log_t log;
+    claim_log_and_clear_rollback_info(log, &h);
+  }
 }
 
 TEST_F(PGLogTest, merge_old_entry) {