From: Kefu Chai Date: Thu, 2 Jul 2020 11:32:09 +0000 (+0800) Subject: crimson/os/alienstore: assert on failure X-Git-Tag: v17.0.0~1886^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=ddfba53b1c8d09700186207165515a11c64be148;p=ceph.git crimson/os/alienstore: assert on failure before we have a failure recovery, better off failing fast. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/os/alienstore/alien_store.cc b/src/crimson/os/alienstore/alien_store.cc index 445dd78b346ae..66a350e03752d 100644 --- a/src/crimson/os/alienstore/alien_store.cc +++ b/src/crimson/os/alienstore/alien_store.cc @@ -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, ghobject_t>>( std::make_tuple(std::move(objects), std::move(next))); }); @@ -202,7 +206,8 @@ seastar::future> AlienStore::list_collections() return seastar::do_with(std::vector{}, [=] (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::move(ls)); }); }); @@ -311,7 +316,8 @@ AlienStore::omap_get_values(CollectionRef ch, auto c = static_cast(ch.get()); return store->omap_get_values(c->collection, oid, keys, reinterpret_cast*>(&values)); - }).then([&values] (int) { + }).then([&values] (int r) { + assert(r == 0); return seastar::make_ready_future(std::move(values)); }); }); @@ -354,7 +360,8 @@ seastar::future<> AlienStore::do_transaction(CollectionRef ch, auto c = static_cast(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 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(std::move(st)); }); });