mirror of
https://github.com/honeymoose/OpenSearch.git
synced 2025-02-18 02:44:49 +00:00
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();
|
totalShards.incrementAndGet();
|
||||||
pendingActions.incrementAndGet(); // increase by 1 until we finish all primary coordination
|
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) {
|
private void handlePrimaryResult(final PrimaryResultT primaryResult) {
|
||||||
|
Loading…
x
Reference in New Issue
Block a user