From e7c824871a7238697e5c534aafffee99078975cd Mon Sep 17 00:00:00 2001 From: Alan Conway Date: Wed, 6 Jan 2010 17:01:50 +0000 Subject: Added config-seq counter to track config changes since cluster init. Config-seq is recorded persitently to help identify best store when recovering from total failure. git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@896538 13f79535-47bb-0310-9956-ffa450edef68 --- cpp/src/qpid/cluster/InitialStatusMap.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) (limited to 'cpp/src/qpid/cluster/InitialStatusMap.cpp') diff --git a/cpp/src/qpid/cluster/InitialStatusMap.cpp b/cpp/src/qpid/cluster/InitialStatusMap.cpp index 59338f89d4..c6de488a40 100644 --- a/cpp/src/qpid/cluster/InitialStatusMap.cpp +++ b/cpp/src/qpid/cluster/InitialStatusMap.cpp @@ -20,7 +20,9 @@ */ #include "InitialStatusMap.h" #include "StoreStatus.h" +#include "qpid/log/Statement.h" #include +#include #include namespace qpid { @@ -138,7 +140,7 @@ MemberSet InitialStatusMap::getElders() { } // Get cluster ID from an active member or the youngest newcomer. -framing::Uuid InitialStatusMap::getClusterId() { +Uuid InitialStatusMap::getClusterId() { assert(isComplete()); assert(!map.empty()); Map::iterator i = find_if(map.begin(), map.end(), &isActive); @@ -166,6 +168,7 @@ void InitialStatusMap::checkConsistent() { Uuid shutdownId; for (Map::iterator i = map.begin(); i != map.end(); ++i) { + assert(i->second); if (i->second->getActive()) ++active; switch (i->second->getStoreState()) { case STORE_STATE_NO_STORE: ++none; break; @@ -187,10 +190,11 @@ void InitialStatusMap::checkConsistent() { // Can't mix transient and persistent members. if (none && (clean+dirty+empty)) throw Exception("Mixing transient and persistent brokers in a cluster"); + // If there are no active members and there are dirty stores there // must be at least one clean store. if (!active && dirty && !clean) - throw Exception("Cannot recover, no clean store"); + throw Exception("Cannot recover, no clean store."); } -- cgit v1.2.1