]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commitdiff
ceph_mon: Fix shutdown order to destroy Monitor before closing mon store 68399/head
authorPrashant D <pdhange@redhat.com>
Wed, 1 Apr 2026 19:14:56 +0000 (15:14 -0400)
committerPrashant D <pdhange@redhat.com>
Wed, 15 Apr 2026 19:07:25 +0000 (15:07 -0400)
Reorder monitor shutdown to ensure all SyncProvider iterators are
destroyed before the underlying mon store is closed. This avoids
iterator cleanup paths entering RocksDB internals after the DB has
already been closed, which can result in mutex lock failures and process aborts.

Fixes: https://tracker.ceph.com/issues/75834
Signed-off-by: Prashant D <pdhange@redhat.com>
(cherry picked from commit 81bd13981a1e020578335ca61bba0db05848631b)

src/ceph_mon.cc

index 63eb252e38f5c8652332da9d8d9102c1d99eed49..03c0033eb73af5a6fefae61b9cd7c4152983f1de 100644 (file)
@@ -899,14 +899,15 @@ int main(int argc, const char **argv)
   msgr->wait();
   mgr_msgr->wait();
 
-  store.close();
-
   unregister_async_signal_handler(SIGHUP, handle_mon_signal);
   unregister_async_signal_handler(SIGINT, handle_mon_signal);
   unregister_async_signal_handler(SIGTERM, handle_mon_signal);
   shutdown_async_signal_handler();
 
+  // Destroy the Monitor (and its iterators) before closing the store.
   delete mon;
+  store.close();
+
   delete msgr;
   delete mgr_msgr;