{"action":"created","issue":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6595","repository_url":"https://api.github.com/repos/cockroachdb/cockroach","labels_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6595/labels{/name}","comments_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6595/comments","events_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6595/events","html_url":"https://github.com/cockroachdb/cockroach/pull/6595","id":153895230,"number":6595,"title":"sql: integrate the name cache with the lease system; remove rename races","user":{"login":"andreimatei","id":377201,"avatar_url":"https://avatars.githubusercontent.com/u/377201?v=3","gravatar_id":"","url":"https://api.github.com/users/andreimatei","html_url":"https://github.com/andreimatei","followers_url":"https://api.github.com/users/andreimatei/followers","following_url":"https://api.github.com/users/andreimatei/following{/other_user}","gists_url":"https://api.github.com/users/andreimatei/gists{/gist_id}","starred_url":"https://api.github.com/users/andreimatei/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andreimatei/subscriptions","organizations_url":"https://api.github.com/users/andreimatei/orgs","repos_url":"https://api.github.com/users/andreimatei/repos","events_url":"https://api.github.com/users/andreimatei/events{/privacy}","received_events_url":"https://api.github.com/users/andreimatei/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":{"login":"vivekmenezes","id":11774212,"avatar_url":"https://avatars.githubusercontent.com/u/11774212?v=3","gravatar_id":"","url":"https://api.github.com/users/vivekmenezes","html_url":"https://github.com/vivekmenezes","followers_url":"https://api.github.com/users/vivekmenezes/followers","following_url":"https://api.github.com/users/vivekmenezes/following{/other_user}","gists_url":"https://api.github.com/users/vivekmenezes/gists{/gist_id}","starred_url":"https://api.github.com/users/vivekmenezes/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/vivekmenezes/subscriptions","organizations_url":"https://api.github.com/users/vivekmenezes/orgs","repos_url":"https://api.github.com/users/vivekmenezes/repos","events_url":"https://api.github.com/users/vivekmenezes/events{/privacy}","received_events_url":"https://api.github.com/users/vivekmenezes/received_events","type":"User","site_admin":false},"milestone":null,"comments":13,"created_at":"2016-05-09T23:51:39Z","updated_at":"2016-05-17T00:54:58Z","closed_at":null,"pull_request":{"url":"https://api.github.com/repos/cockroachdb/cockroach/pulls/6595","html_url":"https://github.com/cockroachdb/cockroach/pull/6595","diff_url":"https://github.com/cockroachdb/cockroach/pull/6595.diff","patch_url":"https://github.com/cockroachdb/cockroach/pull/6595.patch"},"body":"\n\n<!-- Reviewable:start -->\nThis change is [<img src=\"https://reviewable.io/review_button.svg\" height=\"35\" align=\"absmiddle\" alt=\"Reviewable\"/>](https://reviewable.io/reviews/cockroachdb/cockroach/6595)\n<!-- Reviewable:end -->\n"},"comment":{"url":"https://api.github.com/repos/cockroachdb/cockroach/issues/comments/219591448","html_url":"https://github.com/cockroachdb/cockroach/pull/6595#issuecomment-219591448","issue_url":"https://api.github.com/repos/cockroachdb/cockroach/issues/6595","id":219591448,"user":{"login":"tamird","id":1535036,"avatar_url":"https://avatars.githubusercontent.com/u/1535036?v=3","gravatar_id":"","url":"https://api.github.com/users/tamird","html_url":"https://github.com/tamird","followers_url":"https://api.github.com/users/tamird/followers","following_url":"https://api.github.com/users/tamird/following{/other_user}","gists_url":"https://api.github.com/users/tamird/gists{/gist_id}","starred_url":"https://api.github.com/users/tamird/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tamird/subscriptions","organizations_url":"https://api.github.com/users/tamird/orgs","repos_url":"https://api.github.com/users/tamird/repos","events_url":"https://api.github.com/users/tamird/events{/privacy}","received_events_url":"https://api.github.com/users/tamird/received_events","type":"User","site_admin":false},"created_at":"2016-05-17T00:54:58Z","updated_at":"2016-05-17T00:54:58Z","body":"\n\n\n\n\n\nReviewed 13 of 13 files at r6.\nReview status: 0 of 21 files reviewed at latest revision, 14 unresolved discussions, some commit checks failed.\n\n---\n\n*[sql/lease.go, line 624 \\[r6\\]](https://reviewable.io:443/reviews/cockroachdb/cockroach/6595#-KHwBvldLaHWyBpIsSu1:-KHwBvleDNVQSx0sjQeW:1340306172) ([raw file](https://github.com/cockroachdb/cockroach/blob/3190545b5653d9eecd45a824861a5b94fc1d76e0/sql/lease.go#L624)):*\n> ```Go\n> \t\t\t} else {\n> \t\t\t\t// Otherwise, all but the lease we just took are stale.\n> \t\t\t\ttoRelease = append([]*LeaseState(nil), t.active.data[:len(t.active.data)-1]...)\n> ```\n\nthis change being in a commit by itself guaranatees that I can't review it. is this copy necessary because you're about to modify the slice? is the slice being modified out from under you? is it being appended to? are you appending to it?\n\nThere's a reason we prefer not to write commits with tests that follow later. If you need to expose some stuff to make the test possible, those changes should precede this one.\n\n---\n\n\n*Comments from [Reviewable](https://reviewable.io:443/reviews/cockroachdb/cockroach/6595)*\n<!-- Sent from Reviewable.io -->\n"}}