Commit Graph

82 Commits

Author SHA1 Message Date
Andrea Luzzardi a5b2e57496 Merge pull request #867 from abronan/fix_etcd_sync
Fix etcd SyncCluster and Integration tests
2015-06-05 15:56:37 -07:00
Alexandre Beslic 2a885f0853 Move test subset calls to store_test.go
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-05 15:42:25 -07:00
Alexandre Beslic 0a253a22bc Add specific tests for each store
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-05 11:48:46 -07:00
Alexandre Beslic f08bf5de21 Add PutEphemeral test for Zookeeper, implement Close method in Store interface
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-05 11:01:41 -07:00
Alexandre Beslic 8142a3189e return placeholder chan for zookeeper lock, remove check in Lock/Unlock test
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-05 10:56:17 -07:00
Alexandre Beslic 9a8edbc9e1 Factor code in store_test.go and fix key format in etcd Watches
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-05 10:56:17 -07:00
Alexandre Beslic 4b53c92081 Add timeouts for watch tests
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-05 10:56:17 -07:00
Alexandre Beslic 18cfe74d5b store: Add unit tests for pkg/store and Consul/Zookeeper/Etcd
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-05 10:56:17 -07:00
Alexandre Beslic c37bead075 Fix ephemeral with multiple keys and previous active sessions
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-04 13:34:35 -07:00
Alexandre Beslic 8373ed2c1a store: Fix Consul ephemeral behavior at agent restart by recovering the existing global session
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-04 11:52:26 -07:00
Andrea Luzzardi 6fcdb572fb Merge pull request #881 from abronan/consul_cas_fix
store: Fix CAS returning ErrKeyModified because of Lock in Consul
2015-06-04 11:44:21 -07:00
Andrea Luzzardi 3de31a3642 Merge pull request #895 from abronan/zk_list_deletetree
store: Fix zookeeper List call, implement DeleteTree
2015-06-04 11:43:55 -07:00
Alexandre Beslic 710da6479e fix zookeeper single Key watch
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-03 13:13:08 -07:00
Alexandre Beslic 178ae6f72a Fix zookeeper List call, implement DeleteTree using List
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-03 00:18:52 -07:00
Alexandre Beslic 5a4bd67db3 Put AllowStale to false in Consul Get op
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-06-01 09:30:43 -07:00
Alexandre Beslic 3f6fbb5bff Fix CAS not working for Consul
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-31 23:17:13 -07:00
Alexandre Beslic 1ccbf98ea0 pkg/store: Update documentation with latest changes
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-28 18:02:33 -07:00
Alexandre Beslic c0fe0bc17d remove sleep in integration after etcd store startup, periodic SyncCluster in etcd and include fix to SyncCluster in go-etcd lib
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-28 15:54:29 -07:00
Alexandre Beslic 6eb5cd3b5c Fix etcd SyncCluster and Integration tests
Signed-off-by: Alexandre Beslic <abronan@docker.com>
2015-05-28 09:47:11 -07:00
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