Skip to content

Commit bbffd87

Browse files
committed
Clarify handling of version conflict
This commit adds a comment explaining why version conflicts during recovery and on replicas are considered normal and thus why we return a successful result.
1 parent 71b89ef commit bbffd87

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

core/src/main/java/org/elasticsearch/index/engine/InternalEngine.java

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -487,6 +487,10 @@ private <T extends Result> Optional<T> checkVersionConflict(
487487
op.versionType().explainConflictForWrites(currentVersion, expectedVersion, deleted));
488488
result = onFailure.apply(e);
489489
} else {
490+
/*
491+
* Version conflicts during recovery and on replicas are normal due to asynchronous execution; as such, we should return a
492+
* successful result.
493+
*/
490494
result = onSuccess.get();
491495
}
492496
return Optional.of(result);

0 commit comments

Comments
 (0)