This closes #2096 ARTEMIS-1876 InVMNodeManager shouldn't be used if no JDBC HA is configured

This commit is contained in:
andytaylor 2018-05-22 11:17:37 +01:00
commit 4cd7b1c65c
2 changed files with 4 additions and 4 deletions

View File

@ -449,10 +449,10 @@ public class ActiveMQServerImpl implements ActiveMQServer {
manager = JdbcNodeManager.with(dbConf, scheduledPool, executorFactory, shutdownOnCriticalIO); manager = JdbcNodeManager.with(dbConf, scheduledPool, executorFactory, shutdownOnCriticalIO);
} else if (haType == null || haType == HAPolicyConfiguration.TYPE.LIVE_ONLY) { } else if (haType == null || haType == HAPolicyConfiguration.TYPE.LIVE_ONLY) {
if (logger.isDebugEnabled()) { 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 //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 { } else {
throw new IllegalArgumentException("JDBC persistence allows only Shared Store HA options"); throw new IllegalArgumentException("JDBC persistence allows only Shared Store HA options");
} }

View File

@ -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.Activation;
import org.apache.activemq.artemis.core.server.impl.ActiveMQServerImpl; 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.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.LiveOnlyActivation;
import org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation; import org.apache.activemq.artemis.core.server.impl.SharedNothingBackupActivation;
import org.apache.activemq.artemis.core.server.impl.SharedNothingLiveActivation; 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()); assertEquals(HAPolicyConfiguration.TYPE.LIVE_ONLY, server.getConfiguration().getHAPolicyConfiguration().getType());
try { try {
server.start(); server.start();
assertThat(server.getNodeManager(), instanceOf(InVMNodeManager.class)); assertThat(server.getNodeManager(), instanceOf(FileLockNodeManager.class));
} finally { } finally {
server.stop(); server.stop();
} }