From 138baaa172d184e2496baf8237d6eaeaaa08587a Mon Sep 17 00:00:00 2001 From: Derek Su Date: Tue, 12 Nov 2024 23:58:07 +0800 Subject: [PATCH] fix: backup progress should not add block failed to upload to successful count Longhorn 9791 Signed-off-by: Derek Su --- backupbackingimage/backupbackingimage.go | 3 ++- deltablock.go | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/backupbackingimage/backupbackingimage.go b/backupbackingimage/backupbackingimage.go index 01f0f8585..15973e669 100644 --- a/backupbackingimage/backupbackingimage.go +++ b/backupbackingimage/backupbackingimage.go @@ -264,7 +264,8 @@ func backupMapping(bsDriver backupstore.BackupStoreDriver, return err } - return bsDriver.Write(blkFile, rs) + err = bsDriver.Write(blkFile, rs) + return err } // isBlockBeingProcessed check if the block is being processed by other goroutine and prevent redundant work diff --git a/deltablock.go b/deltablock.go index edb237cd7..6c14ba49d 100644 --- a/deltablock.go +++ b/deltablock.go @@ -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") }