We should shut down the MgrClient before osd_fast_shutdown.
This approach avoids a race condition that sometimes occurs
when the MgrClient attempts to gather `pg_stats` from the database
after it has been unmounted, or when it is in the process of being
unmounted.
Fixes: https://tracker.ceph.com/issues/56101
Signed-off-by: Laura Flores <lflores@redhat.com>
Signed-off-by: Brad Hubbard <bhubbard@redhat.com>
cct->_conf.apply_changes(nullptr);
}
+ // stop MgrClient earlier as it's more like an internal consumer of OSD
+ //
+ // should occur before unmounting the database in fast-shutdown to avoid
+ // a race condition (see https://tracker.ceph.com/issues/56101)
+ mgrc.shutdown();
+
if (cct->_conf->osd_fast_shutdown) {
// first, stop new task from being taken from op_shardedwq
// and clear all pending tasks
_exit(0);
}
- // stop MgrClient earlier as it's more like an internal consumer of OSD
- mgrc.shutdown();
-
service.start_shutdown();
// stop sending work to pgs. this just prevents any new work in _process