Skip to content

Commit 18df4d0

Browse files
authored
Fixing the document count in reindex data stream status in-progress indices (#122976)
1 parent a4c7d29 commit 18df4d0

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

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

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -173,7 +173,7 @@ public void onResponse(IndicesStatsResponse indicesStatsResponse) {
173173
if (sourceIndexStats == null) {
174174
totalDocsInIndex = 0;
175175
} else {
176-
DocsStats totalDocsStats = sourceIndexStats.getTotal().getDocs();
176+
DocsStats totalDocsStats = sourceIndexStats.getPrimaries().getDocs();
177177
totalDocsInIndex = totalDocsStats == null ? 0 : totalDocsStats.getCount();
178178
}
179179
IndexStats migratedIndexStats = indicesStatsResponse.getIndex(
@@ -183,7 +183,7 @@ public void onResponse(IndicesStatsResponse indicesStatsResponse) {
183183
if (migratedIndexStats == null) {
184184
reindexedDocsInIndex = 0;
185185
} else {
186-
DocsStats reindexedDocsStats = migratedIndexStats.getTotal().getDocs();
186+
DocsStats reindexedDocsStats = migratedIndexStats.getPrimaries().getDocs();
187187
reindexedDocsInIndex = reindexedDocsStats == null ? 0 : reindexedDocsStats.getCount();
188188
}
189189
inProgressMap.put(index, Tuple.tuple(totalDocsInIndex, reindexedDocsInIndex));

0 commit comments

Comments
 (0)