diff options
author | Sage Weil <sage@redhat.com> | 2014-08-25 06:01:07 +0200 |
---|---|---|
committer | Sage Weil <sage@redhat.com> | 2014-08-27 23:36:08 +0200 |
commit | b1cf2104756e4b97ba30891c9bec0ed68a182002 (patch) | |
tree | 46e392c9f47432e785789b7095efaf4a7af9c022 /src/mon/Paxos.h | |
parent | mon: _reset() before updating state (diff) | |
download | ceph-b1cf2104756e4b97ba30891c9bec0ed68a182002.tar.xz ceph-b1cf2104756e4b97ba30891c9bec0ed68a182002.zip |
mon/Paxos: WRITING != WRITING_PREVIOUS
This distinction is important: the update-previous state should not be
writeable, as reflected by PaxosService::is_writeable().
Signed-off-by: Sage Weil <sage@redhat.com>
Diffstat (limited to 'src/mon/Paxos.h')
-rw-r--r-- | src/mon/Paxos.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/mon/Paxos.h b/src/mon/Paxos.h index aa591de7658..dcba45805b0 100644 --- a/src/mon/Paxos.h +++ b/src/mon/Paxos.h @@ -228,6 +228,10 @@ public: * writeable. */ STATE_WRITING, + /* + * Leader/Peon is writing a new commit from a previous round. + */ + STATE_WRITING_PREVIOUS, // leader: refresh following a commit STATE_REFRESH, }; @@ -253,6 +257,8 @@ public: return "updating-previous"; case STATE_WRITING: return "writing"; + case STATE_WRITING_PREVIOUS: + return "writing-previous"; case STATE_REFRESH: return "refresh"; default: @@ -298,6 +304,9 @@ public: /// @return 'true' if we are writing an update to disk bool is_writing() const { return state == STATE_WRITING; } + /// @return 'true' if we are writing an update-previous to disk + bool is_writing_previous() const { return state == STATE_WRITING_PREVIOUS; } + /// @return 'true' if we are refreshing an update just committed bool is_refresh() const { return state == STATE_REFRESH; } |