]> git-server-git.apps.pok.os.sepia.ceph.com Git - ceph.git/commit
mon/Paxos: make backend write async
authorSage Weil <sage@redhat.com>
Tue, 19 Aug 2014 23:48:34 +0000 (16:48 -0700)
committerSage Weil <sage@redhat.com>
Wed, 27 Aug 2014 21:36:08 +0000 (14:36 -0700)
commita0e0b9bb2c9851bef4399065c7c7428f5a077871
tree6903654787a87e7aedcae36ae3c08cc2421cd1f4
parent3dcea3b783c4de9a5204f0d091b9622ea9684914
mon/Paxos: make backend write async

Move into the WRITING state and do the write to leveldb (or whatever the
backend is) asynchronously.

A few tricks here:
 - we can't do the is_updating() state check because we will always be in
   REFRESH.  Instead, make commit_proposal() tolerate the case where it is
   called but the top proposal isn't the one we just did (or the list is
   empty).  This makes the callers simpler.
 - do_refresh() may call bootstrap.  If we do bootstrap while in REFRESH,
   don't do a sync/flush on the backend store because *we* are async
   completion thread and we'll deadlock.  All other callers need to wait
   for this, though!

Signed-off-by: Sage Weil <sage@redhat.com>
src/mon/Monitor.cc
src/mon/Paxos.cc
src/mon/Paxos.h