Skip to content

Commit 3e260a6

Browse files
authored
Avoiding a race condition where pending indices count is 0 at start of data stream reindex (#123765) (#123771)
1 parent 9459cc0 commit 3e260a6

File tree

3 files changed

+3
-2
lines changed

3 files changed

+3
-2
lines changed

x-pack/plugin/migrate/src/main/java/org/elasticsearch/xpack/migrate/action/GetMigrationReindexStatusTransportAction.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,7 @@ private void reportStatus(
145145
}
146146

147147
/*
148-
* This method feches doc counts for all indices in inProgressIndices (and the indices they are being reindexed into). After
148+
* This method fetches doc counts for all indices in inProgressIndices (and the indices they are being reindexed into). After
149149
* successfully fetching those, reportStatus is called.
150150
*/
151151
private void fetchInProgressStatsAndReportStatus(

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

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -93,7 +93,7 @@ protected ReindexDataStreamTask createTask(
9393
id,
9494
type,
9595
action,
96-
"id=" + taskInProgress.getId(),
96+
"Reindexing data stream " + taskInProgress.getParams().getSourceDataStream(),
9797
parentTaskId,
9898
headers
9999
);

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

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -55,6 +55,7 @@ public ReindexDataStreamTask(
5555
this.persistentTaskStartTime = persistentTaskStartTime;
5656
this.initialTotalIndices = initialTotalIndices;
5757
this.initialTotalIndicesToBeUpgraded = initialTotalIndicesToBeUpgraded;
58+
this.pending.set(initialTotalIndicesToBeUpgraded);
5859
this.completeTask = new RunOnce(() -> {
5960
if (exception == null) {
6061
markAsCompleted();

0 commit comments

Comments
 (0)