Commit Graph

63 Commits

Author SHA1 Message Date
Alexandre Beslic 6a92628ddb Add ErrKeyModified error to etcd and zookeeper
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-27 08:09:33 -07:00
Alexandre Beslic 97e54273e3 Add Zookeeper CAS
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 20:12:31 -07:00
Victor Vieux 44d7437ef0 Merge pull request #849 from abronan/cas_return_last_index
Return last index on CAS operation
2015-05-26 15:57:20 -07:00
Andrea Luzzardi d4672005bf Merge pull request #852 from abronan/fix_zookeeper_watch
Fix zookeeper watch that was triggered only once
2015-05-26 15:23:47 -07:00
Alexandre Beslic 142030f65d Fix comment
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 15:03:03 -07:00
Alexandre Beslic dedb0ed906 Fix zookeeper watch that was triggered only once
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 14:59:38 -07:00
Alexandre Beslic 814932ccb7 Simplify check
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 12:32:00 -07:00
Alexandre Beslic 96241c6b79 pull out the log.Fatal from pkg/store to the discovery level
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 11:01:17 -07:00
Alexandre Beslic 1040ec06e4 Return last index on CAS operation
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-26 10:39:26 -07:00
Alexandre Beslic bf6427ad23 Additional check enforcing ttl >= 10s for Consul and ephemeral entries
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-25 12:36:27 -07:00
Andrea Luzzardi b5c8062933 Merge pull request #825 from abronan/etcd_lock
store: Implement locking mechanisms with Etcd
2015-05-21 18:40:07 -07:00
Alexandre Beslic 86b144859a Add FIXME for the leader value staying set although all machines are gone
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-21 18:30:54 -07:00
Alexandre Beslic 45bd6f6815 Fix etcd Unlock that allowed other processes (non lock-holder) to unlock the key
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-21 18:27:54 -07:00
Alexandre Beslic 055551a0c8 Enhance zookeeper lock with value support
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-21 11:19:38 -07:00
Alexandre Beslic ff8f1b5fa8 Implement locking mechanisms with Etcd
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-21 01:15:14 -07:00
Andrea Luzzardi 78839ba4ea store: Improved locking API and added mocks.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-19 20:14:28 -07:00
Andrea Luzzardi 2ff9679938 store: CreateStore -> NewStore
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-19 20:13:29 -07:00
Alexandre Beslic 38f78b02b5 Reset ephemeral session on renewal failure
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 18:30:59 -07:00
Alexandre Beslic b8d72c291d Cleanup, fix Integration tests and use of a single global Session in Consul
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 15:27:39 -07:00
Alexandre Beslic 4537b9f2ba Remove unused code
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 12:57:43 -07:00
Alexandre Beslic 5d106186fb remove the periodic session renewal in Consul until we figure out what to do with etcd..
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 12:31:39 -07:00
Alexandre Beslic ec478d8ed5 Add integration tests for engines departure with node removal and ephemeral behavior
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 12:08:56 -07:00
Alexandre Beslic f81de46ab4 Fix Consul and etcd with latest changes, use etcd v2.0.11 for integration tests, remove call to SyncCluster for now (breaks the integration tests)
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 10:25:31 -07:00
Alexandre Beslic 4408a9cc8c Add Ephemeral for Consul, Zookeeper and Etcd (Etcd abd Consul are using TTLs in the background)
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-19 10:25:31 -07:00
Andrea Luzzardi 2106966d54 discovery: Watch tests for file and some other tests.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi f49ca7e20f store: Mock stores can now be created
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi b459f7c7f8 store: Add Mock store.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi 9399a8835c golint fixes.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi 5756e83fcb store/consul: Watch: Use a WaitTime so we can check stopCh.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-18 13:38:14 -07:00
Andrea Luzzardi 3e4e74c5a1 store: Close channels in case of errors in Watch/WatchTree.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-15 13:37:51 -07:00
Andrea Luzzardi 2cdca520d9 store/consul: Watch() should work even if the key doesn't exist.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-15 13:37:51 -07:00
Andrea Luzzardi c77f7332a0 store: Fixes to etcd and zk WatchTree
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-15 13:37:51 -07:00
Andrea Luzzardi 7d7e4aee13 store: Watch: Use channels instead of callbacks.
This gets rid of `CancelWatch*` functions and its usage is much simpler.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-15 13:37:51 -07:00
Andrea Luzzardi 60cfbc89c2 store: fix gofmt
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-15 00:23:38 -07:00
Andrea Luzzardi 0f61855877 store: Get rid of "discovery" log messages
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 22:35:14 -07:00
Andrea Luzzardi 924bde48e7 store: Get rid of `structs.go` as it only contains errors/config
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 22:29:33 -07:00
Andrea Luzzardi a897fa04d5 store: Watch/WatchTree: Removed unused params
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 22:25:26 -07:00
Andrea Luzzardi 2c1040971a store: Move initialize type next to initializers.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 22:10:19 -07:00
Andrea Luzzardi f87505e2e7 store: KVEntry -> KVPair
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 22:00:27 -07:00
Andrea Luzzardi 895484ec2a store: WatchRange -> WatchTree
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi 1d3aa013db store: DeleteRange -> DeleteTree
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi 6f41eabdae store: GetRange -> List
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi 1638907485 store: Fix etcd atomic operations.
- The TTL was set to 5 by error (I guess)
- There is no need to check the response, the operation fails.

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi bd18f27bda store: Refactor Atomic operations to use KVEntry.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi 93ad39c079 store: Use KVEntry in Get() for consistency with GetRange()
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi d4bdb10d35 store: Make KVEntry a struct rather than an interface.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:58:02 -07:00
Andrea Luzzardi 747a83a40a store: Cleanup initializers.
- KV is now Backend
- name (string) is now backend (Backend)
- initializers are now a static var rather than generated by init()

Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 21:32:10 -07:00
Andrea Luzzardi 23481131c4 store: Add a channel to lock that is closed if our lock is lost or an error.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-14 17:35:57 -07:00
Andrea Luzzardi 250a17e954 Merge pull request #780 from abronan/improve_helpers
Refactor helpers for storage key formatting
2015-05-14 17:02:58 -07:00
Andrea Luzzardi 04f7d2ac10 pkg/store: Remove unsused ErrSessionUndefined from consul.
Signed-off-by: Andrea Luzzardi <aluzzardi@gmail.com>
2015-05-13 19:01:01 -07:00