Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

revert: fix for fluctuating checksum #188

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 5 additions & 11 deletions deltablock.go
Original file line number Diff line number Diff line change
Expand Up @@ -941,16 +941,10 @@ func RestoreDeltaBlockBackupIncrementally(ctx context.Context, config *DeltaRest
return err
}
go func() {
var err error
finalProgress := 0

defer func() {
if _err := deltaOps.CloseVolumeDev(volDev); _err != nil {
logrus.WithError(_err).Warnf("Failed to close volume device %v", volDevName)
}

deltaOps.UpdateRestoreStatus(volDevName, finalProgress, err)

if unlockErr := lock.Unlock(); unlockErr != nil {
logrus.WithError(unlockErr).Warn("Failed to unlock")
}
Expand All @@ -963,18 +957,18 @@ func RestoreDeltaBlockBackupIncrementally(ctx context.Context, config *DeltaRest
// We want to truncate regular files, but not device
if stat.Mode().IsRegular() {
log.Infof("Truncate %v to size %v", volDevName, vol.Size)
err = volDev.Truncate(vol.Size)
if err != nil {
if err := volDev.Truncate(vol.Size); err != nil {
deltaOps.UpdateRestoreStatus(volDevName, 0, err)
return
}
}

err = performIncrementalRestore(ctx, bsDriver, config, srcVolumeName, volDevPath, lastBackup, backup)
if err != nil {
if err := performIncrementalRestore(ctx, bsDriver, config, srcVolumeName, volDevPath, lastBackup, backup); err != nil {
deltaOps.UpdateRestoreStatus(volDevName, 0, err)
return
}

finalProgress = PROGRESS_PERCENTAGE_BACKUP_TOTAL
deltaOps.UpdateRestoreStatus(volDevName, PROGRESS_PERCENTAGE_BACKUP_TOTAL, nil)
}()
return nil
}
Expand Down
Loading