]> 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 68166/head
authorPrashant D <pdhange@redhat.com>
Wed, 1 Apr 2026 19:14:56 +0000 (15:14 -0400)
committerPrashant D <pdhange@redhat.com>
Wed, 1 Apr 2026 19:14:56 +0000 (15:14 -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>
src/ceph_mon.cc

index 8c616049b8639d84730cbdea69b8baa43c71e75b..de6682bea66e4daf360057b9ee53d99c3b8a2634 100644 (file)
@@ -903,14 +903,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;