Commit graph

1835 commits

Author SHA1 Message Date
Sebastiaan van Stijn
7bd4fc1de4 Improve debugging for resolver
This patch improves debugging for the resolver;

- prefix debug messages with `[resolver]` for easier finding in the daemon logs
- use `A` / `AAAA` for query-types in the logs instead of their numeric code
- add debug messages if the external DNS did not return a result
- print sucessful results (t.b.d.)

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-08-02 17:57:15 +02:00
Flavio Crisciani
d6440c9139 optimize the rebroadcast for failure case
Before when a node was failing, all the nodes would bump the lamport time of all their
entries. This means that if a node flap, there will be a storm of update of all the entries.
This commit on the base of the previous logic guarantees that only the node that joins back
will readvertise its own entries, the other nodes won't need to advertise again.

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-01 14:08:54 -07:00
Flavio Crisciani
a3ecb8902a fix join/leave
join/leave fixes:
 - when a node leaves the network will deletes all the other nodes entries but will keep track of its
   to make sure that other nodes if they are tcp syncing will be aware of them being deleted. (a node that
   did not yet receive the network leave will potentially tcp/sync)

add network reapTime, was not being set locally

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-01 14:08:45 -07:00
Flavio Crisciani
e77c245e45 2x faster to converge
- Introduced back the Invalidate
- optimized the rebroadcast logic

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-08-01 13:47:18 -07:00
Madhu Venugopal
c20c075e20 Merge pull request #1868 from yyb196/fix-error-in-restore-ep
Fixes bug that mistook gw6 for gw.
2017-07-31 17:09:22 -07:00
Madhu Venugopal
ba22d5b8b9 Merge pull request #1861 from fcrisciani/waitgrp_channel
Funnel peerAdd and peerDelete in a channel
2017-07-31 11:48:14 -07:00
Flavio Crisciani
fee89e0490 Funnel peerAdd and peerDelete in a channel
Remove the need for the wait group and avoid new
locks
Added utility to print the method name and the caller name

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-31 09:15:55 -07:00
Frank Yang
115519e0b3 Fixes bug that mistook gw6 for gw.
Signed-off-by: Frank Yang <yyb196@gmail.com>
2017-07-31 22:24:44 +08:00
Madhu Venugopal
b1bfc4d919 Merge pull request #1834 from fcrisciani/network-db-infra
NetworkDB testing infra
2017-07-28 17:05:34 -07:00
Santhosh Manohar
d51ed8a97b Remove the error message on mac delete failure..
Deletion of the dynamic mac is expected to work only if there was active
traffic with that endpoint and a dynamic entry exists. It can also age
out. Hence the mac removal failing is not error. Removing it to make the
debugging easier when parsing the logs.

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-07-28 15:40:21 -07:00
Madhu Venugopal
b90d0c0ed2 Merge pull request #1799 from abhinandanpb/byte_offset
Fixing issue with bit allocation byteoffset calculation
2017-07-28 14:17:58 -07:00
Flavio Crisciani
ecb3daa49e Fix warn log
format wrong

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-28 13:30:53 -07:00
Flavio Crisciani
e5bba51d4f Revert "use builtin package context rather than vendored one"
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-28 11:23:40 -07:00
Madhu Venugopal
7a064d0ec0 Merge pull request #1842 from sanimej/arp
Attempt neighbor entry reprogramming on L3 miss
2017-07-28 00:27:58 -07:00
Flavio Crisciani
585964bf32 NetworkDB testing infra
- Diagnose framework that exposes REST API for db interaction
- Dockerfile to build the test image
- Periodic print of stats regarding queue size
- Client and server side for integration with testkit
- Added write-delete-leave-join
- Added test write-delete-wait-leave-join
- Added write-wait-leave-join

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-27 08:50:43 -07:00
Flavio Crisciani
60b5add4af NetworkDB allow setting PacketSize
- Introduce the possibility to specify the max buffer length
  in network DB. This will allow to use the whole MTU limit of
  the interface

- Add queue stats per network, it can be handy to identify the
  node's throughput per network and identify unbalance between
  nodes that can point to an MTU missconfiguration

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-26 13:44:33 -07:00
Santhosh Manohar
e7b8e4413b Merge pull request #1845 from wenjianhn/bug-1827
iptables: jump to DOCKER-USER first
2017-07-25 22:20:43 -07:00
Onur Filiz
1c67f2592b Fix the Gateway type in remote network plugin spec
Fixes #1745.

Signed-off-by: Onur Filiz <onur.filiz@microsoft.com>
2017-07-25 15:26:42 -07:00
Flavio Crisciani
daba67d67b Avoid flakiness of TestLinkContainers
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-21 13:54:19 -07:00
Jacob Wen
5c01dcd401 iptables: jump to DOCKER-USER first
Fixes #1827

Signed-off-by: Jacob Wen <jian.w.wen@oracle.com>
2017-07-20 16:38:14 +08:00
Flavio Crisciani
051a0d5ce9 NetworkDB incorrect number of entries in networkNodes
A rapid (within networkReapTime 30min) leave/join network
can corrupt the list of nodes per network with multiple copies
of the same nodes.
The fix makes sure that each node is present only once

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-18 16:57:49 -07:00
John Howard
738fc5201b Fix debug statement in startResolver
Signed-off-by: John Howard <jhoward@microsoft.com>
2017-07-17 14:35:16 -07:00
Santhosh Manohar
a50e885121 When the gc_thresh3 value is reached kenel might remove existing
neighbor entries. On an l3 miss try to reprogram the neighbor entry
if the peer is valid. Its a best effort attempt because if the arp
table is still at gc_thresh3 value, addition will fail.

Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-07-13 17:01:30 -07:00
allencloud
680832b7b0 use builtin package context rather than vendored one
Signed-off-by: allencloud <allen.sun@daocloud.io>
2017-07-13 14:03:42 +08:00
Santhosh Manohar
2134018617 Merge pull request #1831 from fcrisciani/gosimple
Add gosimple tool
2017-07-10 23:38:10 -07:00
Sebastiaan van Stijn
3dd1fb1217 Make node join event logging less noisy
Commit ca9a768d80
added a number of debugging messages for node join/leave
events.

This patch checks if a node already was listed,
and otherwise skips the logging to make the logs a bit
less noisy.

Signed-off-by: Sebastiaan van Stijn <github@gone.nl>
2017-07-10 17:25:14 -07:00
Abhinandan Prativadi
746070c39a Adding a unit test to catch offset scenarios
Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2017-07-10 11:30:06 -07:00
Madhu Venugopal
d01e1d38c3 Merge pull request #1755 from msabansal/msabansal/ics
Changes to support ICS network on windows
2017-07-07 18:28:13 +05:30
Flavio Crisciani
af5e370627 Add gosimple check
Add the gosimple tool check in the Makefile
Fix all the issues identified

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-07-06 09:42:38 -07:00
Santhosh Manohar
6bd57f977d Fix go generate for protobuf
Signed-off-by: Santhosh Manohar <santhosh@docker.com>
2017-07-05 16:31:12 -07:00
Flavio Crisciani
f969f26966 Service discovery race on serviceBindings delete. Bug on IP reuse (#1808)
* Correct SetMatrix documentation

The SetMatrix is a generic data structure, so the description
should not be tight to any specific use

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>

* Service Discovery reuse name and serviceBindings deletion

- Added logic to handle name reuse from different services
- Moved the deletion from the serviceBindings map at the end
  of the rmServiceBindings body to avoid race with new services

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>

* Avoid race on network cleanup

Use the locker to avoid the race between the network
deletion and new endpoints being created

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>

* CleanupServiceBindings to clean the SD records

Allow the cleanupServicebindings to take care of the service discovery
cleanup. Also avoid to trigger the cleanup for each endpoint from an SD
point of view
LB and SD will be separated in the future

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>

* Addressed comments

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>

* NetworkDB deleteEntry has to happen

If there is an error locally guarantee that the delete entry
on network DB is still honored

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-18 05:25:58 -07:00
Madhu Venugopal
c48c1a3748 Flavio as Libnetwork maintainer
Flavio has been contributing various useful features in Docker 17.05
and 17.06 releases and also an active maintainer who helps with various
bug fixes and PR reviews

Signed-off-by: Madhu Venugopal <madhu@docker.com>
2017-06-16 19:38:27 -07:00
Sandeep Bansal
2d278dece0 Fixes docker daemon not restarting after endpoint leak on windows with transaprent network
Signed-off-by: Sandeep Bansal <sabansal@microsoft.com>
2017-06-15 13:27:48 -07:00
Madhu Venugopal
ca1d612988 Merge pull request #1806 from fcrisciani/logfix
Fix handleEPTable log
2017-06-13 20:06:50 -07:00
Madhu Venugopal
9f6f2c27f8 Merge pull request #1778 from WeiZhang555/fix-leaking-netns-file
[bug]Fix race between sandbox.delete() and SetKey()
2017-06-13 20:06:09 -07:00
Flavio Crisciani
ba788519d6 Fix handleEPTable log
There was an extra parameter not in the formatters

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-13 15:47:31 -07:00
Flavio Crisciani
65860255c6 Fixed code issues
Fixed issues highlighted by the new checks

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-12 11:31:35 -07:00
Flavio Crisciani
a018694f40 Added more code checks
Added missspelling
Added fmt, vet, lint, ineffassign

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-12 11:31:33 -07:00
Flavio Crisciani
d69db01eb8 Bump docker base image to 1.8.3
added also new dependencies used in the new makefile

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-12 11:31:32 -07:00
Flavio Crisciani
c0f59f9643 IPVS fix
In accordance with the logic for SD, remove the ipvs rules
only when there is no more endpoints using the IP

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-12 00:07:39 -07:00
Flavio Crisciani
39d2204896 Service discovery logic rework
changed the ipMap to SetMatrix to allow transient states
Compacted the addSvc and deleteSvc into a one single method
Updated the datastructure for backends to allow storing all the information needed
to cleanup properly during the cleanupServiceBindings
Removed the enable/disable Service logic that was racing with sbLeave/sbJoin logic
Add some debug logs to track further race conditions

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-11 20:49:29 -07:00
Abhinandan Prativadi
7ae2b025be Fixing issue with bit allocation byteoffset calculation
The byteoffset calculation was skewed to double include
the offset value calculated. The double calculation
happens if the starting ordinal is part of the head
sequence block. This error in calculation could result
in duplicate but getting allocated eventually propogating
to ipam and vni id allocations

Signed-off-by: Abhinandan Prativadi <abhi@docker.com>
2017-06-09 11:53:28 -07:00
Flavio Crisciani
2111d4cafb Create SetMatrix data structure
SetMatrix is a simple matrix of sets.
Added tests

This data structure will be used in following commit to handle
transient states where the same key can momentarely be associated
to more than a value

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-08 13:33:49 -07:00
Flavio Crisciani
233aa636d7 Fix OS tweaks call
The feature was not getting properly triggered, move it as
first operation in the configure

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-06 20:30:41 -07:00
Madhu Venugopal
23a2381954 Merge pull request #1786 from fcrisciani/netlink_leak
Fix leak of watchMiss goroutine
2017-06-06 13:31:16 -07:00
Madhu Venugopal
78a910ee17 Merge pull request #1787 from fcrisciani/goroutine_leak
Fix leak of handleTableEvents
2017-06-06 13:17:17 -07:00
Flavio Crisciani
acf9c53292 Vendoring netlink library
Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-06 09:24:22 -07:00
Flavio Crisciani
d5c69190d1 Fix leak of watchMiss goroutine
The netlink socket that was used to monitor the L2
miss was never being closed. The watchMiss goroutine
spawned was never returning. This was causing goroutine
leak in case of createNetwork/destroyNetwork

Signed-off-by: Flavio Crisciani <flavio.crisciani@docker.com>
2017-06-06 09:24:21 -07:00
Madhu Venugopal
d65565610f Merge pull request #1781 from fcrisciani/vxlan-issue
Removed printfs
2017-06-05 19:24:41 -07:00
Madhu Venugopal
54d627c69d Merge pull request #1792 from sanimej/mac2
Remove dynamic mac entry from fdb on endpoint deletion
2017-06-05 16:30:08 -07:00