1
0
Fork 0
mirror of https://github.com/moby/moby.git synced 2022-11-09 12:21:53 -05:00
moby--moby/libnetwork/test/networkDb
Flavio Crisciani 2d2a2bc568 Fix reapTime logic in NetworkDB
- Added remainingReapTime field in the table event.
  Wihtout it a node that did not have a state for the element
  was marking the element for deletion setting the max reapTime.
  This was creating the possibility to keep the entry being resync
  between nodes forever avoding the purpose of the reap time
  itself.

- On broadcast of the table event the node owner was rewritten
  with the local node name, this was not correct because the owner
  should continue to remain the original one of the message

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-09-21 09:37:37 -07:00
..
dbclient Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
dbserver Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
dummyclient Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00
Dockerfile NetworkDB testing infra 2017-07-27 08:50:43 -07:00
README Fix reapTime logic in NetworkDB 2017-09-21 09:37:37 -07:00
testMain.go Update logrus to v1.0.1 2017-08-07 11:20:47 -07:00

SERVER

cd test/networkdb
env GOOS=linux go build -v server/testMain.go && docker build -t fcrisciani/networkdb-test .
(only for testkit case) docker push fcrisciani/networkdb-test

Run server: docker service create --name testdb --network net1 --replicas 3 --env TASK_ID="{{.Task.ID}}" -p mode=host,target=8000 fcrisciani/networkdb-test server 8000

CLIENT

cd test/networkdb
Join cluster: docker run -it --network net1 fcrisciani/networkdb-test client join testdb 8000
Join network: docker run -it --network net1 fcrisciani/networkdb-test client join-network testdb 8000 test
Run test: docker run -it --network net1 fcrisciani/networkdb-test client write-delete-unique-keys testdb 8000 test tableBla 3 10
check table: curl "localhost:32768/gettable?nid=test&tname=table_name"