Add request version asserting during replica operation
@@ -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()) {
