Skip to content

Commit

Permalink
Fix cloning stuck due to having empty entries in e.Status.CloneStatus
Browse files Browse the repository at this point in the history
longhorn-3692

Signed-off-by: Phan Le <phan.le@suse.com>
  • Loading branch information
PhanLe1010 committed Jul 9, 2024
1 parent ffd2152 commit 9a9a6fe
Showing 1 changed file with 9 additions and 2 deletions.
11 changes: 9 additions & 2 deletions controller/volume_controller.go
Original file line number Diff line number Diff line change
Expand Up @@ -3495,8 +3495,15 @@ func (c *VolumeController) checkAndInitVolumeClone(v *longhorn.Volume, e *longho
if e.Spec.RequestedDataSource != "" {
e.Spec.RequestedDataSource = ""
}
if len(e.Status.CloneStatus) > 0 {
return nil

for _, status := range e.Status.CloneStatus {
// Already "in_progress"/"complete"/"error" cloning the snapshot.
// For "complete" state, we never re-initiate the cloning.
// For "in_progress" state, we wait for the result.
// For "error" state, we wait for engine controller to clear it before re-initiate the cloning.
if status != nil && status.State != "" {
return nil
}
}

sourceEngine, err := c.ds.GetVolumeCurrentEngine(sourceVolName)
Expand Down

0 comments on commit 9a9a6fe

Please sign in to comment.