Skip to content

Commit

Permalink
Clarify handling of version conflict
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
jasontedor committed Jan 16, 2017
1 parent 71b89ef commit bbffd87
Showing 1 changed file with 4 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -487,6 +487,10 @@ private <T extends Result> Optional<T> checkVersionConflict(
op.versionType().explainConflictForWrites(currentVersion, expectedVersion, deleted));
result = onFailure.apply(e);
} else {
/*
* Version conflicts during recovery and on replicas are normal due to asynchronous execution; as such, we should return a
* successful result.
*/
result = onSuccess.get();
}
return Optional.of(result);
Expand Down

0 comments on commit bbffd87

Please sign in to comment.