From: Sage Weil Date: Tue, 19 Aug 2014 23:44:06 +0000 (-0700) Subject: mon/Paxos: add writing and refresh states X-Git-Tag: v0.86~190^2~8 X-Git-Url: http://git-server-git.apps.pok.os.sepia.ceph.com/?a=commitdiff_plain;h=6a71159ed1de81cbbd5eac1214ea45b83413b94b;p=ceph.git mon/Paxos: add writing and refresh states The new transition will be (updating or updating-previous) -> writing -> refresh -> active Signed-off-by: Sage Weil --- diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index ed345a4144f8..5a3fdbf13a34 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -223,6 +223,13 @@ public: * Leader proposing an old value */ STATE_UPDATING_PREVIOUS, + /* + * Leader/Peon is writing a new commit. readable, but not + * writeable. + */ + STATE_WRITING, + // leader: refresh following a commit + STATE_REFRESH, }; /** @@ -244,6 +251,10 @@ public: return "updating"; case STATE_UPDATING_PREVIOUS: return "updating-previous"; + case STATE_WRITING: + return "writing"; + case STATE_REFRESH: + return "refresh"; default: return "UNKNOWN"; } @@ -284,6 +295,12 @@ public: */ bool is_updating_previous() const { return state == STATE_UPDATING_PREVIOUS; } + /// @return 'true' if we are writing an update to disk + bool is_writing() const { return state == STATE_WRITING; } + + /// @return 'true' if we are refreshing an update just committed + bool is_refresh() const { return state == STATE_REFRESH; } + private: /** * @defgroup Paxos_h_recovery_vars Common recovery-related member variables