Browse Source
Fix superblock write error checks on volume compaction. (#8352)
pull/6065/merge
Lisandro Pin
2 days ago
committed by
GitHub
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
1 changed files with
3 additions and
1 deletions
-
weed/storage/volume_vacuum.go
|
|
|
@ -484,8 +484,10 @@ func (v *Volume) copyDataBasedOnIndexFile(opts *CompactOptions) (err error) { |
|
|
|
now := uint64(time.Now().Unix()) |
|
|
|
|
|
|
|
opts.superBlock.CompactionRevision++ |
|
|
|
dstDatBackend.WriteAt(opts.superBlock.Bytes(), 0) |
|
|
|
newOffset := int64(opts.superBlock.BlockSize()) |
|
|
|
if _, err := dstDatBackend.WriteAt(opts.superBlock.Bytes(), 0); err != nil { |
|
|
|
return fmt.Errorf("failed to write superblock: %v", err) |
|
|
|
} |
|
|
|
|
|
|
|
writeThrottler := util.NewWriteThrottler(opts.MaxBytesPerSecond) |
|
|
|
err = oldNm.AscendingVisit(func(value needle_map.NeedleValue) error { |
|
|
|
|