diff options
author | Alan Conway <aconway@apache.org> | 2010-01-06 17:01:50 +0000 |
---|---|---|
committer | Alan Conway <aconway@apache.org> | 2010-01-06 17:01:50 +0000 |
commit | e7c824871a7238697e5c534aafffee99078975cd (patch) | |
tree | 8fe2f397beb8f3b2e2fe94386dfee7aa168b2376 /cpp/src/qpid/cluster/InitialStatusMap.cpp | |
parent | de23cb5942844463a237cff18c30e5f43ea5d5d0 (diff) | |
download | qpid-python-e7c824871a7238697e5c534aafffee99078975cd.tar.gz |
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
Diffstat (limited to 'cpp/src/qpid/cluster/InitialStatusMap.cpp')
-rw-r--r-- | cpp/src/qpid/cluster/InitialStatusMap.cpp | 8 |
1 files changed, 6 insertions, 2 deletions
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 <algorithm> +#include <vector> #include <boost/bind.hpp> 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."); } |