Author: ataylor
Date: 2010-09-01 03:22:34 -0400 (Wed, 01 Sep 2010)
New Revision: 9621
Modified:
branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
Log:
fakelockfile fix
Modified:
branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java
===================================================================
---
branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2010-08-31
22:06:01 UTC (rev 9620)
+++
branches/2_2_0_HA_Improvements/src/main/org/hornetq/core/server/impl/HornetQServerImpl.java 2010-09-01
07:22:34 UTC (rev 9621)
@@ -386,7 +386,7 @@
liveLock.lock();
- log.info("Obtained live lock");
+ log.info("Live Server Obtained live lock");
// We now load the node id file, creating it, if it doesn't exist yet
File nodeIDFile = new File(configuration.getJournalDirectory(),
"node.id");
@@ -448,12 +448,13 @@
{
// We need to delete the file too, otherwise the backup will failover when we
shutdown or if the backup is
// started before the live
-
+ log.info("Live Server about to delete Live Lock file");
File liveFile = new File(configuration.getJournalDirectory(),
"live.lock");
-
+ log.info("Live Server deleting Live Lock file");
liveFile.delete();
liveLock.unlock();
+ log.info("Live server unlocking live lock");
}
}
@@ -535,16 +536,16 @@
LockFile nodeIDLockFile = createLockFile("nodeid.lock",
configuration.getJournalDirectory());
nodeIDLockFile.lock();
-
+ log.info("Backup server waiting for node id file creation");
if (!nodeIDFile.exists())
{
nodeIDLockFile.unlock();
Thread.sleep(2000);
-
+ log.info("Backup server still waiting for node id file
creation");
continue;
}
-
+ log.info("Backup server waited for node id file creation");
nodeIDLockFile.unlock();
break;
@@ -563,13 +564,14 @@
while (true)
{
File liveLockFile = new File(configuration.getJournalDirectory(),
"live.lock");
-
+ log.info("Backup server waiting for live lock file creation");
while (!liveLockFile.exists())
{
log.info("Waiting for server live lock file. Live server is not
started");
Thread.sleep(2000);
}
+ log.info("Backup server waited for live lock file creation");
liveLock = createLockFile("live.lock",
configuration.getJournalDirectory());
@@ -588,7 +590,7 @@
// continue;
// }
- log.info("Obtained live lock");
+ log.info("Backup server obtained live lock");
// Announce presence of live node to cluster
@@ -599,8 +601,7 @@
configuration.setBackup(false);
clusterManager.activate();
- //todo fix this problem with the journal
- Thread.sleep(200);
+
initialisePart2();
log.info("Back Up Server is now live");
Modified:
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java
===================================================================
---
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2010-08-31
22:06:01 UTC (rev 9620)
+++
branches/2_2_0_HA_Improvements/tests/src/org/hornetq/tests/integration/cluster/failover/FailoverTest.java 2010-09-01
07:22:34 UTC (rev 9621)
@@ -233,7 +233,7 @@
/** It doesn't fail, but it restart both servers, live and backup, and the data
should be received after the restart,
* and the servers should be able to connect without any problems. */
- public void _testRestartServers() throws Exception
+ public void testRestartServers() throws Exception
{
ServerLocator locator = getServerLocator();
Show replies by date