]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
crimson/os/alienstore: assert on failure 35894/head
authorKefu Chai <kchai@redhat.com>
Thu, 2 Jul 2020 11:32:09 +0000 (19:32 +0800)
committerKefu Chai <kchai@redhat.com>
Thu, 2 Jul 2020 11:38:16 +0000 (19:38 +0800)
before we have a failure recovery, better off failing fast.

Signed-off-by: Kefu Chai <kchai@redhat.com>
src/crimson/os/alienstore/alien_store.cc

index 445dd78b346ae7ff5d5b04f7a97580dd4f324d64..66a350e03752d331d343d997507560ce3b878824 100644 (file)
@@ -100,7 +100,8 @@ seastar::future<> AlienStore::mount()
   logger().debug("{}", __func__);
   return tp->submit([this] {
     return store->mount();
-  }).then([] (int) {
+  }).then([] (int r) {
+    assert(r == 0);
     return seastar::now();
   });
 }
@@ -112,7 +113,8 @@ seastar::future<> AlienStore::umount()
     return tp->submit([this] {
       return store->umount();
     });
-  }).then([] (int) {
+  }).then([] (int r) {
+    assert(r == 0);
     return seastar::now();
   });
 }
@@ -123,7 +125,8 @@ seastar::future<> AlienStore::mkfs(uuid_d new_osd_fsid)
   osd_fsid = new_osd_fsid;
   return tp->submit([this] {
     return store->mkfs();
-  }).then([] (int) {
+  }).then([] (int r) {
+    assert(r == 0);
     return seastar::now();
   });
 }
@@ -143,7 +146,8 @@ AlienStore::list_objects(CollectionRef ch,
       return store->collection_list(c->collection, start, end,
                                     store->get_ideal_list_max(),
                                     &objects, &next);
-    }).then([&objects, &next] (int) {
+    }).then([&objects, &next] (int r) {
+      assert(r == 0);
       return seastar::make_ready_future<std::tuple<std::vector<ghobject_t>, ghobject_t>>(
        std::make_tuple(std::move(objects), std::move(next)));
     });
@@ -202,7 +206,8 @@ seastar::future<std::vector<coll_t>> AlienStore::list_collections()
   return seastar::do_with(std::vector<coll_t>{}, [=] (auto &ls) {
     return tp->submit([this, &ls] {
       return store->list_collections(ls);
-    }).then([&ls] (int) {
+    }).then([&ls] (int r) {
+      assert(r == 0);
       return seastar::make_ready_future<std::vector<coll_t>>(std::move(ls));
     });
   });
@@ -311,7 +316,8 @@ AlienStore::omap_get_values(CollectionRef ch,
       auto c = static_cast<AlienCollection*>(ch.get());
       return store->omap_get_values(c->collection, oid, keys,
                                    reinterpret_cast<map<string, bufferlist>*>(&values));
-    }).then([&values] (int) {
+    }).then([&values] (int r) {
+      assert(r == 0);
       return seastar::make_ready_future<omap_values_t>(std::move(values));
     });
   });
@@ -354,7 +360,8 @@ seastar::future<> AlienStore::do_transaction(CollectionRef ch,
            auto c = static_cast<AlienCollection*>(ch.get());
            return store->queue_transaction(c->collection, std::move(txn));
          });
-       }).then([this, &done] (int) {
+       }).then([this, &done] (int r) {
+         assert(r == 0);
          tp_mutex.unlock();
          return done.get_future();
        });
@@ -368,7 +375,8 @@ seastar::future<> AlienStore::write_meta(const std::string& key,
   logger().debug("{}", __func__);
   return tp->submit([=] {
     return store->write_meta(key, value);
-  }).then([] (int) {
+  }).then([] (int r) {
+    assert(r == 0);
     return seastar::make_ready_future<>();
   });
 }
@@ -406,7 +414,8 @@ seastar::future<store_statfs_t> AlienStore::stat() const
   return seastar::do_with(store_statfs_t{}, [this] (store_statfs_t &st) {
     return tp->submit([this, &st] {
       return store->statfs(&st, nullptr);
-    }).then([&st] (int) {
+    }).then([&st] (int r) {
+      assert(r == 0);
       return seastar::make_ready_future<store_statfs_t>(std::move(st));
     });
   });