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.
Go blob-storagecloud-drivedistributed-file-systemdistributed-storageerasure-codingfusehadoop-hdfshdfskuberneteslancelancedbobject-storageposixs3s3-storageseaweedfstiered-file-systemvector-search
lock and unlock chunks for read
chrislu77b7c9f7ccce
diff --git a/weed/mount/page_writer/upload_pipeline_lock.go b/weed/mount/page_writer/upload_pipeline_lock.goindex 43b04e01d7..fec61b5321 100644--- a/weed/mount/page_writer/upload_pipeline_lock.go+++ b/weed/mount/page_writer/upload_pipeline_lock.go@@ -10,6 +10,8 @@ func (up *UploadPipeline) LockForRead(startOffset, stopOffset int64) {if stopOffset%up.ChunkSize > 0 {stopLogicChunkIndex += 1}+ up.chunksLock.Lock()+ defer up.chunksLock.Unlock()for i := startLogicChunkIndex; i < stopLogicChunkIndex; i++ {if count, found := up.activeReadChunks[i]; found {up.activeReadChunks[i] = count + 1@@ -25,6 +27,8 @@ func (up *UploadPipeline) UnlockForRead(startOffset, stopOffset int64) {if stopOffset%up.ChunkSize > 0 {stopLogicChunkIndex += 1}+ up.chunksLock.Lock()+ defer up.chunksLock.Unlock()for i := startLogicChunkIndex; i < stopLogicChunkIndex; i++ {if count, found := up.activeReadChunks[i]; found {if count == 1 {