Skip to content

Commit

Permalink
Ensure ReplicationOperation notify listener once (elastic#68256)
Browse files Browse the repository at this point in the history
ReplicationOperation can notify the listener twice if the primary shard 
is demoted after it has completed the primary operation.

Closes elastic#68049
  • Loading branch information
dnhatn authored Jan 31, 2021
1 parent 47622d6 commit 30d155c
Showing 1 changed file with 1 addition and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ public void execute() throws Exception {

totalShards.incrementAndGet();
pendingActions.incrementAndGet(); // increase by 1 until we finish all primary coordination
primary.perform(request, ActionListener.wrap(this::handlePrimaryResult, resultListener::onFailure));
primary.perform(request, ActionListener.wrap(this::handlePrimaryResult, this::finishAsFailed));
}

private void handlePrimaryResult(final PrimaryResultT primaryResult) {
Expand Down

0 comments on commit 30d155c

Please sign in to comment.