From: Kefu Chai Date: Sat, 29 May 2021 08:24:59 +0000 (+0800) Subject: crimson/os/alienstore: do not cleanup if not started X-Git-Tag: v17.1.0~1802^2 X-Git-Url: http://git.apps.os.sepia.ceph.com/?a=commitdiff_plain;h=703545c59540b19752f079e8519c20a91b117e08;p=ceph.git crimson/os/alienstore: do not cleanup if not started there is chance stop() and umount() methods get called even if start() is not called in the error handling path. in that case, just make these methods no-op. to ensure that OSD behaves in that case. Signed-off-by: Kefu Chai --- diff --git a/src/crimson/os/alienstore/alien_store.cc b/src/crimson/os/alienstore/alien_store.cc index c2e9f1a669dc7..c8f9506842f83 100644 --- a/src/crimson/os/alienstore/alien_store.cc +++ b/src/crimson/os/alienstore/alien_store.cc @@ -95,7 +95,10 @@ seastar::future<> AlienStore::start() seastar::future<> AlienStore::stop() { - assert(tp); + if (!tp) { + // not really started yet + return seastar::now(); + } return tp->submit([this] { for (auto [cid, ch]: coll_map) { static_cast(ch.get())->collection.reset(); @@ -123,7 +126,10 @@ seastar::future<> AlienStore::mount() seastar::future<> AlienStore::umount() { logger().info("{}", __func__); - assert(tp); + if (!tp) { + // not really started yet + return seastar::now(); + } return transaction_gate.close().then([this] { return tp->submit([this] { return store->umount();