[ 
https://issues.apache.org/jira/browse/ARTEMIS-2716?focusedWorklogId=633794&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-633794
 ]

ASF GitHub Bot logged work on ARTEMIS-2716:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 04/Aug/21 19:56
            Start Date: 04/Aug/21 19:56
    Worklog Time Spent: 10m 
      Work Description: clebertsuconic commented on a change in pull request 
#3680:
URL: https://github.com/apache/activemq-artemis/pull/3680#discussion_r682916027



##########
File path: 
tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumPeerTest.java
##########
@@ -0,0 +1,109 @@
+/**
+ * Licensed to the Apache Software Foundation (ASF) under one or more
+ * contributor license agreements. See the NOTICE file distributed with
+ * this work for additional information regarding copyright ownership.
+ * The ASF licenses this file to You under the Apache License, Version 2.0
+ * (the "License"); you may not use this file except in compliance with
+ * the License. You may obtain a copy of the License at
+ *
+ * http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+package org.apache.activemq.artemis.tests.smoke.quorum;
+
+import java.util.Arrays;
+import java.util.LinkedList;
+import java.util.Objects;
+import java.util.concurrent.TimeUnit;
+
+import org.apache.activemq.artemis.util.ServerUtil;
+import org.apache.activemq.artemis.utils.Wait;
+import org.jboss.logging.Logger;
+import org.junit.Assert;
+import org.junit.Test;
+
+import static 
org.apache.activemq.artemis.tests.smoke.utils.Jmx.containsExactNodeIds;
+import static 
org.apache.activemq.artemis.tests.smoke.utils.Jmx.validateNetworkTopology;
+import static org.apache.activemq.artemis.tests.smoke.utils.Jmx.withBackup;
+import static org.apache.activemq.artemis.tests.smoke.utils.Jmx.withLive;
+import static org.apache.activemq.artemis.tests.smoke.utils.Jmx.withMembers;
+import static org.apache.activemq.artemis.tests.smoke.utils.Jmx.withNodes;
+
+public class ZookeeperPluggableQuorumPeerTest extends 
ZookeeperPluggableQuorumSinglePairTest {
+
+   private static final Logger LOGGER = 
Logger.getLogger(ZookeeperPluggableQuorumPeerTest.class);
+
+   public ZookeeperPluggableQuorumPeerTest() {
+      super();
+      // accepting the primary/backup vars to reuse the test, for peers, these 
are interchangeable as either can take
+      // both roles as both wish to be primary but will revert to backup
+      primary = new BrokerControl("primary-peer-a", JMX_PORT_PRIMARY, 
"zkReplicationPrimaryPeerA", PRIMARY_PORT_OFFSET);
+      backup = new BrokerControl("primary-peer-b", JMX_PORT_BACKUP, 
"zkReplicationPrimaryPeerB", BACKUP_PORT_OFFSET);
+      brokers = new LinkedList(Arrays.asList(primary, backup));
+   }
+
+   @Test
+   @Override
+   public void testBackupFailoverAndPrimaryFailback() throws Exception {
+      // peers don't request fail back by default
+      // just wait for setup to avoid partial stop of zk via fast tear down 
with async setup
+      Wait.waitFor(this::ensembleHasLeader);
+   }
+
+   @Test
+   public void testMultiPrimary_Peer() throws Exception {
+
+      final int timeout = (int) TimeUnit.SECONDS.toMillis(30);
+      LOGGER.info("starting peer b primary");
+
+      Process backupInstance = backup.startServer(this, timeout);
+
+      // alive as unreplicated, it has configured node id
+      assertTrue(Wait.waitFor(() -> 1L == 
backup.getActivationSequence().orElse(Long.MAX_VALUE).longValue()));
+
+      final String nodeID = backup.getNodeID().get();
+      Assert.assertNotNull(nodeID);
+      LOGGER.infof("NodeID: %s", nodeID);
+
+      LOGGER.info("starting peer a primary");
+      Process primaryInstance = primary.startServer(this, 0);

Review comment:
       this variable is not used.




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 633794)
    Time Spent: 28h 10m  (was: 28h)

> Implements pluggable Quorum Vote
> --------------------------------
>
>                 Key: ARTEMIS-2716
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2716
>             Project: ActiveMQ Artemis
>          Issue Type: New Feature
>            Reporter: Francesco Nigro
>            Assignee: Francesco Nigro
>            Priority: Major
>         Attachments: backup.png, primary.png
>
>          Time Spent: 28h 10m
>  Remaining Estimate: 0h
>
> This task aim to ideliver a new Quorum Vote mechanism for artemis with the 
> objectives:
> # to make it pluggable
> # to cleanly separate the election phase and the cluster member states
> # to simplify most common setups in both amount of configuration and 
> requirements (eg "witness" nodes could be implemented to support single 
> master-slave pairs)
> Post-actions to help people adopt it, but need to be thought upfront:
> # a clean upgrade path for current HA replication users
> # deprecate or integrate the current HA replication into the new version



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to