lock.Lock();
state = STATE_SHUTDOWN;
-
- if (paxos->is_writing() || paxos->is_writing_previous()) {
- dout(10) << __func__ << " flushing" << dendl;
- lock.Unlock();
- store->flush();
- lock.Lock();
- dout(10) << __func__ << " flushed" << dendl;
- }
+ wait_for_paxos_write();
if (admin_hook) {
AdminSocket* admin_socket = cct->get_admin_socket();
messenger->shutdown(); // last thing! ceph_mon.cc will delete mon.
}
-void Monitor::bootstrap()
+void Monitor::wait_for_paxos_write()
{
if (paxos->is_writing() || paxos->is_writing_previous()) {
- dout(10) << "bootstrap flushing pending write" << dendl;
+ dout(10) << __func__ << " flushing pending write" << dendl;
lock.Unlock();
store->flush();
lock.Lock();
+ dout(10) << __func__ << " flushed pending write" << dendl;
}
+}
+
+void Monitor::bootstrap()
+{
dout(10) << "bootstrap" << dendl;
+ wait_for_paxos_write();
sync_reset_requester();
unregister_cluster_logger();
}
if (prefix == "scrub") {
- while (paxos->is_writing() || paxos->is_writing_previous()) {
- lock.Unlock();
- store->flush();
- lock.Lock();
- }
+ wait_for_paxos_write();
if (is_leader()) {
int r = scrub();
reply_command(m, r, "", rdata, 0);