Author: borges
Date: 2011-07-08 07:10:17 -0400 (Fri, 08 Jul 2011)
New Revision: 10962
Modified:
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
Log:
Set 'started=true' at replicated backup before waiting for live to stop.
Check earlier for 'started'==true at start()
Modified:
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
---
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-07-08
11:09:48 UTC (rev 10961)
+++
branches/HORNETQ-720_Replication/hornetq-core/src/main/java/org/hornetq/core/server/impl/HornetQServerImpl.java 2011-07-08
11:10:17 UTC (rev 10962)
@@ -564,13 +564,13 @@
log.info("HornetQ Backup Server version " +
getVersion().getFullVersion() + " [" + nodeManager.getNodeId() +
"] started, waiting live to fail before it gets active");
+ started = true;
nodeManager.awaitLiveNode();
// Server node (i.e. Life node) is not running, now the backup takes over.
replicationEndpoint.stop();
configuration.setBackup(false);
initialisePart2();
- started = true;
}
catch (Exception e)
@@ -614,20 +614,21 @@
{
initialiseLogging();
+ if (started)
+ {
+ log.info((configuration.isBackup() ? "backup" : "live") +
" is already started, ignoring the call to start..");
+ return;
+ }
+
checkJournalDirectory();
nodeManager = createNodeManager(configuration.getJournalDirectory());
nodeManager.start();
- if (started)
- {
- HornetQServerImpl.log.info((configuration.isBackup() ? "backup" :
"live") + " is already started, ignoring the call to start..");
- return;
- }
+ HornetQServerImpl.log.info((configuration.isBackup() ? "backup" :
"live") +
+ " server is starting with configuration " + configuration);
- HornetQServerImpl.log.info((configuration.isBackup() ? "backup" :
"live") + " server is starting with configuration " + configuration);
-
if (configuration.isRunSyncSpeedTest())
{
SyncSpeedTest test = new SyncSpeedTest();
Show replies by date