Skip to content

Commit eb4281e

Browse files
committed
CCR side #30244
Relates #30244
1 parent d52ca33 commit eb4281e

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

test/framework/src/main/java/org/elasticsearch/index/engine/EngineTestCase.java

+2-2
Original file line numberDiff line numberDiff line change
@@ -639,7 +639,7 @@ public static void assertOpsOnReplica(
639639
// intentional
640640
assertThat(result.isCreated(), equalTo(firstOp));
641641
assertThat(result.getVersion(), equalTo(op.version()));
642-
assertThat(result.hasFailure(), equalTo(false));
642+
assertThat(result.getResultType(), equalTo(Engine.Result.Type.SUCCESS));
643643

644644
} else {
645645
Engine.DeleteResult result = replicaEngine.delete((Engine.Delete) op);
@@ -650,7 +650,7 @@ public static void assertOpsOnReplica(
650650
// intentional
651651
assertThat(result.isFound(), equalTo(firstOp == false));
652652
assertThat(result.getVersion(), equalTo(op.version()));
653-
assertThat(result.hasFailure(), equalTo(false));
653+
assertThat(result.getResultType(), equalTo(Engine.Result.Type.SUCCESS));
654654
}
655655
if (randomBoolean()) {
656656
replicaEngine.refresh("test");

x-pack/plugin/ccr/src/main/java/org/elasticsearch/xpack/ccr/action/bulk/TransportBulkShardOperationsAction.java

+2-6
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,6 @@
1313
import org.elasticsearch.common.inject.Inject;
1414
import org.elasticsearch.common.settings.Settings;
1515
import org.elasticsearch.index.engine.Engine;
16-
import org.elasticsearch.index.mapper.MapperException;
1716
import org.elasticsearch.index.shard.IndexShard;
1817
import org.elasticsearch.index.translog.Translog;
1918
import org.elasticsearch.indices.IndicesService;
@@ -68,12 +67,9 @@ private Translog.Location applyTranslogOperations(
6867
final BulkShardOperationsRequest request, final IndexShard shard, final Engine.Operation.Origin origin) throws IOException {
6968
Translog.Location location = null;
7069
for (final Translog.Operation operation : request.getOperations()) {
71-
final Engine.Result result = shard.applyTranslogOperation(operation, origin, m -> {
72-
// TODO: Figure out how to deal best with dynamic mapping updates from the leader side:
73-
throw new MapperException("dynamic mapping updates are not allowed in follow shards [" + operation + "]");
74-
});
70+
final Engine.Result result = shard.applyTranslogOperation(operation, origin);
7571
assert result.getSeqNo() == operation.seqNo();
76-
assert result.hasFailure() == false;
72+
assert result.getResultType() == Engine.Result.Type.SUCCESS;
7773
location = locationToSync(location, result.getTranslogLocation());
7874
}
7975
assert request.getOperations().length == 0 || location != null;

0 commit comments

Comments
 (0)