Skip to content

Commit

Permalink
Make go vet happy
Browse files Browse the repository at this point in the history
Longhorn 7985

Signed-off-by: Derek Su <[email protected]>
  • Loading branch information
derekbit committed Feb 26, 2024
1 parent 9bdb23a commit 6e6d4f4
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions pkg/spdk/replica.go
Original file line number Diff line number Diff line change
Expand Up @@ -524,7 +524,7 @@ func constructActiveChainFromSnapshotLvolMap(replicaName string, snapshotLvolMap
if IsReplicaSnapshotLvol(replicaName, headParentSnapshotName) {
headParentSnapSvcLvol := snapshotLvolMap[headParentSnapshotName]
if headParentSnapSvcLvol == nil {
fmt.Errorf("cannot find the parent snapshot %s of the head for replica %s", headParentSnapshotName, replicaName)
return nil, fmt.Errorf("cannot find the parent snapshot %s of the head for replica %s", headParentSnapshotName, replicaName)
}
headSvcLvol = headParentSnapSvcLvol.Children[replicaName]
} else { // The parent of the head is nil or a backing image
Expand Down Expand Up @@ -1627,6 +1627,7 @@ func (r *Replica) BackupRestore(spdkClient *spdkclient.Client, backupUrl, snapsh
defer func() {
if err != nil {
// TODO: Support snapshot revert for incremental restore
logrus.Infof("Failed to start restore for backup %v, will cancel the restore", backupUrl)
}
}()

Expand All @@ -1640,7 +1641,12 @@ func (r *Replica) BackupRestore(spdkClient *spdkclient.Client, backupUrl, snapsh
return fmt.Errorf("incremental restore is not supported yet")
}

go r.completeBackupRestore(spdkClient)
go func() {
err := r.completeBackupRestore(spdkClient)
if err != nil {
r.log.WithError(err).Error("Failed to complete backup restore")
}
}()

return nil

Expand Down

0 comments on commit 6e6d4f4

Please sign in to comment.