shell: stop long running jobs if lock is lost
This commit is contained in:
@@ -306,6 +306,10 @@ func attemptToMoveOneVolume(commandEnv *CommandEnv, volumeReplicas map[uint32][]
|
||||
|
||||
func maybeMoveOneVolume(commandEnv *CommandEnv, volumeReplicas map[uint32][]*VolumeReplica, fullNode *Node, candidateVolume *master_pb.VolumeInformationMessage, emptyNode *Node, applyChange bool) (hasMoved bool, err error) {
|
||||
|
||||
if !commandEnv.isLocked() {
|
||||
return false, fmt.Errorf("lock is lost")
|
||||
}
|
||||
|
||||
if candidateVolume.ReplicaPlacement > 0 {
|
||||
replicaPlacement, _ := super_block.NewReplicaPlacementFromByte(byte(candidateVolume.ReplicaPlacement))
|
||||
if !isGoodMove(replicaPlacement, volumeReplicas[candidateVolume.Id], fullNode, emptyNode) {
|
||||
|
||||
Reference in New Issue
Block a user