{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/pd/pulls/comments/99278215","pull_request_review_id":19950062,"id":99278215,"diff_hunk":"@@ -323,6 +323,13 @@ func (c *RaftCluster) putStore(store *metapb.Store) error {\n \t\tif s.GetId() != store.GetId() && s.GetAddress() == store.GetAddress() {\n \t\t\treturn errors.Errorf(\"duplicated store address: %v, already registered by %v\", store, s.Store)\n \t\t}\n+\t\tif s.GetId() == store.GetId() && s.GetAddress() != store.GetAddress() {","path":"server/cluster.go","position":4,"original_position":4,"commit_id":"a4cce91bf96449a883f9f00f1f2129ee302d44b9","original_commit_id":"a4cce91bf96449a883f9f00f1f2129ee302d44b9","user":{"login":"andelf","id":72891,"avatar_url":"https://avatars.githubusercontent.com/u/72891?v=3","gravatar_id":"","url":"https://api.github.com/users/andelf","html_url":"https://github.com/andelf","followers_url":"https://api.github.com/users/andelf/followers","following_url":"https://api.github.com/users/andelf/following{/other_user}","gists_url":"https://api.github.com/users/andelf/gists{/gist_id}","starred_url":"https://api.github.com/users/andelf/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/andelf/subscriptions","organizations_url":"https://api.github.com/users/andelf/orgs","repos_url":"https://api.github.com/users/andelf/repos","events_url":"https://api.github.com/users/andelf/events{/privacy}","received_events_url":"https://api.github.com/users/andelf/received_events","type":"User","site_admin":false},"body":"maybe nested `if-else` is better?","created_at":"2017-02-03T05:16:57Z","updated_at":"2017-02-03T05:27:05Z","html_url":"https://github.com/pingcap/pd/pull/484#discussion_r99278215","pull_request_url":"https://api.github.com/repos/pingcap/pd/pulls/484","_links":{"self":{"href":"https://api.github.com/repos/pingcap/pd/pulls/comments/99278215"},"html":{"href":"https://github.com/pingcap/pd/pull/484#discussion_r99278215"},"pull_request":{"href":"https://api.github.com/repos/pingcap/pd/pulls/484"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/pd/pulls/484","id":102852833,"html_url":"https://github.com/pingcap/pd/pull/484","diff_url":"https://github.com/pingcap/pd/pull/484.diff","patch_url":"https://github.com/pingcap/pd/pull/484.patch","issue_url":"https://api.github.com/repos/pingcap/pd/issues/484","number":484,"state":"open","locked":false,"title":"server: check store heartbeat before updating existed store","user":{"login":"overvenus","id":2150711,"avatar_url":"https://avatars.githubusercontent.com/u/2150711?v=3","gravatar_id":"","url":"https://api.github.com/users/overvenus","html_url":"https://github.com/overvenus","followers_url":"https://api.github.com/users/overvenus/followers","following_url":"https://api.github.com/users/overvenus/following{/other_user}","gists_url":"https://api.github.com/users/overvenus/gists{/gist_id}","starred_url":"https://api.github.com/users/overvenus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overvenus/subscriptions","organizations_url":"https://api.github.com/users/overvenus/orgs","repos_url":"https://api.github.com/users/overvenus/repos","events_url":"https://api.github.com/users/overvenus/events{/privacy}","received_events_url":"https://api.github.com/users/overvenus/received_events","type":"User","site_admin":false},"body":"Check store heartbeat before updating existed store.\r\nIt doesn't provide true safety, but I think it is enough for now.\r\n\r\nPTAL @huachaohuang @siddontang \r\n\r\nCC #482 ","created_at":"2017-01-24T04:52:04Z","updated_at":"2017-02-03T05:27:05Z","closed_at":null,"merged_at":null,"merge_commit_sha":"efaae7289dcdef73a08f5f984c51f65859715e53","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/pd/pulls/484/commits","review_comments_url":"https://api.github.com/repos/pingcap/pd/pulls/484/comments","review_comment_url":"https://api.github.com/repos/pingcap/pd/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/pd/issues/484/comments","statuses_url":"https://api.github.com/repos/pingcap/pd/statuses/a4cce91bf96449a883f9f00f1f2129ee302d44b9","head":{"label":"overvenus:check-store","ref":"check-store","sha":"a4cce91bf96449a883f9f00f1f2129ee302d44b9","user":{"login":"overvenus","id":2150711,"avatar_url":"https://avatars.githubusercontent.com/u/2150711?v=3","gravatar_id":"","url":"https://api.github.com/users/overvenus","html_url":"https://github.com/overvenus","followers_url":"https://api.github.com/users/overvenus/followers","following_url":"https://api.github.com/users/overvenus/following{/other_user}","gists_url":"https://api.github.com/users/overvenus/gists{/gist_id}","starred_url":"https://api.github.com/users/overvenus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overvenus/subscriptions","organizations_url":"https://api.github.com/users/overvenus/orgs","repos_url":"https://api.github.com/users/overvenus/repos","events_url":"https://api.github.com/users/overvenus/events{/privacy}","received_events_url":"https://api.github.com/users/overvenus/received_events","type":"User","site_admin":false},"repo":{"id":64187243,"name":"pd","full_name":"overvenus/pd","owner":{"login":"overvenus","id":2150711,"avatar_url":"https://avatars.githubusercontent.com/u/2150711?v=3","gravatar_id":"","url":"https://api.github.com/users/overvenus","html_url":"https://github.com/overvenus","followers_url":"https://api.github.com/users/overvenus/followers","following_url":"https://api.github.com/users/overvenus/following{/other_user}","gists_url":"https://api.github.com/users/overvenus/gists{/gist_id}","starred_url":"https://api.github.com/users/overvenus/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/overvenus/subscriptions","organizations_url":"https://api.github.com/users/overvenus/orgs","repos_url":"https://api.github.com/users/overvenus/repos","events_url":"https://api.github.com/users/overvenus/events{/privacy}","received_events_url":"https://api.github.com/users/overvenus/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/overvenus/pd","description":"Placement driver for TiKV","fork":true,"url":"https://api.github.com/repos/overvenus/pd","forks_url":"https://api.github.com/repos/overvenus/pd/forks","keys_url":"https://api.github.com/repos/overvenus/pd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/overvenus/pd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/overvenus/pd/teams","hooks_url":"https://api.github.com/repos/overvenus/pd/hooks","issue_events_url":"https://api.github.com/repos/overvenus/pd/issues/events{/number}","events_url":"https://api.github.com/repos/overvenus/pd/events","assignees_url":"https://api.github.com/repos/overvenus/pd/assignees{/user}","branches_url":"https://api.github.com/repos/overvenus/pd/branches{/branch}","tags_url":"https://api.github.com/repos/overvenus/pd/tags","blobs_url":"https://api.github.com/repos/overvenus/pd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/overvenus/pd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/overvenus/pd/git/refs{/sha}","trees_url":"https://api.github.com/repos/overvenus/pd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/overvenus/pd/statuses/{sha}","languages_url":"https://api.github.com/repos/overvenus/pd/languages","stargazers_url":"https://api.github.com/repos/overvenus/pd/stargazers","contributors_url":"https://api.github.com/repos/overvenus/pd/contributors","subscribers_url":"https://api.github.com/repos/overvenus/pd/subscribers","subscription_url":"https://api.github.com/repos/overvenus/pd/subscription","commits_url":"https://api.github.com/repos/overvenus/pd/commits{/sha}","git_commits_url":"https://api.github.com/repos/overvenus/pd/git/commits{/sha}","comments_url":"https://api.github.com/repos/overvenus/pd/comments{/number}","issue_comment_url":"https://api.github.com/repos/overvenus/pd/issues/comments{/number}","contents_url":"https://api.github.com/repos/overvenus/pd/contents/{+path}","compare_url":"https://api.github.com/repos/overvenus/pd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/overvenus/pd/merges","archive_url":"https://api.github.com/repos/overvenus/pd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/overvenus/pd/downloads","issues_url":"https://api.github.com/repos/overvenus/pd/issues{/number}","pulls_url":"https://api.github.com/repos/overvenus/pd/pulls{/number}","milestones_url":"https://api.github.com/repos/overvenus/pd/milestones{/number}","notifications_url":"https://api.github.com/repos/overvenus/pd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/overvenus/pd/labels{/name}","releases_url":"https://api.github.com/repos/overvenus/pd/releases{/id}","deployments_url":"https://api.github.com/repos/overvenus/pd/deployments","created_at":"2016-07-26T03:36:04Z","updated_at":"2016-07-26T03:36:05Z","pushed_at":"2017-01-24T05:08:32Z","git_url":"git://github.com/overvenus/pd.git","ssh_url":"git@github.com:overvenus/pd.git","clone_url":"https://github.com/overvenus/pd.git","svn_url":"https://github.com/overvenus/pd","homepage":"","size":4678,"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":"pingcap:master","ref":"master","sha":"11711a633ae30797f60ae2c1c77e774721aeddca","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"repo":{"id":53311716,"name":"pd","full_name":"pingcap/pd","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars.githubusercontent.com/u/11855343?v=3","gravatar_id":"","url":"https://api.github.com/users/pingcap","html_url":"https://github.com/pingcap","followers_url":"https://api.github.com/users/pingcap/followers","following_url":"https://api.github.com/users/pingcap/following{/other_user}","gists_url":"https://api.github.com/users/pingcap/gists{/gist_id}","starred_url":"https://api.github.com/users/pingcap/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/pingcap/subscriptions","organizations_url":"https://api.github.com/users/pingcap/orgs","repos_url":"https://api.github.com/users/pingcap/repos","events_url":"https://api.github.com/users/pingcap/events{/privacy}","received_events_url":"https://api.github.com/users/pingcap/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/pingcap/pd","description":"Placement driver for TiKV","fork":false,"url":"https://api.github.com/repos/pingcap/pd","forks_url":"https://api.github.com/repos/pingcap/pd/forks","keys_url":"https://api.github.com/repos/pingcap/pd/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/pd/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/pd/teams","hooks_url":"https://api.github.com/repos/pingcap/pd/hooks","issue_events_url":"https://api.github.com/repos/pingcap/pd/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/pd/events","assignees_url":"https://api.github.com/repos/pingcap/pd/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/pd/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/pd/tags","blobs_url":"https://api.github.com/repos/pingcap/pd/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/pd/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/pd/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/pd/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/pd/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/pd/languages","stargazers_url":"https://api.github.com/repos/pingcap/pd/stargazers","contributors_url":"https://api.github.com/repos/pingcap/pd/contributors","subscribers_url":"https://api.github.com/repos/pingcap/pd/subscribers","subscription_url":"https://api.github.com/repos/pingcap/pd/subscription","commits_url":"https://api.github.com/repos/pingcap/pd/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/pd/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/pd/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/pd/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/pd/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/pd/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/pd/merges","archive_url":"https://api.github.com/repos/pingcap/pd/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/pd/downloads","issues_url":"https://api.github.com/repos/pingcap/pd/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/pd/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/pd/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/pd/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/pd/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/pd/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/pd/deployments","created_at":"2016-03-07T09:13:06Z","updated_at":"2017-01-23T14:30:31Z","pushed_at":"2017-01-26T11:49:44Z","git_url":"git://github.com/pingcap/pd.git","ssh_url":"git@github.com:pingcap/pd.git","clone_url":"https://github.com/pingcap/pd.git","svn_url":"https://github.com/pingcap/pd","homepage":"","size":4968,"stargazers_count":36,"watchers_count":36,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":17,"mirror_url":null,"open_issues_count":37,"forks":17,"open_issues":37,"watchers":36,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/pd/pulls/484"},"html":{"href":"https://github.com/pingcap/pd/pull/484"},"issue":{"href":"https://api.github.com/repos/pingcap/pd/issues/484"},"comments":{"href":"https://api.github.com/repos/pingcap/pd/issues/484/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/pd/pulls/484/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/pd/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/pd/pulls/484/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/pd/statuses/a4cce91bf96449a883f9f00f1f2129ee302d44b9"}}}}
{"actor":{"display_login":"andelf"}}