You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@activemq.apache.org by cl...@apache.org on 2016/11/29 14:47:16 UTC

[1/2] activemq-artemis git commit: ARTEMIS-866 - quorum fixes

Repository: activemq-artemis
Updated Branches:
  refs/heads/master cf1c4d16c -> 5a9647cd7


ARTEMIS-866 - quorum fixes

remove reconnect attempt as it serves no purposes as replication has stopped anyway.

Ensure if vote fails thatthe latch is counted down to avoid delay.

If we can't detect live has failed signal failure in replicating.

https://issues.apache.org/jira/browse/ARTEMIS-866


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

Branch: refs/heads/master
Commit: 2d81f0a8d0df8ccca37416fabaa2a3f015e18eda
Parents: cf1c4d1
Author: Andy Taylor <an...@gmail.com>
Authored: Mon Nov 28 12:37:24 2016 +0000
Committer: Andy Taylor <an...@gmail.com>
Committed: Tue Nov 29 07:31:23 2016 +0000

----------------------------------------------------------------------
 .../cluster/qourum/QuorumVoteServerConnect.java     |  2 +-
 .../cluster/qourum/SharedNothingBackupQuorum.java   | 16 +++++-----------
 2 files changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2d81f0a8/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/QuorumVoteServerConnect.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/QuorumVoteServerConnect.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/QuorumVoteServerConnect.java
index 8eac444..582774a 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/QuorumVoteServerConnect.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/QuorumVoteServerConnect.java
@@ -111,7 +111,7 @@ public class QuorumVoteServerConnect extends QuorumVote<BooleanVote, Boolean> {
 
    @Override
    public void allVotesCast(Topology voteTopology) {
-
+      latch.countDown();
    }
 
    @Override

http://git-wip-us.apache.org/repos/asf/activemq-artemis/blob/2d81f0a8/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java
----------------------------------------------------------------------
diff --git a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java
index 2f83c45..b3e9c32 100644
--- a/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java
+++ b/artemis-server/src/main/java/org/apache/activemq/artemis/core/server/cluster/qourum/SharedNothingBackupQuorum.java
@@ -21,7 +21,6 @@ import java.util.concurrent.ScheduledExecutorService;
 import java.util.concurrent.TimeUnit;
 
 import org.apache.activemq.artemis.api.core.ActiveMQException;
-import org.apache.activemq.artemis.api.core.ActiveMQExceptionType;
 import org.apache.activemq.artemis.api.core.client.SessionFailureListener;
 import org.apache.activemq.artemis.core.client.impl.ClientSessionFactoryInternal;
 import org.apache.activemq.artemis.core.client.impl.Topology;
@@ -82,8 +81,6 @@ public class SharedNothingBackupQuorum implements Quorum, SessionFailureListener
     */
    private static final int LATCH_TIMEOUT = 30;
 
-   private static final int RECONNECT_ATTEMPTS = 5;
-
    private final Object decisionGuard = new Object();
 
    @Override
@@ -101,14 +98,11 @@ public class SharedNothingBackupQuorum implements Quorum, SessionFailureListener
             return;
          }
          if (!isLiveDown()) {
-            try {
-               // no point in repeating all the reconnection logic
-               sessionFactory.connect(RECONNECT_ATTEMPTS, false);
-               return;
-            } catch (ActiveMQException e) {
-               if (e.getType() != ActiveMQExceptionType.NOT_CONNECTED)
-                  ActiveMQServerLogger.LOGGER.errorReConnecting(e);
-            }
+            //lost connection but don't know if live is down so restart as backup as we can't replicate any more
+            signal = BACKUP_ACTIVATION.FAILURE_REPLICATING;
+         } else {
+            // live is assumed to be down, backup fails-over
+            signal = BACKUP_ACTIVATION.FAIL_OVER;
          }
 
          if (networkHealthCheck != null && networkHealthCheck.check()) {


[2/2] activemq-artemis git commit: This closes #901

Posted by cl...@apache.org.
This closes #901


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

Branch: refs/heads/master
Commit: 5a9647cd768fe635ce6a79a9f2d4bc12aad045a8
Parents: cf1c4d1 2d81f0a
Author: Clebert Suconic <cl...@apache.org>
Authored: Tue Nov 29 09:47:03 2016 -0500
Committer: Clebert Suconic <cl...@apache.org>
Committed: Tue Nov 29 09:47:03 2016 -0500

----------------------------------------------------------------------
 .../cluster/qourum/QuorumVoteServerConnect.java     |  2 +-
 .../cluster/qourum/SharedNothingBackupQuorum.java   | 16 +++++-----------
 2 files changed, 6 insertions(+), 12 deletions(-)
----------------------------------------------------------------------