mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
![Flavio Crisciani](/assets/img/avatar_default.png)
- Changed the loop per network. Previous implementation was taking a ReadLock to update the reapTime but now with the residualReapTime also the bulkSync is using the same ReadLock creating possible issues in concurrent read and update of the value. The new logic fetches the list of networks and proceed to the cleanup network by network locking the database and releasing it after each network. This should ensure a fair locking avoiding to keep the database blocked for too much time. Note: The ticker does not guarantee that the reap logic runs precisely every reapTimePeriod, actually documentation says that if the routine is too long will skip ticks. In case of slowdown of the process itself it is possible that the lifetime of the deleted entries increases, it still should not be a huge problem because now the residual reaptime is propagated among all the nodes a slower node will let the deleted entry being repropagate multiple times but the state will still remain consistent. Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
15 lines
771 B
Text
15 lines
771 B
Text
SERVER
|
|
|
|
cd test/networkdb
|
|
env GOOS=linux go build -v 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"
|