From 86f56ee4a1545d648e6c033e9c68bd4d28c6df39 Mon Sep 17 00:00:00 2001 From: James Phillips Date: Sat, 14 Nov 2015 10:28:14 -0800 Subject: [PATCH] Adds a note about the new acquire behavior into the sessions internals guide. --- website/source/docs/internals/sessions.html.markdown | 12 +++++++++--- 1 file changed, 9 insertions(+), 3 deletions(-) diff --git a/website/source/docs/internals/sessions.html.markdown b/website/source/docs/internals/sessions.html.markdown index ef666148a8..d864da5ecc 100644 --- a/website/source/docs/internals/sessions.html.markdown +++ b/website/source/docs/internals/sessions.html.markdown @@ -109,9 +109,15 @@ and is then referred to by its ID. The Key/Value API is extended to support an `acquire` and `release` operation. The `acquire` operation acts like a Check-And-Set operation except it -can only succeed if there is no existing lock holder. On success, there -is a normal key update, but there is also an increment to the `LockIndex`, -and the `Session` value is updated to reflect the session holding the lock. +can only succeed if there is no existing lock holder (the current lock holder +can re-`acquire`, see below). On success, there is a normal key update, but +there is also an increment to the `LockIndex`, and the `Session` value is +updated to reflect the session holding the lock. + +If the lock is already held by the given session during an `acquire`, then +the `LockIndex` is not incremented but the key contents are updated. This +lets the current lock holder update the key contents without having to give +up the lock and reacquire it. Once held, the lock can be released using a corresponding `release` operation, providing the same session. Again, this acts like a Check-And-Set operations