Skip to content

Commit

Permalink
rename variable names, update logs and comments
Browse files Browse the repository at this point in the history
Signed-off-by: Rahul Karajgikar <karajgik@amazon.com>
  • Loading branch information
Rahul Karajgikar committed Sep 5, 2024
1 parent 26fc0f7 commit e02aa10
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 7 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -129,11 +129,11 @@ public void testTransientErrorsDuringRecovery1AreRetried() throws Exception {
}
}
});
AtomicBoolean bb = new AtomicBoolean();
AtomicBoolean succeedFollowerChecker = new AtomicBoolean();

// Simulate followerchecker failure on 1 node when bb is false
ConnectionDelay handlingBehavior = new ConnectionDelay(() -> {
if (bb.get()) {
if (succeedFollowerChecker.get()) {
return;
}
try {
Expand All @@ -151,14 +151,14 @@ public void testTransientErrorsDuringRecovery1AreRetried() throws Exception {

// Loop runs 10 times to ensure race condition gets reproduced
for (int i = 0; i < 10; i++) {
bb.set(false);
// fail followerchecker by force to trigger node disconnect
// now followerchecker should fail and trigger node left
succeedFollowerChecker.set(false);
ClusterHealthResponse response1 = client().admin().cluster().prepareHealth().setWaitForNodes("2").get();
assertThat(response1.isTimedOut(), is(false));

// once we know a node has left, we can re-enable followerchecker to work normally
bb.set(true);
succeedFollowerChecker.set(true);
ClusterHealthResponse response2 = client().admin().cluster().prepareHealth().setWaitForNodes("3").get();
assertThat(response2.isTimedOut(), is(false));

Expand All @@ -167,7 +167,7 @@ public void testTransientErrorsDuringRecovery1AreRetried() throws Exception {
assertThat(response3.isTimedOut(), is(false));
}

bb.set(true);
succeedFollowerChecker.set(true);
response = client().admin().cluster().prepareHealth().setWaitForNodes("3").get();
assertThat(response.isTimedOut(), is(false));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1359,7 +1359,7 @@ assert getLocalNode().equals(clusterState.getNodes().get(getLocalNode().getId())

final DiscoveryNodes publishNodes = publishRequest.getAcceptedState().nodes();
// marking pending disconnects before publish
// if we try to joinRequest during pending disconnect, it should fail
// if a nodes tries to send a joinRequest while it is pending disconnect, it should fail
transportService.setPendingDisconnections(clusterChangedEvent.nodesDelta());
leaderChecker.setCurrentNodes(publishNodes);
followersChecker.setCurrentNodes(publishNodes);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -539,7 +539,7 @@ public String executor() {
}

public void sendClusterState(DiscoveryNode destination, ActionListener<PublishWithJoinResponse> listener) {
logger.info("sending cluster state over transport to node: {}", destination.getName());
logger.trace("sending cluster state over transport to node: {}", destination.getName());
if (sendFullVersion || previousState.nodes().nodeExists(destination) == false) {
logger.trace("sending full cluster state version [{}] to [{}]", newState.version(), destination);
sendFullClusterState(destination, listener);
Expand Down

0 comments on commit e02aa10

Please sign in to comment.