R · Release
A lock release request. token is the fencing token that acquire returned, and the key is released only when it matches the token currently held. The response is Released R or Not Found N.
token — the Guard Against Releasing Someone Else's Lock
Without token verification, a dangerous sequence opens up. If a release request is being retried across a failover, and in the meantime the original lock is reclaimed by lease expiry and re-granted to a different client, that late-arriving release would unlock the new holder's lock. Releasing only on a token match closes this path.
If the token differs, N (not found) comes back and the lock stays held. Release retries must always carry the same token, and response matching also uses the echoed token (see Reply Matching Rules).
Byte notation:
opis an ASCII character,tokenis binary (u64, big-endian), andkeyis UTF-8 text (variable-length, shown asNin the structure). The trailing\nis0A. The fixed header is a binary value that may contain0x0A, so it must be consumed by byte count first, before scanning for the newline.
Flow
If a waiter exists for the released key, it's handed directly to the front of the queue with no re-contention — separately from the R (released) sent to the releaser, the waiter gets an A (acquired) carrying a new token.