[migration] cleanup unused target config
This commit is contained in:
parent
81c9df8ef4
commit
eced674817
|
@ -153,7 +153,6 @@ type IndexMigrationBulkConfig struct {
|
|||
type IndexMigrationTargetConfig struct {
|
||||
ClusterId string `json:"cluster_id"`
|
||||
Bulk IndexMigrationBulkConfig `json:"bulk"`
|
||||
QueryDSL util.MapStr `json:"query_dsl,omitempty"`
|
||||
}
|
||||
|
||||
type PipelineTaskLoggingConfig struct {
|
||||
|
|
|
@ -1014,34 +1014,6 @@ func (p *DispatcherProcessor) splitMajorMigrationTask(taskItem *task2.Task) erro
|
|||
partitionSource.PartitionId = partitionID
|
||||
partitionSource.QueryDSL = partition.Filter
|
||||
partitionSource.QueryString = ""
|
||||
var must []interface{}
|
||||
|
||||
if partition.Other {
|
||||
must = append(must, partition.Filter)
|
||||
} else {
|
||||
must = append(must, util.MapStr{
|
||||
"range": util.MapStr{
|
||||
index.Partition.FieldName: util.MapStr{
|
||||
"gte": partition.Start,
|
||||
"lt": partition.End,
|
||||
},
|
||||
},
|
||||
})
|
||||
}
|
||||
|
||||
if targetMust != nil {
|
||||
must = append(must, targetMust...)
|
||||
}
|
||||
partitionTarget := target
|
||||
if len(must) > 0 {
|
||||
partitionTarget.QueryDSL = util.MapStr{
|
||||
"query": util.MapStr{
|
||||
"bool": util.MapStr{
|
||||
"must": must,
|
||||
},
|
||||
},
|
||||
}
|
||||
}
|
||||
|
||||
partitionMigrationTask := task2.Task{
|
||||
ParentId: []string{taskItem.ID},
|
||||
|
@ -1060,13 +1032,12 @@ func (p *DispatcherProcessor) splitMajorMigrationTask(taskItem *task2.Task) erro
|
|||
},
|
||||
ConfigString: util.MustToJSON(IndexMigrationTaskConfig{
|
||||
Source: partitionSource,
|
||||
Target: partitionTarget,
|
||||
Target: target,
|
||||
Execution: clusterMigrationTask.Settings.Execution,
|
||||
}),
|
||||
}
|
||||
partitionMigrationTask.ID = util.GetUUID()
|
||||
err = orm.Create(nil, &partitionMigrationTask)
|
||||
target.QueryDSL = nil
|
||||
if err != nil {
|
||||
return fmt.Errorf("store index migration task(partition) error: %w", err)
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue