diff --git a/website/source/docs/agent/http/kv.html.markdown b/website/source/docs/agent/http/kv.html.markdown index 3e8a18f174..30abd31c08 100644 --- a/website/source/docs/agent/http/kv.html.markdown +++ b/website/source/docs/agent/http/kv.html.markdown @@ -61,8 +61,9 @@ if "?recurse" is provided, the returned `X-Consul-Index` corresponds to the latest `ModifyIndex` within the prefix, and a blocking query using that "?index" will wait until any key within that prefix is updated. -`LockIndex` is the last index of a successful lock acquisition. If the lock is -held, the `Session` key provides the session that owns the lock. +`LockIndex` is the number of times this key has successfully been acquired in +a lock. If the lock is held, the `Session` key provides the session that owns +the lock. `Key` is simply the full path of the entry. @@ -114,7 +115,10 @@ be used with a PUT request: operation. This is useful as it allows leader election to be built on top of Consul. If the lock is not held and the session is valid, this increments the `LockIndex` and sets the `Session` value of the key in addition to updating - the key contents. A key does not need to exist to be acquired. + the key contents. A key does not need to exist to be acquired. If the lock is + already held by the given session, 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. * ?release=\ : This flag is used to turn the `PUT` into a lock release operation. This is useful when paired with "?acquire=" as it allows clients to