From e7b97eac85d94d739cba9d9a324e9c7319271278 Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Thu, 25 Feb 2010 22:07:30 +0000 Subject: 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 --- cpp/src/qpid/cluster/Cluster.cpp | 6 ++++++ 1 file changed, 6 insertions(+) (limited to 'cpp/src/qpid/cluster/Cluster.cpp') 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; -- cgit v1.2.1