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.

add lock on dirty pages

Chris Lu72e1aff23751
diff --git a/weed/filesys/dirty_page.go b/weed/filesys/dirty_page.go
index 7a466b506e..3418dc1c9b 100644
--- a/weed/filesys/dirty_page.go
+++ b/weed/filesys/dirty_page.go
@@ -231,6 +231,10 @@ func min(x, y int64) int64 {
func (pages *ContinuousDirtyPages) ReadDirtyData(ctx context.Context, data []byte, startOffset int64) (offset int64, size int, err error) {
bufSize := int64(len(data))
+
+ pages.lock.Lock()
+ defer pages.lock.Unlock()
+
if startOffset+bufSize < pages.Offset {
return
}