@@ -39,16 +39,19 @@ Ideally, we would use the write lock to achieve this; however, we are currently
39
39
40
40
How to use?
41
41
-----------
42
- Currently, FDB only provides ManagementAPI to lock a range.
43
- Before a user can lock a range, the user must register its identity to the database.
44
- A range can only be locked by a registered owner .
45
- The user can use the following API to register an identity and lock a range.
42
+ Currently, FDB provides the ManagementAPI for range locking, intended as an interface for FDB feature development.
43
+ Before locking a range, a user must first register their identity with the database.
44
+ Only registered users are permitted to acquire range locks .
45
+ The following API can be used to register an identity and lock a range.
46
46
47
47
Put an exclusive read lock on a range. The range must be within the user key space, aka ``"" ~ \xff ``.
48
+ The locking request is rejected with a range_lock_reject error if the range contains any existing lock with a different range, user, or lock type.
49
+ Currently, only the ExclusiveReadLock type is supported, but the design allows for future extension.
48
50
49
51
``ACTOR Future<Void> takeExclusiveReadLockOnRange(Database cx, KeyRange range, RangeLockOwnerName ownerUniqueID); ``
50
52
51
53
Release an exclusive read lock on a range. The range must be within the user key space, aka ``"" ~ \xff ``.
54
+ The release request is rejected with a range_lock_reject error if the range contains any existing lock with a different range, user, or lock type.
52
55
53
56
``ACTOR Future<Void> releaseExclusiveReadLockOnRange(Database cx, KeyRange range, RangeLockOwnerName ownerUniqueID); ``
54
57
@@ -58,7 +61,7 @@ If the execution is failed, no range is locked/unlocked.
58
61
59
62
Get exclusive read locks on the input range
60
63
61
- ``ACTOR Future<std::vector<KeyRange>> getExclusiveReadLockOnRange (Database cx, KeyRange range); ``
64
+ ``ACTOR Future<std::vector<std::pair< KeyRange, RangeLockState>>> findExclusiveReadLockOnRange (Database cx, KeyRange range); ``
62
65
63
66
Register a range lock owner to database metadata.
64
67
0 commit comments