]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
mon: flush paxos write on shutdown
authorSage Weil <sage@redhat.com>
Mon, 25 Aug 2014 04:10:27 +0000 (21:10 -0700)
committerSage Weil <sage@redhat.com>
Wed, 27 Aug 2014 21:36:08 +0000 (14:36 -0700)
Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc

index ced69a5b0966232dbdd3443d350c8b618fdd0b6d..597f3b0c8de3223de5e6aaebdc01a7fb43ec5c9a 100644 (file)
@@ -732,10 +732,19 @@ void Monitor::update_logger()
 void Monitor::shutdown()
 {
   dout(1) << "shutdown" << dendl;
+
   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;
+  }
+
   if (admin_hook) {
     AdminSocket* admin_socket = cct->get_admin_socket();
     admin_socket->unregister_command("mon_status");