summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/StoreStatus.cpp
diff options
context:
space:
mode:
authorAlan Conway <aconway@apache.org>2010-02-25 22:07:30 +0000
committerAlan Conway <aconway@apache.org>2010-02-25 22:07:30 +0000
commit4da0efff51e05d0bf06f3dd8f5f2e42ecbd00620 (patch)
treeb7deca0ab96699a24051092afb69b607940db4f6 /cpp/src/qpid/cluster/StoreStatus.cpp
parent87eab8ed54e7b13df6d247a110204fd4303041f2 (diff)
downloadqpid-python-4da0efff51e05d0bf06f3dd8f5f2e42ecbd00620.tar.gz
Last member of a cluster always has clean store.
When a cluster is reduced to a single broker, it marks its store as clean regardless of how it is shut down. If we're down to a single member we know we want to use its store to recover as there are no others. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@916475 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/StoreStatus.cpp')
-rw-r--r--cpp/src/qpid/cluster/StoreStatus.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/StoreStatus.cpp b/cpp/src/qpid/cluster/StoreStatus.cpp
index 947f81d596..648fcfbbd5 100644
--- a/cpp/src/qpid/cluster/StoreStatus.cpp
+++ b/cpp/src/qpid/cluster/StoreStatus.cpp
@@ -114,7 +114,12 @@ void StoreStatus::save() {
}
}
+bool StoreStatus::hasStore() const {
+ return state != framing::cluster::STORE_STATE_NO_STORE;
+}
+
void StoreStatus::dirty(const Uuid& clusterId_) {
+ if (!hasStore()) return;
assert(clusterId_);
clusterId = clusterId_;
shutdownId = Uuid();
@@ -123,6 +128,7 @@ void StoreStatus::dirty(const Uuid& clusterId_) {
}
void StoreStatus::clean(const Uuid& shutdownId_) {
+ if (!hasStore()) return;
assert(shutdownId_);
state = STORE_STATE_CLEAN_STORE;
shutdownId = shutdownId_;