gemmellr commented on code in PR #4545:
URL: https://github.com/apache/activemq-artemis/pull/4545#discussion_r1259969152
##########
artemis-quorum-ri/src/test/java/org/apache/activemq/artemis/quorum/zookeeper/CuratorDistributedLockTest.java:
##########
@@ -84,8 +82,6 @@ public void setupEnv() throws Throwable {
}
testingServer = new TestingCluster(clusterSpecs);
testingServer.start();
- // start waits for quorumPeer!=null but not that it has started...
- Wait.waitFor(this::ensembleHasLeader);
Review Comment:
Did this actually change on the Curator side, or did you just remove the
'wait for start' as the getQuorumPeer method went away?
##########
tests/smoke-tests/src/test/java/org/apache/activemq/artemis/tests/smoke/quorum/ZookeeperPluggableQuorumPeerTest.java:
##########
@@ -48,15 +47,7 @@ public ZookeeperPluggableQuorumPeerTest() {
// 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);
Review Comment:
Again, did something change on the Curator side, or is this now potentially
doing the very 'partial stop of zk via fast tear down with async setup' this
was specifically there to avoid?
##########
artemis-quorum-ri/src/test/java/org/apache/activemq/artemis/quorum/zookeeper/CuratorDistributedLockTest.java:
##########
@@ -337,21 +333,8 @@ public void
beNotifiedOfAlreadyUnavailableManagerAfterAddingListener() throws Ex
}
}
- private boolean ensembleHasLeader() {
- return
testingServer.getServers().stream().filter(CuratorDistributedLockTest::isLeader).count()
!= 0;
- }
-
- private static boolean isLeader(TestingZooKeeperServer server) {
- if (server.getInstanceSpecs().size() == 1) {
- return true;
- }
- long leaderId = server.getQuorumPeer().getLeaderId();
- long id = server.getQuorumPeer().getId();
- return id == leaderId;
- }
-
private void stopMajorityNotLeaderNodes(boolean fromLast) throws Exception {
- List<TestingZooKeeperServer> followers =
testingServer.getServers().stream().filter(Predicates.not(CuratorDistributedLockTest::isLeader)).collect(Collectors.toList());
+ List<TestingZooKeeperServer> followers = testingServer.getServers();
Review Comment:
Is this now just stopping 'a majority of nodes' rather than the original
'majority of non-leader nodes'?
--
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]