]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
os/memstore, os/filestore: fix store_test's to satisfy rm_coll behavior expected... 11558/head
authorIgor Fedotov <ifedotov@mirantis.com>
Wed, 19 Oct 2016 13:41:40 +0000 (13:41 +0000)
committerIgor Fedotov <ifedotov@mirantis.com>
Wed, 19 Oct 2016 13:41:40 +0000 (13:41 +0000)
Signed-off-by: Igor Fedotov <ifedotov@mirantis.com>
src/os/filestore/FileStore.cc
src/os/memstore/MemStore.cc
src/test/objectstore/store_test.cc

index 232892ce48d62131a0561e186ba6e910eb38f760..96a45da06764059f7af22394625dc0dc1fb0ebe0 100644 (file)
@@ -3003,8 +3003,8 @@ void FileStore::_do_transaction(
          msg = "ENOTEMPTY suggests garbage data in osd data dir";
        }
 
-       dout(0) << " error " << cpp_strerror(r) << " not handled on operation " << op
-               << " (" << spos << ", or op " << spos.op << ", counting from 0)" << dendl;
+       derr  << " error " << cpp_strerror(r) << " not handled on operation " << op
+             << " (" << spos << ", or op " << spos.op << ", counting from 0)" << dendl;
        dout(0) << msg << dendl;
        dout(0) << " transaction dump:\n";
        JSONFormatter f(true);
index 8158259ba74fade7990c666a67d832f067aa8197..2feaa43b8d124a608a733e3f8668a65770995ab8 100644 (file)
@@ -1045,7 +1045,7 @@ void MemStore::_do_transaction(Transaction& t)
          dump_all();
        }
 
-       dout(0) << " error " << cpp_strerror(r) << " not handled on operation " << op->op
+       derr    << " error " << cpp_strerror(r) << " not handled on operation " << op->op
                << " (op " << pos << ", counting from 0)" << dendl;
        dout(0) << msg << dendl;
        dout(0) << " transaction dump:\n";
index 4a5df47c8470c9f0066e006d8ddd26cca5190366..2c17eb6ee4b2dc41730cd09c77e46c07df47e46d 100644 (file)
@@ -2725,7 +2725,14 @@ TEST_P(StoreTest, SimpleCloneTest) {
     rl.hexdump(cout);*/
     ASSERT_TRUE(bl_eq(rl, final));
   }
-  {
+
+  //Unfortunately we need a workaround for filestore since EXPECT_DEATH
+  // macro has potential issues when using /in multithread environments. 
+  //It works well for all stores but filestore for now. 
+  //A fix setting gtest_death_test_style = "threadsafe" doesn't help as well - 
+  //  test app clone asserts on store folder presence.
+  //
+  if (string(GetParam()) != "filestore") { 
     //verify if non-empty collection is properly handled after store reload
     r = store->umount();
     ASSERT_EQ(r, 0);
@@ -2739,26 +2746,30 @@ TEST_P(StoreTest, SimpleCloneTest) {
 
   }
   {
-    //verify if non-empty collection is properly handled when there are some pending removes and live records in db
-    cerr << "Invalid rm coll again" << std::endl;
-
     ObjectStore::Transaction t;
     t.touch(cid, hoid3); //new record in db
-    t.remove(cid, hoid);
-    t.remove(cid, hoid2);
     r = apply_transaction(store, &osr, std::move(t));
     ASSERT_EQ(r, 0);
-
+  }
+  //See comment above for "filestore" check explanation.
+  if (string(GetParam()) != "filestore") {
+    ObjectStore::Transaction t;
+    //verify if non-empty collection is properly handled when there are some pending removes and live records in db
+    cerr << "Invalid rm coll again" << std::endl;
     r = store->umount();
     ASSERT_EQ(r, 0);
     r = store->mount();
     ASSERT_EQ(r, 0);
 
+    t.remove(cid, hoid);
+    t.remove(cid, hoid2);
     t.remove_collection(cid);
     EXPECT_DEATH(apply_transaction(store, &osr, std::move(t)), ".*Directory not empty.*");
   }
   {
     ObjectStore::Transaction t;
+    t.remove(cid, hoid);
+    t.remove(cid, hoid2);
     t.remove(cid, hoid3);
     t.remove_collection(cid);
     cerr << "Cleaning" << std::endl;