summaryrefslogtreecommitdiff
path: root/cpp/src/qpid/cluster/Cluster.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
commite7b97eac85d94d739cba9d9a324e9c7319271278 (patch)
treeb7deca0ab96699a24051092afb69b607940db4f6 /cpp/src/qpid/cluster/Cluster.cpp
parent03ecf45238664de222833824f9229f810beedc0e (diff)
downloadqpid-python-e7b97eac85d94d739cba9d9a324e9c7319271278.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/Cluster.cpp')
-rw-r--r--cpp/src/qpid/cluster/Cluster.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/cpp/src/qpid/cluster/Cluster.cpp b/cpp/src/qpid/cluster/Cluster.cpp
index e718819f48..08646e5a6b 100644
--- a/cpp/src/qpid/cluster/Cluster.cpp
+++ b/cpp/src/qpid/cluster/Cluster.cpp
@@ -914,6 +914,12 @@ void Cluster::memberUpdate(Lock& l) {
size_t size = urls.size();
failoverExchange->updateUrls(urls);
+ if (store.hasStore()) {
+ // Mark store clean if I am the only broker, dirty otherwise.
+ if (size == 1) store.clean(Uuid(true));
+ else store.dirty(clusterId);
+ }
+
if (size == 1 && lastSize > 1 && state >= CATCHUP) {
QPID_LOG(notice, *this << " last broker standing, update queue policies");
lastBroker = true;