fix(master): fix the bug that add learner plan's overload is null.#1000578895

Signed-off-by: Wu Huocheng <wuhuocheng@oppo.com>
This commit is contained in:
Wu Huocheng 2025-12-26 15:44:05 +08:00
parent 7ea467d7cb
commit 664f2a9586

View File

@ -1235,6 +1235,27 @@ func (c *Cluster) UpdateMigrateDestination(migratePlan *proto.ClusterPlan, mpPla
return err
}
if migratePlan.Type == AddLearner {
param := &MetaPartitionPlanUserParams{
Mode: migratePlan.Mode,
Count: migratePlan.ModeCnt,
StartID: migratePlan.StartId,
EndID: migratePlan.EndId,
SelectType: migratePlan.SelectType,
ZoneName: migratePlan.ZoneName,
NodeSetID: migratePlan.NodeSetID,
SelectTag: migratePlan.SelectTag,
AutoPromoteLearner: migratePlan.AutoPromote,
}
err = c.AddLearnerToDestination(migratePlan, mpPlan, param)
if err != nil {
log.LogErrorf("AddLearnerToDestination error: %s", err.Error())
return err
}
return nil
}
// renew the planed destination meta node.
if mpPlan.CrossZone {
err = FindMigrateDestRetainZone(migratePlan, mpPlan)