@@ -339,28 +339,12 @@ func (c *ClusterChecker) tryUpdateMigrationStatus(ctx context.Context, clonedClu
339339 continue
340340 }
341341
342- // If there is no migration information on the master node, you need to clear the migration information on the controller.
343- if sourceNodeClusterInfo .MigratingSlot == nil {
344- log .Error ("Mismatch migrating slot, no migrating info on node" ,
345- zap .Int ("shard_index" , i ),
346- zap .String ("source_node" , sourceNode .Addr ()),
347- zap .String ("migrating_slot" , shard .MigratingSlot .String ()),
348- )
349- clonedCluster .Shards [i ].ClearMigrateState ()
350- if err = c .clusterStore .UpdateCluster (ctx , c .namespace , clonedCluster ); err != nil {
351- log .Error ("Failed to update the migrate state by UpdateCluster method" , zap .Error (err ))
352- return
353- }
354- c .updateCluster (clonedCluster )
355- continue
356- }
357- // If the migration information on the master node is inconsistent with the controller, you need to clear the migration information on the controller.
358- if sourceNodeClusterInfo .MigratingSlot != nil &&
359- ! sourceNodeClusterInfo .MigratingSlot .Equal (shard .MigratingSlot .SlotRange ) {
342+ // If there is no migration information on the source node or source node migratingslot is not eauqls shard, you need to clear the migration information on the controller.
343+ if sourceNodeClusterInfo .MigratingSlot == nil || (sourceNodeClusterInfo .MigratingSlot != nil &&
344+ ! sourceNodeClusterInfo .MigratingSlot .Equal (shard .MigratingSlot .SlotRange )) {
360345 log .Error ("Mismatch migrating slot" ,
361346 zap .Int ("shard_index" , i ),
362- zap .String ("source node cluster info migrating_slot" , sourceNodeClusterInfo .MigratingSlot .String ()),
363- zap .String ("controller migrating_slot" , shard .MigratingSlot .String ()),
347+ zap .String ("migrating_slot" , shard .MigratingSlot .String ()),
364348 )
365349 clonedCluster .Shards [i ].ClearMigrateState ()
366350 if err = c .clusterStore .UpdateCluster (ctx , c .namespace , clonedCluster ); err != nil {
0 commit comments