manager: No need to set volume to detached once set standby = false
The volume would be automatically detached once standby == false
@@ -459,7 +459,6 @@ func (m *VolumeManager) Activate(volumeName string, frontend string) (v *longhor
}
}
- // Need to update volume before detaching, otherwise the engine will try to continue restoring backup
v.Spec.Frontend = types.VolumeFrontend(frontend)
v.Spec.Standby = false
v, err = m.ds.UpdateVolume(v)
@@ -467,13 +466,6 @@ func (m *VolumeManager) Activate(volumeName string, frontend string) (v *longhor
return nil, err
}
- if v.Status.State != types.VolumeStateDetached && v.Status.State != types.VolumeStateDetaching {
- v, err = m.Detach(volumeName)
- if err != nil {
- return nil, errors.Wrapf(err, "failed to detach standby volume before activating it")
- }
- }
-
logrus.Debugf("Activated volume %v with frontend %v", v.Name, frontend)
return v, nil
}
