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
correct lock accounting
chrislu03c4b2e98807
diff --git a/weed/util/lock_table.go b/weed/util/lock_table.goindex bf3da7c37f..efc4114e7e 100644--- a/weed/util/lock_table.go+++ b/weed/util/lock_table.go@@ -132,6 +132,12 @@ func (lt *LockTable[T]) ReleaseLock(key T, lock *ActiveLock) {}}+ if lock.lockType == ExclusiveLock {+ entry.activeExclusiveLockOwnerCount--+ } else {+ entry.activeSharedLockOwnerCount--+ }+// If there are no waiters, release the lockif len(entry.waiters) == 0 && entry.activeExclusiveLockOwnerCount <= 0 && entry.activeSharedLockOwnerCount <= 0 {delete(lt.locks, key)@@ -146,11 +152,6 @@ func (lt *LockTable[T]) ReleaseLock(key T, lock *ActiveLock) {fmt.Printf("\n")}}- if lock.lockType == ExclusiveLock {- entry.activeExclusiveLockOwnerCount--- } else {- entry.activeSharedLockOwnerCount--- }// Notify the next waiterentry.cond.Broadcast()