aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorchrislu <chris.lu@gmail.com>2022-02-23 15:34:25 -0800
committerchrislu <chris.lu@gmail.com>2022-02-23 15:34:25 -0800
commitc29bc9a367bdb8c001fbf09703dfeca36d8f03cf (patch)
treefaf89db77b00a03f441cc18a27afbd0de1e4a480
parentda58c748bc0f9a18fb620d5929eb5e64940d0d96 (diff)
downloadseaweedfs-c29bc9a367bdb8c001fbf09703dfeca36d8f03cf.tar.xz
seaweedfs-c29bc9a367bdb8c001fbf09703dfeca36d8f03cf.zip
fix error handling
-rw-r--r--weed/storage/volume_vacuum.go11
1 files changed, 6 insertions, 5 deletions
diff --git a/weed/storage/volume_vacuum.go b/weed/storage/volume_vacuum.go
index 3bda260d9..be7f6891f 100644
--- a/weed/storage/volume_vacuum.go
+++ b/weed/storage/volume_vacuum.go
@@ -389,8 +389,7 @@ func (v *Volume) copyDataAndGenerateIndexFile(dstName, idxName string, prealloca
return err
}
- err = nm.SaveToIdx(idxName)
- return nil
+ return nm.SaveToIdx(idxName)
}
func copyDataBasedOnIndexFile(srcDatName, srcIdxName, dstDatName, datIdxName string, sb super_block.SuperBlock, version needle.Version, preallocate, compactionBytePerSecond int64, progressFn ProgressFunc) (err error) {
@@ -424,7 +423,7 @@ func copyDataBasedOnIndexFile(srcDatName, srcIdxName, dstDatName, datIdxName str
writeThrottler := util.NewWriteThrottler(compactionBytePerSecond)
- oldNm.AscendingVisit(func(value needle_map.NeedleValue) error {
+ err = oldNm.AscendingVisit(func(value needle_map.NeedleValue) error {
offset, size := value.Offset, value.Size
@@ -461,8 +460,10 @@ func copyDataBasedOnIndexFile(srcDatName, srcIdxName, dstDatName, datIdxName str
return nil
})
+ if err != nil {
+ return err
+ }
- newNm.SaveToIdx(datIdxName)
+ return newNm.SaveToIdx(datIdxName)
- return nil
}