From c2ed5a1c9e4c7decb73eb026e7f7a8591909389f Mon Sep 17 00:00:00 2001 From: Jason Tedor Date: Tue, 5 Apr 2016 15:59:54 -0400 Subject: [PATCH] Reorder pending queue clean checks --- .../zen/publish/PendingClusterStatesQueue.java | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/core/src/main/java/org/elasticsearch/discovery/zen/publish/PendingClusterStatesQueue.java b/core/src/main/java/org/elasticsearch/discovery/zen/publish/PendingClusterStatesQueue.java index 7ab965110c8..e591f44d309 100644 --- a/core/src/main/java/org/elasticsearch/discovery/zen/publish/PendingClusterStatesQueue.java +++ b/core/src/main/java/org/elasticsearch/discovery/zen/publish/PendingClusterStatesQueue.java @@ -164,10 +164,11 @@ public class PendingClusterStatesQueue { currentMaster ); } + } else if (pendingState.stateUUID().equals(state.stateUUID())) { + assert pendingContext.committed() : "processed cluster state is not committed " + state; + contextsToRemove.add(pendingContext); + pendingContext.listener.onNewClusterStateProcessed(); } else if (state.version() >= pendingState.version()) { - assert state.supersedes(pendingState) || ( - state.nodes().getMasterNodeId() != null && - state.nodes().getMasterNodeId().equals(pendingState.nodes().getMasterNodeId())); logger.trace("processing pending state uuid[{}]/v[{}] together with state uuid[{}]/v[{}]", pendingState.stateUUID(), pendingState.version(), state.stateUUID(), state.version() ); @@ -175,10 +176,6 @@ public class PendingClusterStatesQueue { if (pendingContext.committed()) { pendingContext.listener.onNewClusterStateProcessed(); } - } else if (pendingState.stateUUID().equals(state.stateUUID())) { - assert pendingContext.committed() : "processed cluster state is not committed " + state; - contextsToRemove.add(pendingContext); - pendingContext.listener.onNewClusterStateProcessed(); } } // now ack the processed state