From 11fdb68281363ee30c182cc70606ac983f78c1de Mon Sep 17 00:00:00 2001 From: Lisandro Pin Date: Mon, 16 Feb 2026 23:44:37 +0100 Subject: [PATCH] Fix superblock write error checks on volume compaction. (#8352) --- weed/storage/volume_vacuum.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/weed/storage/volume_vacuum.go b/weed/storage/volume_vacuum.go index 4cc3911a5..2c20ce634 100644 --- a/weed/storage/volume_vacuum.go +++ b/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 {