Skip to content

Commit 371ebb1

Browse files
committed
add comment
1 parent 3fba643 commit 371ebb1

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/task/ReindexDataStreamPersistentTaskExecutor.java

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -280,6 +280,14 @@ private void copySettings(String oldIndex, String newIndex, ActionListener<Ackno
280280
}));
281281
}
282282

283+
/**
284+
* If ILM runs an async action on the source index shortly before reindexing, the results of the async action
285+
* may not yet be in the source index. For example, if a force merge has just been started by ILM, the reindex
286+
* will see the un-force-merged index. But the ILM state will be copied to destination index saying that an
287+
* async action was started, and so ILM won't force merge the destination index. To be sure that the async
288+
* action is run on the destination index, we force a retry on async actions after adding the ILM policy
289+
* to the destination index.
290+
*/
283291
private void maybeRunILMAsyncAction(String newIndex, ActionListener<AcknowledgedResponse> listener, TaskId parentTaskId) {
284292
var retryActionRequest = new RetryActionRequest(TimeValue.MAX_VALUE, TimeValue.MAX_VALUE, newIndex);
285293
retryActionRequest.setParentTask(parentTaskId);

0 commit comments

Comments
 (0)