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.

lock

Chris Lu01cbd5cb589f
diff --git a/weed/storage/compact_map.go b/weed/storage/compact_map.go
index 6afaf7df8a..721be2ec7a 100644
--- a/weed/storage/compact_map.go
+++ b/weed/storage/compact_map.go
@@ -41,10 +41,10 @@ func NewCompactSection(start Key) *CompactSection {
//return old entry size
func (cs *CompactSection) Set(key Key, offset uint32, size uint32) uint32 {
ret := uint32(0)
+ cs.Lock()
if key > cs.end {
cs.end = key
}
- cs.Lock()
if i := cs.binarySearchValues(key); i >= 0 {
ret = cs.values[i].Size
//println("key", key, "old size", ret)