File tree Expand file tree Collapse file tree
server/src/main/java/org/elasticsearch/index/engine
x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/index/engine Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -1460,7 +1460,7 @@ private NoOpResult innerNoOp(final NoOp noOp) throws IOException {
14601460 * Executes a pre-flight check for a given NoOp.
14611461 * If this method returns a non-empty result, the engine won't process this NoOp and returns a failure.
14621462 */
1463- protected Optional <Exception > preFlightCheckForNoOp (final NoOp noOp ) {
1463+ protected Optional <Exception > preFlightCheckForNoOp (final NoOp noOp ) throws IOException {
14641464 return Optional .empty ();
14651465 }
14661466
Original file line number Diff line number Diff line change @@ -112,10 +112,11 @@ protected InternalEngine.DeletionStrategy deletionStrategyForOperation(final Del
112112 }
113113
114114 @ Override
115- protected Optional <Exception > preFlightCheckForNoOp (NoOp noOp ) {
115+ protected Optional <Exception > preFlightCheckForNoOp (NoOp noOp ) throws IOException {
116116 if (noOp .origin () == Operation .Origin .PRIMARY && hasBeenProcessedBefore (noOp )) {
117117 // See the comment in #indexingStrategyForOperation for the explanation why we can safely skip this operation.
118- return Optional .of (new AlreadyProcessedFollowingEngineException (shardId , noOp .seqNo ()));
118+ final OptionalLong existingTerm = lookupPrimaryTerm (noOp .seqNo ());
119+ return Optional .of (new AlreadyProcessedFollowingEngineException (shardId , noOp .seqNo (), existingTerm ));
119120 } else {
120121 return super .preFlightCheckForNoOp (noOp );
121122 }
You can’t perform that action at this time.
0 commit comments