[jboss-dev-forums] [Design of Messaging on JBoss (Messaging/JBoss)] - Re: Server side HA and failover

timfox do-not-reply at jboss.com
Tue Oct 31 02:47:02 EST 2006


"clebert.suconic at jboss.com" wrote : Just for reference, this method from DefaultClusteredPostOffice is going to be the heart of serverSide failover:
  | 
  | 
  |   |    public void failOver(int nodeId) throws Exception
  |   |    {
  |   |        log.info("Preparing failover against node " + nodeId);
  |   |        Map subMaps = (Map)nameMaps.get(new Integer(nodeId));
  |   |        ArrayList namesToRemove = new ArrayList();
  |   |        for (Iterator iterNames = subMaps.entrySet().iterator();iterNames.hasNext();)
  |   |        {
  |   |            Map.Entry entry = (Map.Entry)iterNames.next();
  |   |            Binding binding = (Binding )entry.getValue();
  |   |            if (binding.getQueue().isClustered())
  |   |            {
  |   |                ClusteredQueue queue = (ClusteredQueue) binding.getQueue();
  |   |                if (!queue.isLocal())
  |   | 
  | 

There should be no need to check if the queue is clustered and not local, they will *always* be clustered and not local in the name map for a remote node, so this is redundant.

"clebert" wrote : 
  | 
  |   | 
  |   |                {
  |   |                    namesToRemove.add(entry);
  |   |                }
  |   |            }
  |   |        }
  |   | 
  |   |        for (Iterator iterNames = namesToRemove.iterator();iterNames.hasNext();)
  |   |        {
  |   |            Map.Entry entry = (Map.Entry)iterNames.next();
  |   |            DefaultBinding binding = (DefaultBinding)entry.getValue();           
  |   | 
  | 
The correct type is Binding, not DefaultBinding?
           
"clebert" wrote : 
  | 
  |   |            RemoteQueueStub stub = (RemoteQueueStub)binding.getQueue();
  |   |            this.removeBinding(nodeId,(String)entry.getKey());
  |   | 
  | 

The remove needs to be broadcast across the cluster so other nodes can remove the binding too

"clebert" wrote : 
  | 
  |   |            Binding newBinding = this.createBinding(this.nodeId,nodeId,binding.getCondition(),stub.getName(),stub.getChannelID(),stub.getFilter(),stub.isRecoverable());
  |   |            LocalClusteredQueue clusteredQueue = (LocalClusteredQueue )newBinding.getQueue();
  |   |            clusteredQueue.deactivate();
  |   |            clusteredQueue.load();
  |   |            clusteredQueue.activate();
  |   |            addBinding(newBinding);
  |   | 
  | 

Isn't there going to be a problem creating two bindings with the same name?




View the original post : http://www.jboss.com/index.html?module=bb&op=viewtopic&p=3981969#3981969

Reply to the post : http://www.jboss.com/index.html?module=bb&op=posting&mode=reply&p=3981969



More information about the jboss-dev-forums mailing list