Skip to content

SeaweedFS is a distributed storage system for object storage (S3), file systems, Iceberg table buckets, and Lance vector buckets, designed to handle billions of files with O(1) disk access and effortless horizontal scaling.

Use the correct constant when computing the offset in SearchNeedleFromSortedIndex (#6771)

Quentin D.2ae5b480a66f
diff --git a/weed/storage/erasure_coding/ec_volume.go b/weed/storage/erasure_coding/ec_volume.go
index ed3ce4e2fb..f0b6627527 100644
--- a/weed/storage/erasure_coding/ec_volume.go
+++ b/weed/storage/erasure_coding/ec_volume.go
@@ -3,14 +3,13 @@ package erasure_coding
import (
"errors"
"fmt"
- "github.com/seaweedfs/seaweedfs/weed/glog"
"math"
"os"
+ "slices"
"sync"
"time"
- "slices"
-
+ "github.com/seaweedfs/seaweedfs/weed/glog"
"github.com/seaweedfs/seaweedfs/weed/pb"
"github.com/seaweedfs/seaweedfs/weed/pb/master_pb"
"github.com/seaweedfs/seaweedfs/weed/pb/volume_server_pb"
@@ -263,7 +262,7 @@ func SearchNeedleFromSortedIndex(ecxFile *os.File, ecxFileSize int64, needleId t
key, offset, size = idx.IdxFileEntry(buf)
if key == needleId {
if processNeedleFn != nil {
- err = processNeedleFn(ecxFile, m*types.NeedleHeaderSize)
+ err = processNeedleFn(ecxFile, m*types.NeedleMapEntrySize)
}
return
}