Skip to content

Commit c2ed5a1

Browse files
committed
Reorder pending queue clean checks
1 parent 3abf817 commit c2ed5a1

File tree

1 file changed

+4
-7
lines changed

1 file changed

+4
-7
lines changed

core/src/main/java/org/elasticsearch/discovery/zen/publish/PendingClusterStatesQueue.java

Lines changed: 4 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -164,21 +164,18 @@ public synchronized void markAsProcessed(ClusterState state) {
164164
currentMaster
165165
);
166166
}
167+
} else if (pendingState.stateUUID().equals(state.stateUUID())) {
168+
assert pendingContext.committed() : "processed cluster state is not committed " + state;
169+
contextsToRemove.add(pendingContext);
170+
pendingContext.listener.onNewClusterStateProcessed();
167171
} else if (state.version() >= pendingState.version()) {
168-
assert state.supersedes(pendingState) || (
169-
state.nodes().getMasterNodeId() != null &&
170-
state.nodes().getMasterNodeId().equals(pendingState.nodes().getMasterNodeId()));
171172
logger.trace("processing pending state uuid[{}]/v[{}] together with state uuid[{}]/v[{}]",
172173
pendingState.stateUUID(), pendingState.version(), state.stateUUID(), state.version()
173174
);
174175
contextsToRemove.add(pendingContext);
175176
if (pendingContext.committed()) {
176177
pendingContext.listener.onNewClusterStateProcessed();
177178
}
178-
} else if (pendingState.stateUUID().equals(state.stateUUID())) {
179-
assert pendingContext.committed() : "processed cluster state is not committed " + state;
180-
contextsToRemove.add(pendingContext);
181-
pendingContext.listener.onNewClusterStateProcessed();
182179
}
183180
}
184181
// now ack the processed state

0 commit comments

Comments
 (0)