Skip to content

Commit

Permalink
Don't start migrating when a replica will start to rebuild
Browse files Browse the repository at this point in the history
Longhorn 6961

Signed-off-by: Eric Weber <[email protected]>
  • Loading branch information
ejweber committed Dec 13, 2023
1 parent ae6b6aa commit 8995d12
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions controller/volume_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3947,6 +3947,10 @@ func (c *VolumeController) prepareReplicasAndEngineForMigration(v *longhorn.Volu
case longhorn.ReplicaModeRW:
currentAvailableReplicas[dataPath] = r
case "":
if _, ok := currentEngine.Spec.ReplicaAddressMap[r.Name]; ok {
log.Debugf("Need to revert rather than starting migration since the current replica %v is already in the engine spec, which means it may start rebuilding", r.Name)
return false, true, nil
}
log.Warnf("Running replica %v wasn't added to engine, will ignore it and continue migration", r.Name)
default:
log.Warnf("Unexpected mode %v for the current replica %v, will ignore it and continue migration", currentEngine.Status.ReplicaModeMap[r.Name], r.Name)
Expand Down

0 comments on commit 8995d12

Please sign in to comment.