15 Commits

Author SHA1 Message Date
Anthony Romano
f5b96991a1 concurrency: fetch current lock holder when creating waitlist key
The uncontended path for a mutex would fetch the minimum
revision key on the prefix after creating its entry in
the wait list. This fetch can be rolled into the txn for
creating the wait key, eliminating a round-trip for immediately
acquiring the lock.
2017-06-15 11:29:34 -07:00
Anthony Romano
d51c8bb640 concurrency: support returning response header for mutex 2017-03-13 15:23:26 -07:00
Anthony Romano
9b1fe45853 concurrency: use create max revision for locks and elections 2016-09-14 17:03:33 -07:00
Jason E. Aten
9497e9678c clientv3/concurrency: allow election on prefixes of keys.
After winning an election or obtaining a lock, we
auto-append a slash after the provided key prefix.
This avoids the previous deadlock due to waiting
on the wrong key.

Fixes #6278
2016-08-29 18:34:14 -07:00
Xiang Li
feaff17259 session: remove session manager and add ttl 2016-08-15 14:12:25 -07:00
Anthony Romano
393725fe5f clientv3/concurrency: ctx-ize Leader(), Resign(), and Unlock() 2016-05-13 10:07:35 -07:00
Gyu-Ho Lee
fd9e07a529 clientv3: update LICENSE header 2016-05-12 20:50:58 -07:00
Anthony Romano
22797c7185 clientv3/concurrency: use session lease id for mutex keys
With randomized keys, if the connection goes down, but the session remains,
the client would need complicated recovery logic to avoid deadlock.
Instead, bind the session's lease id to the lock entry; if a session tries
to reacquire the lock it will reassume its old place in the wait list.
2016-04-26 17:37:26 -07:00
Anthony Romano
489779d905 clientv3: rename comparison from CreatedRevision to CreateRevision
To match protobuf naming
2016-03-23 09:50:46 -07:00
Anthony Romano
bd832e5b0a *: migrate Godeps to vendor/ 2016-03-22 17:10:28 -07:00
Anthony Romano
360aafec76 clientv3: include a context in Client
Useful for clean up tasks
2016-03-04 09:20:44 -08:00
Anthony Romano
6d3f172c6e clientv3/concurrency: don't poll in mutex lock on early prior key delete
Lock would get the prior key on retry using WithRev(myRev - 1) instead of
using the latest revision; the Watch() would return immediately and Lock
devolves into polling.
2016-03-03 10:04:57 -08:00
Anthony Romano
3e57bbf317 clientv3: use default client kv 2016-02-25 18:13:26 -08:00
Anthony Romano
ed44bb00f8 etcdctlv3: lock command 2016-02-24 17:23:40 -08:00
Anthony Romano
d4b2044eb1 clientv3/concurrency: Mutex 2016-02-24 17:23:40 -08:00