Ensure ReplicationOperation notify listener once (#68256)
ReplicationOperation can notify the listener twice if the primary shard is demoted after it has completed the primary operation. Closes #68049 Signed-off-by: Peter Nied <petern@amazon.com>
This commit is contained in:
parent
da51d8c61f
commit
a37fc3be68
|
@ -119,7 +119,7 @@ public class ReplicationOperation<
|
|||
|
||||
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) {
|
||||
|
|
Loading…
Reference in New Issue