Skip to content

Commit 9578b16

Browse files
committed
WIP
1 parent 2008217 commit 9578b16

File tree

2 files changed

+12
-2
lines changed

2 files changed

+12
-2
lines changed

server/src/main/java/org/elasticsearch/cluster/action/shard/ShardStateAction.java

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -719,7 +719,9 @@ public ClusterState execute(BatchExecutionContext<StartedShardUpdateTask> batchE
719719
tasksToBeApplied.add(taskContext);
720720
} else if (invalidShardSplit(startedShardEntry, projectId, initialState)) {
721721
logger.debug("{} failing shard started task because split validation failed", startedShardEntry.shardId);
722-
// TODO: Determine correct behavior
722+
// TODO: Currently invalid shard split triggers if the primary term changes, the source primary term changes or
723+
// is >= the target primary term or if the source is relocating. In the second and third scenario this will be
724+
// swallow currently. In the split process we will need to handle this.
723725
taskContext.success(task::onSuccess);
724726
} else {
725727
logger.debug(

server/src/main/java/org/elasticsearch/indices/cluster/IndicesClusterStateService.java

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1035,7 +1035,15 @@ public void onRecoveryDone(
10351035
timestampMillisFieldRange,
10361036
eventIngestedMillisFieldRange,
10371037
sourcePrimaryTerm,
1038-
ActionListener.noop()
1038+
new ActionListener<>() {
1039+
@Override
1040+
public void onResponse(Void unused) {}
1041+
1042+
@Override
1043+
public void onFailure(Exception e) {
1044+
onRecoveryFailure(new RecoveryFailedException(state, "failed to start after split", e), true);
1045+
}
1046+
}
10391047
);
10401048
} else {
10411049
shardStateAction.shardStarted(

0 commit comments

Comments
 (0)