[migration] fix task doc stats
This commit is contained in:
parent
0f0794aca7
commit
5af5b2142e
|
@ -142,11 +142,6 @@ func (h *APIHandler) getComparisonMajorTaskInfo(taskID string) (taskStats Cluste
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
{
|
|
||||||
"terms": util.MapStr{
|
|
||||||
"status": []string{task.StatusComplete, task.StatusError},
|
|
||||||
},
|
|
||||||
},
|
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
|
@ -89,23 +89,26 @@ func (h *APIHandler) getMigrationMajorTaskInfo(id string) (taskStats migration_m
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
|
|
||||||
if subTask.Status == task.StatusRunning {
|
|
||||||
indexMigrationTaskIDs = append(indexMigrationTaskIDs, subTask.ID)
|
|
||||||
continue
|
|
||||||
}
|
|
||||||
|
|
||||||
cfg := migration_model.IndexMigrationTaskConfig{}
|
cfg := migration_model.IndexMigrationTaskConfig{}
|
||||||
err = migration_util.GetTaskConfig(&subTask, &cfg)
|
err = migration_util.GetTaskConfig(&subTask, &cfg)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Errorf("failed to get task config, err: %v", err)
|
log.Errorf("failed to get task config, err: %v", err)
|
||||||
continue
|
continue
|
||||||
}
|
}
|
||||||
indexDocs := migration_util.GetMapIntValue(taskLabels, "index_docs")
|
|
||||||
taskStats.IndexDocs += indexDocs
|
|
||||||
taskStats.SourceDocs += cfg.Source.DocCount
|
taskStats.SourceDocs += cfg.Source.DocCount
|
||||||
st := indexState[indexName]
|
st := indexState[indexName]
|
||||||
st.IndexDocs += indexDocs
|
|
||||||
st.SourceDocs += cfg.Source.DocCount
|
st.SourceDocs += cfg.Source.DocCount
|
||||||
|
indexState[indexName] = st
|
||||||
|
|
||||||
|
if subTask.Status == task.StatusRunning {
|
||||||
|
indexMigrationTaskIDs = append(indexMigrationTaskIDs, subTask.ID)
|
||||||
|
continue
|
||||||
|
}
|
||||||
|
|
||||||
|
indexDocs := migration_util.GetMapIntValue(taskLabels, "index_docs")
|
||||||
|
taskStats.IndexDocs += indexDocs
|
||||||
|
st.IndexDocs += indexDocs
|
||||||
if subTask.Status == task.StatusError {
|
if subTask.Status == task.StatusError {
|
||||||
st.ErrorPartitions += 1
|
st.ErrorPartitions += 1
|
||||||
taskStats.ErrorPartitions += 1
|
taskStats.ErrorPartitions += 1
|
||||||
|
|
Loading…
Reference in New Issue