Add request version asserting during replica operation (#23167)

This commit is contained in:
Areek Zillur 2017-02-14 15:17:13 -05:00
parent a7a3729596
commit e178dc5493
1 changed files with 3 additions and 0 deletions

View File

@ -369,6 +369,9 @@ public class TransportShardBulkAction extends TransportWriteAction<BulkShardRequ
BulkItemRequest item = request.items()[i];
if (item.isIgnoreOnReplica() == false) {
DocWriteRequest docWriteRequest = item.request();
// ensure request version is updated for replica operation during request execution in the primary
assert docWriteRequest.versionType() == docWriteRequest.versionType().versionTypeForReplicationAndRecovery()
: "unexpected version in replica " + docWriteRequest.version();
final Engine.Result operationResult;
try {
switch (docWriteRequest.opType()) {