{"action":"created","issue":{"url":"https://api.github.com/repos/mesosphere/mesos-dns/issues/335","labels_url":"https://api.github.com/repos/mesosphere/mesos-dns/issues/335/labels{/name}","comments_url":"https://api.github.com/repos/mesosphere/mesos-dns/issues/335/comments","events_url":"https://api.github.com/repos/mesosphere/mesos-dns/issues/335/events","html_url":"https://github.com/mesosphere/mesos-dns/issues/335","id":115096807,"number":335,"title":"Inconsistency between result ordering of DNS and HTTP API request in case of multiple ports per service","user":{"login":"tobilg","id":1841985,"avatar_url":"https://avatars.githubusercontent.com/u/1841985?v=3","gravatar_id":"","url":"https://api.github.com/users/tobilg","html_url":"https://github.com/tobilg","followers_url":"https://api.github.com/users/tobilg/followers","following_url":"https://api.github.com/users/tobilg/following{/other_user}","gists_url":"https://api.github.com/users/tobilg/gists{/gist_id}","starred_url":"https://api.github.com/users/tobilg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tobilg/subscriptions","organizations_url":"https://api.github.com/users/tobilg/orgs","repos_url":"https://api.github.com/users/tobilg/repos","events_url":"https://api.github.com/users/tobilg/events{/privacy}","received_events_url":"https://api.github.com/users/tobilg/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"milestone":null,"comments":1,"created_at":"2015-11-04T16:51:30Z","updated_at":"2015-11-04T17:13:48Z","closed_at":null,"body":"**What version of the project are you using?**\r\n\r\n- v0.4.0\r\n\r\n**What operating system and processor architecture are you using?**\r\n\r\n```\r\n$ uname -a\r\nLinux coreos-node-3 4.1.7-coreos #2 SMP Wed Sep 16 22:54:37 UTC 2015 x86_64 AMD FX(tm)-8350 Eight-Core Processor AuthenticAMD GNU/Linux\r\n```\r\n\r\n**What did you do?**\r\n\r\nI'm running a Docker image via Marathon which exposes two http ports (opened by different services) per instance. \r\n\r\nNow, I have trouble to determine which SRV request answer is the correct one, because it appears that the answers are not sorted (the order changes with every request), in contrary to the HTTP API.\r\n\r\n```\r\n dig _mongodb-replicaset._tcp.marathon.mesos SRV\r\n;; Truncated, retrying in TCP mode.\r\n\r\n; <<>> DiG 9.10.2-P2 <<>> _mongodb-replicaset._tcp.marathon.mesos SRV\r\n;; global options: +cmd\r\n;; Got answer:\r\n;; ->>HEADER<<- opcode: QUERY, status: NOERROR, id: 64379\r\n;; flags: qr aa rd ra; QUERY: 1, ANSWER: 6, AUTHORITY: 0, ADDITIONAL: 6\r\n\r\n;; QUESTION SECTION:\r\n;_mongodb-replicaset._tcp.marathon.mesos. IN SRV\r\n\r\n;; ANSWER SECTION:\r\n_mongodb-replicaset._tcp.marathon.mesos. 60 IN SRV 0 0 31301 mongodb-replicaset-2674-s1.marathon.slave.mesos.\r\n_mongodb-replicaset._tcp.marathon.mesos. 60 IN SRV 0 0 31696 mongodb-replicaset-48972-s0.marathon.slave.mesos.\r\n_mongodb-replicaset._tcp.marathon.mesos. 60 IN SRV 0 0 31205 mongodb-replicaset-40588-s2.marathon.slave.mesos.\r\n_mongodb-replicaset._tcp.marathon.mesos. 60 IN SRV 0 0 31302 mongodb-replicaset-2674-s1.marathon.slave.mesos.\r\n_mongodb-replicaset._tcp.marathon.mesos. 60 IN SRV 0 0 31204 mongodb-replicaset-40588-s2.marathon.slave.mesos.\r\n_mongodb-replicaset._tcp.marathon.mesos. 60 IN SRV 0 0 31695 mongodb-replicaset-48972-s0.marathon.slave.mesos.\r\n\r\n;; ADDITIONAL SECTION:\r\nmongodb-replicaset-40588-s2.marathon.slave.mesos. 60 IN A 192.168.200.167\r\nmongodb-replicaset-40588-s2.marathon.slave.mesos. 60 IN A 192.168.200.167\r\nmongodb-replicaset-2674-s1.marathon.slave.mesos. 60 IN A 192.168.200.168\r\nmongodb-replicaset-2674-s1.marathon.slave.mesos. 60 IN A 192.168.200.168\r\nmongodb-replicaset-48972-s0.marathon.slave.mesos. 60 IN A 192.168.200.169\r\nmongodb-replicaset-48972-s0.marathon.slave.mesos. 60 IN A 192.168.200.169\r\n\r\n;; Query time: 0 msec\r\n;; SERVER: 192.168.200.169#53(192.168.200.169)\r\n;; WHEN: Wed Nov 04 18:52:40 UTC 2015\r\n;; MSG SIZE  rcvd: 657\r\n```\r\n\r\nThe HTTP API returns the following:\r\n\r\n```\r\n[\r\n  {\r\n   \"service\": \"_mongodb-replicaset._tcp.marathon.mesos\",\r\n   \"host\": \"mongodb-replicaset-40588-s2.marathon.slave.mesos.\",\r\n   \"ip\": \"192.168.200.167\",\r\n   \"port\": \"31204\"\r\n  },\r\n  {\r\n   \"service\": \"_mongodb-replicaset._tcp.marathon.mesos\",\r\n   \"host\": \"mongodb-replicaset-40588-s2.marathon.slave.mesos.\",\r\n   \"ip\": \"192.168.200.167\",\r\n   \"port\": \"31205\"\r\n  },\r\n  {\r\n   \"service\": \"_mongodb-replicaset._tcp.marathon.mesos\",\r\n   \"host\": \"mongodb-replicaset-2674-s1.marathon.slave.mesos.\",\r\n   \"ip\": \"192.168.200.168\",\r\n   \"port\": \"31301\"\r\n  },\r\n  {\r\n   \"service\": \"_mongodb-replicaset._tcp.marathon.mesos\",\r\n   \"host\": \"mongodb-replicaset-2674-s1.marathon.slave.mesos.\",\r\n   \"ip\": \"192.168.200.168\",\r\n   \"port\": \"31302\"\r\n  },\r\n  {\r\n   \"service\": \"_mongodb-replicaset._tcp.marathon.mesos\",\r\n   \"host\": \"mongodb-replicaset-48972-s0.marathon.slave.mesos.\",\r\n   \"ip\": \"192.168.200.169\",\r\n   \"port\": \"31695\"\r\n  },\r\n  {\r\n   \"service\": \"_mongodb-replicaset._tcp.marathon.mesos\",\r\n   \"host\": \"mongodb-replicaset-48972-s0.marathon.slave.mesos.\",\r\n   \"ip\": \"192.168.200.169\",\r\n   \"port\": \"31696\"\r\n  }\r\n ]\r\n```\r\n\r\nThe results seem to be sorted by `ip` and `port`, but not in the plain DNS request. \r\n\r\n**What did you expect to see?**\r\n\r\nThe behavior of the DNS and HTTP API are the same.\r\n\r\n**What did you see instead?**\r\n\r\nThe behavior of the DNS and HTTP API are not the same. I'm not sure if this behavior is standard-complaint though..."},"comment":{"url":"https://api.github.com/repos/mesosphere/mesos-dns/issues/comments/153795874","html_url":"https://github.com/mesosphere/mesos-dns/issues/335#issuecomment-153795874","issue_url":"https://api.github.com/repos/mesosphere/mesos-dns/issues/335","id":153795874,"user":{"login":"jdef","id":2348332,"avatar_url":"https://avatars.githubusercontent.com/u/2348332?v=3","gravatar_id":"","url":"https://api.github.com/users/jdef","html_url":"https://github.com/jdef","followers_url":"https://api.github.com/users/jdef/followers","following_url":"https://api.github.com/users/jdef/following{/other_user}","gists_url":"https://api.github.com/users/jdef/gists{/gist_id}","starred_url":"https://api.github.com/users/jdef/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/jdef/subscriptions","organizations_url":"https://api.github.com/users/jdef/orgs","repos_url":"https://api.github.com/users/jdef/repos","events_url":"https://api.github.com/users/jdef/events{/privacy}","received_events_url":"https://api.github.com/users/jdef/received_events","type":"User","site_admin":false},"created_at":"2015-11-04T17:13:48Z","updated_at":"2015-11-04T17:13:48Z","body":"Seem to remember some discussion a while back around randomizing the order of records in DNS responses so that clients don't get attached to some arbitrary order that we then have to maintain. Sounds like we may have missed on doing the same for the HTTP API."}}