mirror of
https://github.com/seaweedfs/seaweedfs.git
synced 2024-01-19 02:48:24 +00:00
fix error handling
This commit is contained in:
parent
da58c748bc
commit
c29bc9a367
|
@ -389,8 +389,7 @@ func (v *Volume) copyDataAndGenerateIndexFile(dstName, idxName string, prealloca
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
err = nm.SaveToIdx(idxName)
|
return nm.SaveToIdx(idxName)
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
func copyDataBasedOnIndexFile(srcDatName, srcIdxName, dstDatName, datIdxName string, sb super_block.SuperBlock, version needle.Version, preallocate, compactionBytePerSecond int64, progressFn ProgressFunc) (err error) {
|
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)
|
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
|
offset, size := value.Offset, value.Size
|
||||||
|
|
||||||
|
@ -461,8 +460,10 @@ func copyDataBasedOnIndexFile(srcDatName, srcIdxName, dstDatName, datIdxName str
|
||||||
|
|
||||||
return nil
|
return nil
|
||||||
})
|
})
|
||||||
|
if err != nil {
|
||||||
newNm.SaveToIdx(datIdxName)
|
return err
|
||||||
|
}
|
||||||
return nil
|
|
||||||
|
return newNm.SaveToIdx(datIdxName)
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue