Skip to content

Commit

Permalink
fix: backup progress should not add block failed to upload to success…
Browse files Browse the repository at this point in the history
…ful count

Longhorn 9791

Signed-off-by: Derek Su <derek.su@suse.com>
  • Loading branch information
derekbit committed Nov 12, 2024
1 parent b5b0e72 commit 138baaa
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion backupbackingimage/backupbackingimage.go
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,8 @@ func backupMapping(bsDriver backupstore.BackupStoreDriver,
return err
}

return bsDriver.Write(blkFile, rs)
err = bsDriver.Write(blkFile, rs)
return err

Check warning on line 268 in backupbackingimage/backupbackingimage.go

View check run for this annotation

Codecov / codecov/patch

backupbackingimage/backupbackingimage.go#L267-L268

Added lines #L267 - L268 were not covered by tests
}

// isBlockBeingProcessed check if the block is being processed by other goroutine and prevent redundant work
Expand Down
3 changes: 2 additions & 1 deletion deltablock.go
Original file line number Diff line number Diff line change
Expand Up @@ -425,7 +425,8 @@ func backupBlock(bsDriver BackupStoreDriver, config *DeltaBackupConfig,
return errors.Wrapf(err, "failed to get transfer data size during saving blocks")
}

if err := bsDriver.Write(blkFile, rs); err != nil {
err = bsDriver.Write(blkFile, rs)
if err != nil {
return errors.Wrapf(err, "failed to write data during saving blocks")
}

Expand Down

0 comments on commit 138baaa

Please sign in to comment.