Repository: activemq-artemis
Updated Branches:
  refs/heads/1.x b1538e7c4 -> 0a28481b2


ARTEMIS-1876 InVMNodeManager shouldn't be used if no JDBC HA is configured

When database persistence and no shared store option is being used,
Artemis is choosing to use InVMNodeManager, that is not providing
the same behaviour of FileLockNodeManager.

(cherry picked from commit f886c0bdb451c947143fba6cf07cbf8ce7f3ff4d)


Project: http://git-wip-us.apache.org/repos/asf/activemq-artemis/repo
Commit: http://git-wip-us.apache.org/repos/asf/activemq-artemis/commit/6b5f9d94
Tree: http://git-wip-us.apache.org/repos/asf/activemq-artemis/tree/6b5f9d94
Diff: http://git-wip-us.apache.org/repos/asf/activemq-artemis/diff/6b5f9d94

Branch: refs/heads/1.x
Commit: 6b5f9d943c37e169e4b5b7b14914bfde2fa38c5b
Parents: b1538e7
Author: Francesco Nigro <[email protected]>
Authored: Tue May 22 09:35:48 2018 +0200
Committer: Francesco Nigro <[email protected]>
Committed: Tue May 22 09:44:16 2018 +0200

----------------------------------------------------------------------
 .../activemq/artemis/core/server/impl/ActiveMQServerImpl.java    | 4 ++--
 .../artemis/core/config/impl/HAPolicyConfigurationTest.java      | 4 ++--
 2 files changed, 4 insertions(+), 4 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b5f9d94/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
----------------------------------------------------------------------
diff --git 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
index 7d8a956..faf6e0b 100644
--- 
a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
+++ 
b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/impl/ActiveMQServerImpl.java
@@ -461,10 +461,10 @@ public class ActiveMQServerImpl implements ActiveMQServer 
{
             manager = JdbcNodeManager.with(dbConf, scheduledPool, 
executorFactory, shutdownOnCriticalIO);
          } else if (haType == null || haType == 
HAPolicyConfiguration.TYPE.LIVE_ONLY) {
             if (logger.isDebugEnabled()) {
-               logger.debug("Detected no Shared Store HA options on JDBC 
store: will use InVMNodeManager");
+               logger.debug("Detected no Shared Store HA options on JDBC 
store");
             }
             //LIVE_ONLY should be the default HA option when HA isn't 
configured
-            manager = new InVMNodeManager(replicatingBackup);
+            manager = new FileLockNodeManager(directory, replicatingBackup, 
configuration.getJournalLockAcquisitionTimeout());
          } else {
             throw new IllegalArgumentException("JDBC persistence allows only 
Shared Store HA options");
          }

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/6b5f9d94/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java
----------------------------------------------------------------------
diff --git 
a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java
 
b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java
index 4d9bf75..2a23613 100644
--- 
a/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java
+++ 
b/artemis-server/src/test/java/org/apache/activemq/artemis/core/config/impl/HAPolicyConfigurationTest.java
@@ -33,7 +33,7 @@ import 
org.apache.activemq.artemis.core.server.cluster.ha.SharedStoreSlavePolicy
 import org.apache.activemq.artemis.core.server.impl.Activation;
 import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl;
 import org.apache.activemq.artemis.core.server.impl.ColocatedActivation;
-import org.apache.activemq.artemis.core.server.impl.InVMNodeManager;
+import org.apache.activemq.artemis.core.server.impl.FileLockNodeManager;
 import org.apache.activemq.artemis.core.server.impl.LiveOnlyActivation;
 import 
org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation;
 import 
org.apache.activemq.artemis.core.server.impl.SharedNothingLiveActivation;
@@ -54,7 +54,7 @@ public class HAPolicyConfigurationTest extends 
ActiveMQTestBase {
       assertEquals(HAPolicyConfiguration.TYPE.LIVE_ONLY, 
server.getConfiguration().getHAPolicyConfiguration().getType());
       try {
          server.start();
-         assertThat(server.getNodeManager(), 
instanceOf(InVMNodeManager.class));
+         assertThat(server.getNodeManager(), 
instanceOf(FileLockNodeManager.class));
       } finally {
          server.stop();
       }

Reply via email to