1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
Commit graph

31 commits

Author SHA1 Message Date
Madhu Venugopal
5ef8d0f038 Add watch retrigger when store restarts
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-21 21:45:52 -07:00
Santhosh Manohar
4df4ba70ca Fix the daemon panic on consul server restart
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2015-10-19 01:29:23 -07:00
Lei Jitang
82e3c49b0a Fix docker daemon failed to start with multiple cluster store address
Signed-off-by: Lei Jitang <leijitang@huawei.com>
2015-10-14 02:46:42 -04:00
Jana Radhakrishnan
72b8f80dc3 Ensure the parent directory for key prefix exists
Currently we are trying to ensure that the parent
directory exists as a key. But it is really a directory
and etcd expects it to be a directory. So made the
change to ensure that the parent key is created as
a directory and not as a simple key.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-13 10:46:37 -07:00
Madhu Venugopal
c454b1084d Merge pull request #633 from mrjana/bugs
Separate endpoint count into a different object
2015-10-11 23:41:58 -07:00
Madhu Venugopal
74376e8676 Moved the default local and global store to new root
This is required in order to provide a clean switchover.

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-11 22:57:24 -07:00
Jana Radhakrishnan
a6c2dd75b5 Synchronize datastore apis
Currently there are 3 distinct operations performed by
datastore
   - Pushing the data to the store
   - Updating the Index of the local object
   - Updating the cache (in case of localscope)

Without a lock racing datastore api calls can interleave
in various surprising ways. Best thing is to keep these
3 above operation inseparable. Use a datastore lock to
achieve this.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-11 18:51:10 -07:00
Jana Radhakrishnan
268d41835d Make bridge driver networks persistent
Since libnetwork is going to provide createNetwork
notifications only once when the network is created
bridge network needs to save it's network state in
persistent store so that it becomes available even
after restart.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-08 20:42:45 -07:00
Madhu Venugopal
284c9cd0f5 Revert "Share libkv store handles across datastore handles" 2015-10-08 15:29:07 -07:00
Madhu Venugopal
9c2541b774 Removing boltdb timeout
Now that libkv supports concurrent access to boltdb, there is no point
in depending on timeout mechanism

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-10-08 15:02:03 -07:00
Jana Radhakrishnan
3f7e26160e Share libkv store handles across datastore handles
Currently every `NewDatastore` creates a brand new
libkv store handle. This change attempts to share
the libkv store handle across various datastore handles
which share the same scope configuration. This enables
libnetwork and drivers to have different datastore handle
based on the same configuration but share the same
underlying libkv store handle.

This is mandatory for boltdb libkv backend because no two
clients can get exclusive access to boltdb file at the same
time. For other backends it just avoids the overhead of having
too many backend client instances

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 22:06:45 -07:00
Jana Radhakrishnan
d74384b1d4 Add local store caching support
Add local scope store caching support as
well as do some refactoring to make it datastore
scope aware and manage scope specific config.

Signed-off-by: Jana Radhakrishnan <mrjana@docker.com>
2015-10-06 14:15:31 -07:00
Madhu Venugopal
725280d03f Providing KVObject option to skip persisting object in kvstore
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-09-22 08:35:38 -07:00
Chun Chen
8babc3d4d3 Add local datastore to persist states of LocalScope network
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-09-21 17:58:51 +08:00
Chun Chen
ebbca4814e Update libkv to latest commit
Signed-off-by: Chun Chen <ramichen@tencent.com>
2015-09-16 18:20:26 +08:00
David Calavera
cc02894a50 Move test specific functions to a testutils package.
This way we won't vendor test related functions in docker anymore.
It also moves netns related functions to a new ns package to be able to
call the ns init function in tests. I think this also helps with the
overall package isolation.

Signed-off-by: David Calavera <david.calavera@gmail.com>
2015-09-07 13:33:28 -04:00
Alex Chan
2e64ce637b Minor spelling fixes in documentation and code comments 2015-06-26 11:02:54 +01:00
Spike Curtis
04bd8f67ad Datastore handles creating objects atomically.
In that commit, AtomicPutCreate takes previous = nil to Atomically create keys
that don't exist.  We need a create operation that is atomic to prevent races
between multiple libnetworks creating the same object.

Previously, we just created new KVs with an index of 0 and wrote them to the
datastore.  Consul accepts this behaviour and interprets index of 0 as
non-existing, but other data backends do no.

 - Add Exists() to the KV interface.  SetIndex() should also modify a KV so
   that it exists.
 - Call SetIndex() from within the GetObject() method on DataStore interface.
   - This ensures objects have the updated values for exists and index.
 - Add SetValue() to the KV interface.  This allows implementers to define
   their own method to marshall and unmarshall (as bitseq and allocator have).
 - Update existing users of the DataStore (endpoint, network, bitseq,
   allocator, ov_network) to new interfaces.
 - Fix UTs.
2015-06-25 10:53:48 -07:00
aboch
1e1eaf5937 Merge pull request #307 from mavenugo/delp
Distributed delete processing
2015-06-17 17:42:16 -07:00
Alessandro Boch
b818ea981d Add datastore to IPAM for configuration
- IPAM to use datastore for the subnets configurations

Signed-off-by: Alessandro Boch <aboch@docker.com>
2015-06-17 17:17:19 -07:00
Madhu Venugopal
2677a461de Distributed delete processing
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-17 17:11:20 -07:00
Madhu Venugopal
3b2d2aa3ee Replace swarm store with libkv
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-11 16:19:28 -07:00
Madhu Venugopal
f88824fb8a Reworked endpoint store operation to address a few cases
* Removed network from being marshalled (it is part of the key anyways)
* Reworked the watch function to handle container-id on endpoints
* Included ContainerInfo to be marshalled which needs to be synchronized
* Resolved multiple race issues by introducing data locks

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 23:59:29 -07:00
Madhu Venugopal
47a3f3690d datastore delete support for network and endpoints
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:19:31 -07:00
Madhu Venugopal
8dcdbbabd0 GetObject support
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:56 -07:00
Madhu Venugopal
dca35085f5 datastore support for Endpoint
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:55 -07:00
Madhu Venugopal
0fda541b37 Updating to new Swarm discovery and store APIs
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:55 -07:00
Madhu Venugopal
a14da7ba36 Updating to latest Swarm dependancies
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-06-10 21:17:55 -07:00
Madhu Venugopal
ae8643748d Libnetwork Host Discovery using Swarm Discovery pkg
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-25 16:29:40 -07:00
Madhu Venugopal
481568035f TOML based Configuration support for libnetwork
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-25 16:29:40 -07:00
Madhu Venugopal
9b952fc982 Initial kv store integration and datastore implementation
Signed-off-by: Madhu Venugopal <madhu@docker.com>
2015-05-25 16:29:34 -07:00