{"action":"created","issue":{"url":"https://api.github.com/repos/weaveworks/weave/issues/1065","labels_url":"https://api.github.com/repos/weaveworks/weave/issues/1065/labels{/name}","comments_url":"https://api.github.com/repos/weaveworks/weave/issues/1065/comments","events_url":"https://api.github.com/repos/weaveworks/weave/issues/1065/events","html_url":"https://github.com/weaveworks/weave/pull/1065","id":92687501,"number":1065,"title":"WIP Gossip-based DNS embedded in the router.","user":{"login":"tomwilkie","id":444037,"avatar_url":"https://avatars.githubusercontent.com/u/444037?v=3","gravatar_id":"","url":"https://api.github.com/users/tomwilkie","html_url":"https://github.com/tomwilkie","followers_url":"https://api.github.com/users/tomwilkie/followers","following_url":"https://api.github.com/users/tomwilkie/following{/other_user}","gists_url":"https://api.github.com/users/tomwilkie/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwilkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwilkie/subscriptions","organizations_url":"https://api.github.com/users/tomwilkie/orgs","repos_url":"https://api.github.com/users/tomwilkie/repos","events_url":"https://api.github.com/users/tomwilkie/events{/privacy}","received_events_url":"https://api.github.com/users/tomwilkie/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"tomwilkie","id":444037,"avatar_url":"https://avatars.githubusercontent.com/u/444037?v=3","gravatar_id":"","url":"https://api.github.com/users/tomwilkie","html_url":"https://github.com/tomwilkie","followers_url":"https://api.github.com/users/tomwilkie/followers","following_url":"https://api.github.com/users/tomwilkie/following{/other_user}","gists_url":"https://api.github.com/users/tomwilkie/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwilkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwilkie/subscriptions","organizations_url":"https://api.github.com/users/tomwilkie/orgs","repos_url":"https://api.github.com/users/tomwilkie/repos","events_url":"https://api.github.com/users/tomwilkie/events{/privacy}","received_events_url":"https://api.github.com/users/tomwilkie/received_events","type":"User","site_admin":false},"milestone":null,"comments":18,"created_at":"2015-07-02T17:13:01Z","updated_at":"2015-07-06T10:40:04Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/weaveworks/weave/pulls/1065","html_url":"https://github.com/weaveworks/weave/pull/1065","diff_url":"https://github.com/weaveworks/weave/pull/1065.diff","patch_url":"https://github.com/weaveworks/weave/pull/1065.patch"},"body":"- Nameserver holds a sorted list of (hostname, peer, container id, ip) tuples.\r\n- Entries are gossiped using topology gossip / broadcast - only new entries are\r\n  propogated as expected.\r\n- Entries for a given peer are removed when the connection to the peer is lost.\r\n- Entries are tombstoned when containers die.  Tombstones are kept for 10mins,\r\n  as they do not need to survive partition, only gossip propagation delay.\r\n- Hostname lookups are O(logn), reverse DNS lookups are O(n), all in memory.\r\n\r\nLeft to do:\r\n- [x] Make ```weave launch-dns``` and ```weave stop-dns``` print warning and exit cleanly\r\n- [x] Add useful status output\r\n- [x] Audit logging\r\n- [x] Update proxy to send dns commands to the router.\r\n- [x] Make sure restart still works & add tests for that\r\n- [x] make ttl configurable, audit args, arg naming\r\n- [x] Add tests for large responses\r\n- [ ] Make ``when_weave_running`` change\r\n- [ ] Docs\r\n\r\n\r\nNot doing in this PR (left to follow-on issues, to be filed)\r\n- Reduce the complexity of non-hostname-lookups (all of which are O(n))\r\n- Rate limit new entry broadcasts"},"comment":{"url":"https://api.github.com/repos/weaveworks/weave/issues/comments/118805626","html_url":"https://github.com/weaveworks/weave/pull/1065#issuecomment-118805626","issue_url":"https://api.github.com/repos/weaveworks/weave/issues/1065","id":118805626,"user":{"login":"tomwilkie","id":444037,"avatar_url":"https://avatars.githubusercontent.com/u/444037?v=3","gravatar_id":"","url":"https://api.github.com/users/tomwilkie","html_url":"https://github.com/tomwilkie","followers_url":"https://api.github.com/users/tomwilkie/followers","following_url":"https://api.github.com/users/tomwilkie/following{/other_user}","gists_url":"https://api.github.com/users/tomwilkie/gists{/gist_id}","starred_url":"https://api.github.com/users/tomwilkie/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tomwilkie/subscriptions","organizations_url":"https://api.github.com/users/tomwilkie/orgs","repos_url":"https://api.github.com/users/tomwilkie/repos","events_url":"https://api.github.com/users/tomwilkie/events{/privacy}","received_events_url":"https://api.github.com/users/tomwilkie/received_events","type":"User","site_admin":false},"created_at":"2015-07-06T10:40:04Z","updated_at":"2015-07-06T10:40:04Z","body":"> I think there is a race here: I believe it is possible to receive some DNS gossip pertaining to a peer after that peer has been removed from Peers by GC. That would result in permanently stale records.\r\n\r\n@rade under what situation are you thinking?  I'm not familiar enough with the gossip / broadcast / peers code.  I could add a list of \"live\" peers to the nameserver, and filter incoming gossips by that.  I would need to add a \"peer added\" callback to peers.go if one doesn't already exist.  Then we'd need to make sure we get the peer-added callback before any gossips from the peer.  Thoughts?"}}