diff options
| author | Alan Conway <aconway@apache.org> | 2010-03-12 20:11:31 +0000 |
|---|---|---|
| committer | Alan Conway <aconway@apache.org> | 2010-03-12 20:11:31 +0000 |
| commit | ef9268528d3147173dfb0d2ef707ee3e4fc4f210 (patch) | |
| tree | 4d8a9851683812bd04392f57c695a5143c80ca79 /cpp/src/qpid/cluster/Multicaster.h | |
| parent | 937fe6e7295efff28cb680642fca28ebf65e7d4e (diff) | |
| download | qpid-python-ef9268528d3147173dfb0d2ef707ee3e4fc4f210.tar.gz | |
New cluster member pushes store when joining an active cluster.
Previously a broker with a clean store would not be able to join an
active cluster because the shtudown-id did not match. This commit
ensures that when a broker joins an active cluster, it always pushes
its store regardless of status. Clean/dirty status is only compared
when forming an initial cluster.
This change required splitting initialization into two phases:
PRE_INIT: occurs in the Cluster ctor during early-initialize. This
phase determines whether or not to push the store.
INIT: occurs after Cluster::initialize and does the remaining
initialization chores.
git-svn-id: https://svn.apache.org/repos/asf/qpid/trunk/qpid@922412 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'cpp/src/qpid/cluster/Multicaster.h')
| -rw-r--r-- | cpp/src/qpid/cluster/Multicaster.h | 23 |
1 files changed, 14 insertions, 9 deletions
diff --git a/cpp/src/qpid/cluster/Multicaster.h b/cpp/src/qpid/cluster/Multicaster.h index 2db84a9ce0..f70bd5ca31 100644 --- a/cpp/src/qpid/cluster/Multicaster.h +++ b/cpp/src/qpid/cluster/Multicaster.h @@ -41,16 +41,18 @@ class Cpg; /** * Multicast to the cluster. Shared, thread safe object. - * - * Runs in two modes; * - * initializing: Hold connection mcast events. Multicast cluster - * events directly in the calling thread. This mode is used before - * joining the cluster where the poller may not yet be active and we - * want to hold any connection traffic till we join. + * holding mode: Hold connection events for later multicast. Cluster + * events are never held. Used during PRE_INIT/INIT state when we + * want to hold any connection traffic till we are read in the + * cluster. + * + * bypass mode: Multicast cluster events directly in the calling + * thread. This mode is used by cluster in PRE_INIT state the poller + * is not yet be active. * - * ready: normal operation. Queues all mcasts on a pollable queue, - * multicasts connection and cluster events. + * Multicaster is created in bypass+holding mode, they are disabled by + * start and setReady respectively. */ class Multicaster { @@ -65,7 +67,9 @@ class Multicaster void mcastBuffer(const char*, size_t, const ConnectionId&); void mcast(const Event& e); - /** Switch to ready mode. */ + /** Start the pollable queue, turn off bypass mode. */ + void start(); + /** Switch to ready mode, release held messages. */ void setReady(); private: @@ -81,6 +85,7 @@ class Multicaster bool ready; PlainEventQueue holdingQueue; std::vector<struct ::iovec> ioVector; + bool bypass; }; }} // namespace qpid::cluster |
