save cluster distribution in major magration task

This commit is contained in:
liugq 2023-04-01 11:35:20 +08:00
parent 3987c5db37
commit 9bd5682122
2 changed files with 5 additions and 0 deletions

View File

@ -75,6 +75,10 @@ func (h *APIHandler) createDataMigrationTask(w http.ResponseWriter, req *http.Re
totalDocs += index.Source.Docs
}
srcClusterCfg := elastic.GetConfig(clusterTaskConfig.Cluster.Source.Id)
clusterTaskConfig.Cluster.Source.Distribution = srcClusterCfg.Distribution
dstClusterCfg := elastic.GetConfig(clusterTaskConfig.Cluster.Target.Id)
clusterTaskConfig.Cluster.Target.Distribution = dstClusterCfg.Distribution
t := task2.Task{
Metadata: task2.Metadata{
Type: "pipeline",

View File

@ -84,6 +84,7 @@ func (ii *IndexInfo) GetUniqueIndexName() string{
type ClusterInfo struct {
Id string `json:"id"`
Name string `json:"name"`
Distribution string `json:"distribution,omitempty"`
}
type TaskCompleteState struct {