{"action":"created","comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/47236709","id":47236709,"diff_hunk":"@@ -304,20 +304,17 @@ func (ds *DistSender) getNodeDescriptor() *roachpb.NodeDescriptor {\n func (ds *DistSender) sendRPC(trace *tracer.Trace, rangeID roachpb.RangeID, replicas replicaSlice, order rpc.OrderingPolicy,\n \tba roachpb.BatchRequest) (*roachpb.BatchResponse, error) {\n \tif len(replicas) == 0 {\n-\t\treturn nil, util.Errorf(\"replicas set is empty\")\n+\t\treturn nil, noNodeAddrsAvailError{}\n \t}\n \n \t// Build a slice of replica addresses (if gossiped).","path":"kv/dist_sender.go","position":8,"original_position":8,"commit_id":"e2239a6bd9a206941810ba1e209fce6f88070d28","original_commit_id":"e2239a6bd9a206941810ba1e209fce6f88070d28","user":{"login":"tschottdorf","id":5076964,"avatar_url":"https://avatars.githubusercontent.com/u/5076964?v=3","gravatar_id":"","url":"https://api.github.com/users/tschottdorf","html_url":"https://github.com/tschottdorf","followers_url":"https://api.github.com/users/tschottdorf/followers","following_url":"https://api.github.com/users/tschottdorf/following{/other_user}","gists_url":"https://api.github.com/users/tschottdorf/gists{/gist_id}","starred_url":"https://api.github.com/users/tschottdorf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tschottdorf/subscriptions","organizations_url":"https://api.github.com/users/tschottdorf/orgs","repos_url":"https://api.github.com/users/tschottdorf/repos","events_url":"https://api.github.com/users/tschottdorf/events{/privacy}","received_events_url":"https://api.github.com/users/tschottdorf/received_events","type":"User","site_admin":false},"body":"This comment has slightly rotted (I think some earlier version of the code constructed a `replicaSlice` here, and between above and below it looked up addresses from Gossip, discarding nodes which weren't addressable).","created_at":"2015-12-10T15:08:31Z","updated_at":"2015-12-10T15:08:31Z","html_url":"https://github.com/cockroachdb/cockroach/pull/3383#discussion_r47236709","pull_request_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3383","_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments/47236709"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/3383#discussion_r47236709"},"pull_request":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3383"}}},"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3383","id":53257255,"html_url":"https://github.com/cockroachdb/cockroach/pull/3383","diff_url":"https://github.com/cockroachdb/cockroach/pull/3383.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/3383.patch","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3383","number":3383,"state":"open","locked":false,"title":"Remove unnecessary error check and improve slice/map allocation","user":{"login":"nvanbenschoten","id":5438456,"avatar_url":"https://avatars.githubusercontent.com/u/5438456?v=3","gravatar_id":"","url":"https://api.github.com/users/nvanbenschoten","html_url":"https://github.com/nvanbenschoten","followers_url":"https://api.github.com/users/nvanbenschoten/followers","following_url":"https://api.github.com/users/nvanbenschoten/following{/other_user}","gists_url":"https://api.github.com/users/nvanbenschoten/gists{/gist_id}","starred_url":"https://api.github.com/users/nvanbenschoten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvanbenschoten/subscriptions","organizations_url":"https://api.github.com/users/nvanbenschoten/orgs","repos_url":"https://api.github.com/users/nvanbenschoten/repos","events_url":"https://api.github.com/users/nvanbenschoten/events{/privacy}","received_events_url":"https://api.github.com/users/nvanbenschoten/received_events","type":"User","site_admin":false},"body":"I might have missed something, but after staring at this for a while, I couldn't figure out why the second empty slice check was needed. I figured the `noNodeAddrsAvailError` was the better error to return.\n\n<!-- Reviewable:start -->\n[<img src=\"https://reviewable.io/review_button.png\" height=40 alt=\"Review on Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/3383)\n<!-- Reviewable:end -->\n","created_at":"2015-12-10T13:21:22Z","updated_at":"2015-12-10T15:08:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"bed232df659a02bc9e8929a5f564cb4bbaf22f5a","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3383/commits","review_comments_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3383/comments","review_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/3383/comments","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/e2239a6bd9a206941810ba1e209fce6f88070d28","head":{"label":"nvanbenschoten:nvanbenschoten/replica_error","ref":"nvanbenschoten/replica_error","sha":"e2239a6bd9a206941810ba1e209fce6f88070d28","user":{"login":"nvanbenschoten","id":5438456,"avatar_url":"https://avatars.githubusercontent.com/u/5438456?v=3","gravatar_id":"","url":"https://api.github.com/users/nvanbenschoten","html_url":"https://github.com/nvanbenschoten","followers_url":"https://api.github.com/users/nvanbenschoten/followers","following_url":"https://api.github.com/users/nvanbenschoten/following{/other_user}","gists_url":"https://api.github.com/users/nvanbenschoten/gists{/gist_id}","starred_url":"https://api.github.com/users/nvanbenschoten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvanbenschoten/subscriptions","organizations_url":"https://api.github.com/users/nvanbenschoten/orgs","repos_url":"https://api.github.com/users/nvanbenschoten/repos","events_url":"https://api.github.com/users/nvanbenschoten/events{/privacy}","received_events_url":"https://api.github.com/users/nvanbenschoten/received_events","type":"User","site_admin":false},"repo":{"id":42610470,"name":"cockroach","full_name":"nvanbenschoten/cockroach","owner":{"login":"nvanbenschoten","id":5438456,"avatar_url":"https://avatars.githubusercontent.com/u/5438456?v=3","gravatar_id":"","url":"https://api.github.com/users/nvanbenschoten","html_url":"https://github.com/nvanbenschoten","followers_url":"https://api.github.com/users/nvanbenschoten/followers","following_url":"https://api.github.com/users/nvanbenschoten/following{/other_user}","gists_url":"https://api.github.com/users/nvanbenschoten/gists{/gist_id}","starred_url":"https://api.github.com/users/nvanbenschoten/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nvanbenschoten/subscriptions","organizations_url":"https://api.github.com/users/nvanbenschoten/orgs","repos_url":"https://api.github.com/users/nvanbenschoten/repos","events_url":"https://api.github.com/users/nvanbenschoten/events{/privacy}","received_events_url":"https://api.github.com/users/nvanbenschoten/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nvanbenschoten/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","fork":true,"url":"https://api.github.com/repos/nvanbenschoten/cockroach","forks_url":"https://api.github.com/repos/nvanbenschoten/cockroach/forks","keys_url":"https://api.github.com/repos/nvanbenschoten/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nvanbenschoten/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nvanbenschoten/cockroach/teams","hooks_url":"https://api.github.com/repos/nvanbenschoten/cockroach/hooks","issue_events_url":"https://api.github.com/repos/nvanbenschoten/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/nvanbenschoten/cockroach/events","assignees_url":"https://api.github.com/repos/nvanbenschoten/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/nvanbenschoten/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/nvanbenschoten/cockroach/tags","blobs_url":"https://api.github.com/repos/nvanbenschoten/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nvanbenschoten/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nvanbenschoten/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/nvanbenschoten/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nvanbenschoten/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/nvanbenschoten/cockroach/languages","stargazers_url":"https://api.github.com/repos/nvanbenschoten/cockroach/stargazers","contributors_url":"https://api.github.com/repos/nvanbenschoten/cockroach/contributors","subscribers_url":"https://api.github.com/repos/nvanbenschoten/cockroach/subscribers","subscription_url":"https://api.github.com/repos/nvanbenschoten/cockroach/subscription","commits_url":"https://api.github.com/repos/nvanbenschoten/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/nvanbenschoten/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/nvanbenschoten/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/nvanbenschoten/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/nvanbenschoten/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/nvanbenschoten/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nvanbenschoten/cockroach/merges","archive_url":"https://api.github.com/repos/nvanbenschoten/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nvanbenschoten/cockroach/downloads","issues_url":"https://api.github.com/repos/nvanbenschoten/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/nvanbenschoten/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/nvanbenschoten/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/nvanbenschoten/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nvanbenschoten/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/nvanbenschoten/cockroach/releases{/id}","created_at":"2015-09-16T20:04:21Z","updated_at":"2015-09-16T20:04:24Z","pushed_at":"2015-12-10T13:19:19Z","git_url":"git://github.com/nvanbenschoten/cockroach.git","ssh_url":"git@github.com:nvanbenschoten/cockroach.git","clone_url":"https://github.com/nvanbenschoten/cockroach.git","svn_url":"https://github.com/nvanbenschoten/cockroach","homepage":null,"size":48290,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"cockroachdb:master","ref":"master","sha":"50c0336c512ba6d4421bbedb4679d1742b7be901","user":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"repo":{"id":16563587,"name":"cockroach","full_name":"cockroachdb/cockroach","owner":{"login":"cockroachdb","id":6748139,"avatar_url":"https://avatars.githubusercontent.com/u/6748139?v=3","gravatar_id":"","url":"https://api.github.com/users/cockroachdb","html_url":"https://github.com/cockroachdb","followers_url":"https://api.github.com/users/cockroachdb/followers","following_url":"https://api.github.com/users/cockroachdb/following{/other_user}","gists_url":"https://api.github.com/users/cockroachdb/gists{/gist_id}","starred_url":"https://api.github.com/users/cockroachdb/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/cockroachdb/subscriptions","organizations_url":"https://api.github.com/users/cockroachdb/orgs","repos_url":"https://api.github.com/users/cockroachdb/repos","events_url":"https://api.github.com/users/cockroachdb/events{/privacy}","received_events_url":"https://api.github.com/users/cockroachdb/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/cockroachdb/cockroach","description":"A Scalable, Geo-Replicated, Transactional Datastore","fork":false,"url":"https://api.github.com/repos/cockroachdb/cockroach","forks_url":"https://api.github.com/repos/cockroachdb/cockroach/forks","keys_url":"https://api.github.com/repos/cockroachdb/cockroach/keys{/key_id}","collaborators_url":"https://api.github.com/repos/cockroachdb/cockroach/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/cockroachdb/cockroach/teams","hooks_url":"https://api.github.com/repos/cockroachdb/cockroach/hooks","issue_events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/events{/number}","events_url":"https://api.github.com/repos/cockroachdb/cockroach/events","assignees_url":"https://api.github.com/repos/cockroachdb/cockroach/assignees{/user}","branches_url":"https://api.github.com/repos/cockroachdb/cockroach/branches{/branch}","tags_url":"https://api.github.com/repos/cockroachdb/cockroach/tags","blobs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/cockroachdb/cockroach/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/cockroachdb/cockroach/git/refs{/sha}","trees_url":"https://api.github.com/repos/cockroachdb/cockroach/git/trees{/sha}","statuses_url":"https://api.github.com/repos/cockroachdb/cockroach/statuses/{sha}","languages_url":"https://api.github.com/repos/cockroachdb/cockroach/languages","stargazers_url":"https://api.github.com/repos/cockroachdb/cockroach/stargazers","contributors_url":"https://api.github.com/repos/cockroachdb/cockroach/contributors","subscribers_url":"https://api.github.com/repos/cockroachdb/cockroach/subscribers","subscription_url":"https://api.github.com/repos/cockroachdb/cockroach/subscription","commits_url":"https://api.github.com/repos/cockroachdb/cockroach/commits{/sha}","git_commits_url":"https://api.github.com/repos/cockroachdb/cockroach/git/commits{/sha}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/comments{/number}","issue_comment_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments{/number}","contents_url":"https://api.github.com/repos/cockroachdb/cockroach/contents/{+path}","compare_url":"https://api.github.com/repos/cockroachdb/cockroach/compare/{base}...{head}","merges_url":"https://api.github.com/repos/cockroachdb/cockroach/merges","archive_url":"https://api.github.com/repos/cockroachdb/cockroach/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/cockroachdb/cockroach/downloads","issues_url":"https://api.github.com/repos/cockroachdb/cockroach/issues{/number}","pulls_url":"https://api.github.com/repos/cockroachdb/cockroach/pulls{/number}","milestones_url":"https://api.github.com/repos/cockroachdb/cockroach/milestones{/number}","notifications_url":"https://api.github.com/repos/cockroachdb/cockroach/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/labels{/name}","releases_url":"https://api.github.com/repos/cockroachdb/cockroach/releases{/id}","created_at":"2014-02-06T00:18:47Z","updated_at":"2015-12-10T14:41:41Z","pushed_at":"2015-12-10T15:07:03Z","git_url":"git://github.com/cockroachdb/cockroach.git","ssh_url":"git@github.com:cockroachdb/cockroach.git","clone_url":"https://github.com/cockroachdb/cockroach.git","svn_url":"https://github.com/cockroachdb/cockroach","homepage":null,"size":55505,"stargazers_count":5837,"watchers_count":5837,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":498,"mirror_url":null,"open_issues_count":232,"forks":498,"open_issues":232,"watchers":5837,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3383"},"html":{"href":"https://github.com/cockroachdb/cockroach/pull/3383"},"issue":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/3383"},"comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/issues/3383/comments"},"review_comments":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3383/comments"},"review_comment":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/cockroachdb/cockroach/pulls/3383/commits"},"statuses":{"href":"https://api.github.com/repos/cockroachdb/cockroach/statuses/e2239a6bd9a206941810ba1e209fce6f88070d28"}}}}