Skip to content

Commit

Permalink
CCR side #30244
Browse files Browse the repository at this point in the history
Relates #30244
  • Loading branch information
dnhatn committed May 2, 2018
1 parent d52ca33 commit eb4281e
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 8 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -639,7 +639,7 @@ public static void assertOpsOnReplica(
// intentional
assertThat(result.isCreated(), equalTo(firstOp));
assertThat(result.getVersion(), equalTo(op.version()));
assertThat(result.hasFailure(), equalTo(false));
assertThat(result.getResultType(), equalTo(Engine.Result.Type.SUCCESS));

} else {
Engine.DeleteResult result = replicaEngine.delete((Engine.Delete) op);
Expand All @@ -650,7 +650,7 @@ public static void assertOpsOnReplica(
// intentional
assertThat(result.isFound(), equalTo(firstOp == false));
assertThat(result.getVersion(), equalTo(op.version()));
assertThat(result.hasFailure(), equalTo(false));
assertThat(result.getResultType(), equalTo(Engine.Result.Type.SUCCESS));
}
if (randomBoolean()) {
replicaEngine.refresh("test");
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import org.elasticsearch.common.inject.Inject;
import org.elasticsearch.common.settings.Settings;
import org.elasticsearch.index.engine.Engine;
import org.elasticsearch.index.mapper.MapperException;
import org.elasticsearch.index.shard.IndexShard;
import org.elasticsearch.index.translog.Translog;
import org.elasticsearch.indices.IndicesService;
Expand Down Expand Up @@ -68,12 +67,9 @@ private Translog.Location applyTranslogOperations(
final BulkShardOperationsRequest request, final IndexShard shard, final Engine.Operation.Origin origin) throws IOException {
Translog.Location location = null;
for (final Translog.Operation operation : request.getOperations()) {
final Engine.Result result = shard.applyTranslogOperation(operation, origin, m -> {
// TODO: Figure out how to deal best with dynamic mapping updates from the leader side:
throw new MapperException("dynamic mapping updates are not allowed in follow shards [" + operation + "]");
});
final Engine.Result result = shard.applyTranslogOperation(operation, origin);
assert result.getSeqNo() == operation.seqNo();
assert result.hasFailure() == false;
assert result.getResultType() == Engine.Result.Type.SUCCESS;
location = locationToSync(location, result.getTranslogLocation());
}
assert request.getOperations().length == 0 || location != null;
Expand Down

0 comments on commit eb4281e

Please sign in to comment.