{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/comments/128943052","pull_request_review_id":51666350,"id":128943052,"diff_hunk":"@@ -34,50 +30,32 @@ var once sync.Once\n const defaultStatusAddr = \":10080\"\n \n func (s *Server) startStatusHTTP() {\n-\t// prepare region cache for region http server\n-\tpdClient, err := s.getPdClient()\n-\tif err != nil {\n-\t\tlog.Fatal(err)\n-\t}\n-\n \tonce.Do(func() {\n-\t\tgo s.startHTTPServer(pdClient)\n+\t\tgo s.startHTTPServer()\n \t})\n }\n \n-func (s *Server) getPdClient() (pd.Client, error) {\n-\tif s.cfg.Store != \"tikv\" {\n-\t\treturn nil, nil\n-\t}\n-\tpath := fmt.Sprintf(\"%s://%s\", s.cfg.Store, s.cfg.StorePath)\n-\tetcdAddrs, err := tikv.ParseEtcdAddr(path)\n-\tif err != nil {\n-\t\treturn nil, err\n-\t}\n-\tclient, err := pd.NewClient(etcdAddrs)\n-\tif err != nil {\n-\t\treturn nil, errors.Trace(err)\n-\t}\n-\treturn client, nil\n-}\n-\n-func (s *Server) startHTTPServer(pdClient pd.Client) {\n+func (s *Server) startHTTPServer() {\n \trouter := mux.NewRouter()\n \trouter.HandleFunc(\"/status\", s.handleStatus)\n \t// HTTP path for prometheus.\n \trouter.Handle(\"/metrics\", prometheus.Handler())\n-\n-\t// HTTP path for regions\n-\trouter.Handle(\"/tables/{db}/{table}/regions\", s.newTableRegionsHandler(pdClient))\n-\trouter.Handle(\"/regions/{regionID}\", s.newRegionHandler(pdClient))\n-\n+\ttikvHandler, err := s.newRegionHandler()\n+\tif err == nil {","path":"server/http_status.go","position":61,"original_position":61,"commit_id":"5466d66652903a7bb005790e6836a8b1f1f75858","original_commit_id":"5466d66652903a7bb005790e6836a8b1f1f75858","user":{"login":"siddontang","id":1080370,"avatar_url":"https://avatars2.githubusercontent.com/u/1080370?v=4","gravatar_id":"","url":"https://api.github.com/users/siddontang","html_url":"https://github.com/siddontang","followers_url":"https://api.github.com/users/siddontang/followers","following_url":"https://api.github.com/users/siddontang/following{/other_user}","gists_url":"https://api.github.com/users/siddontang/gists{/gist_id}","starred_url":"https://api.github.com/users/siddontang/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/siddontang/subscriptions","organizations_url":"https://api.github.com/users/siddontang/orgs","repos_url":"https://api.github.com/users/siddontang/repos","events_url":"https://api.github.com/users/siddontang/events{/privacy}","received_events_url":"https://api.github.com/users/siddontang/received_events","type":"User","site_admin":false},"body":"log an error or fatal for error.","created_at":"2017-07-24T03:12:58Z","updated_at":"2017-07-24T03:12:58Z","html_url":"https://github.com/pingcap/tidb/pull/3787#discussion_r128943052","pull_request_url":"https://api.github.com/repos/pingcap/tidb/pulls/3787","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments/128943052"},"html":{"href":"https://github.com/pingcap/tidb/pull/3787#discussion_r128943052"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/3787"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/3787","id":130866944,"html_url":"https://github.com/pingcap/tidb/pull/3787","diff_url":"https://github.com/pingcap/tidb/pull/3787.diff","patch_url":"https://github.com/pingcap/tidb/pull/3787.patch","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/3787","number":3787,"state":"open","locked":false,"title":"server/region_handler: txn debug tool for tikv","user":{"login":"AndreMouche","id":1085697,"avatar_url":"https://avatars1.githubusercontent.com/u/1085697?v=4","gravatar_id":"","url":"https://api.github.com/users/AndreMouche","html_url":"https://github.com/AndreMouche","followers_url":"https://api.github.com/users/AndreMouche/followers","following_url":"https://api.github.com/users/AndreMouche/following{/other_user}","gists_url":"https://api.github.com/users/AndreMouche/gists{/gist_id}","starred_url":"https://api.github.com/users/AndreMouche/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/AndreMouche/subscriptions","organizations_url":"https://api.github.com/users/AndreMouche/orgs","repos_url":"https://api.github.com/users/AndreMouche/repos","events_url":"https://api.github.com/users/AndreMouche/events{/privacy}","received_events_url":"https://api.github.com/users/AndreMouche/received_events","type":"User","site_admin":false},"body":"Hi, \r\n     This PR implement two API for txn debug:\r\n     1. Get MvccInfo BY Key `GET /mvcc/key/{db}/{table}/{recordID}`\r\n     2. Get Primary's MvccInfo by start_ts `/mvcc/txn/{startTS}/{db}/{table}` / `/mvcc/txn/{startTS}`\r\n\r\n@disksing @hhkbp2 PTAL","created_at":"2017-07-17T14:18:17Z","updated_at":"2017-07-24T03:12:58Z","closed_at":null,"merged_at":null,"merge_commit_sha":"db28ef0e95af331a61824732796a091ceed8ccc1","assignee":null,"assignees":[],"requested_reviewers":[],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tidb/pulls/3787/commits","review_comments_url":"https://api.github.com/repos/pingcap/tidb/pulls/3787/comments","review_comment_url":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/3787/comments","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/5466d66652903a7bb005790e6836a8b1f1f75858","head":{"label":"pingcap:shirly/txn_tool","ref":"shirly/txn_tool","sha":"5466d66652903a7bb005790e6836a8b1f1f75858","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","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":41986369,"name":"tidb","full_name":"pingcap/tidb","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","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/tidb","description":"TiDB is a distributed NewSQL database compatible with MySQL protocol ","fork":false,"url":"https://api.github.com/repos/pingcap/tidb","forks_url":"https://api.github.com/repos/pingcap/tidb/forks","keys_url":"https://api.github.com/repos/pingcap/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tidb/teams","hooks_url":"https://api.github.com/repos/pingcap/tidb/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tidb/events","assignees_url":"https://api.github.com/repos/pingcap/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tidb/tags","blobs_url":"https://api.github.com/repos/pingcap/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tidb/languages","stargazers_url":"https://api.github.com/repos/pingcap/tidb/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tidb/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tidb/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tidb/subscription","commits_url":"https://api.github.com/repos/pingcap/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tidb/merges","archive_url":"https://api.github.com/repos/pingcap/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tidb/downloads","issues_url":"https://api.github.com/repos/pingcap/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tidb/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tidb/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/tidb/deployments","created_at":"2015-09-06T04:01:52Z","updated_at":"2017-07-24T03:11:32Z","pushed_at":"2017-07-24T03:03:14Z","git_url":"git://github.com/pingcap/tidb.git","ssh_url":"git@github.com:pingcap/tidb.git","clone_url":"https://github.com/pingcap/tidb.git","svn_url":"https://github.com/pingcap/tidb","homepage":"https://pingcap.com","size":28449,"stargazers_count":8958,"watchers_count":8958,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1226,"mirror_url":null,"open_issues_count":260,"forks":1226,"open_issues":260,"watchers":8958,"default_branch":"master"}},"base":{"label":"pingcap:master","ref":"master","sha":"6d48faa8d2fdc8dd8207f784fd0ff47c2e838a59","user":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","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":41986369,"name":"tidb","full_name":"pingcap/tidb","owner":{"login":"pingcap","id":11855343,"avatar_url":"https://avatars3.githubusercontent.com/u/11855343?v=4","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/tidb","description":"TiDB is a distributed NewSQL database compatible with MySQL protocol ","fork":false,"url":"https://api.github.com/repos/pingcap/tidb","forks_url":"https://api.github.com/repos/pingcap/tidb/forks","keys_url":"https://api.github.com/repos/pingcap/tidb/keys{/key_id}","collaborators_url":"https://api.github.com/repos/pingcap/tidb/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/pingcap/tidb/teams","hooks_url":"https://api.github.com/repos/pingcap/tidb/hooks","issue_events_url":"https://api.github.com/repos/pingcap/tidb/issues/events{/number}","events_url":"https://api.github.com/repos/pingcap/tidb/events","assignees_url":"https://api.github.com/repos/pingcap/tidb/assignees{/user}","branches_url":"https://api.github.com/repos/pingcap/tidb/branches{/branch}","tags_url":"https://api.github.com/repos/pingcap/tidb/tags","blobs_url":"https://api.github.com/repos/pingcap/tidb/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/pingcap/tidb/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/pingcap/tidb/git/refs{/sha}","trees_url":"https://api.github.com/repos/pingcap/tidb/git/trees{/sha}","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/{sha}","languages_url":"https://api.github.com/repos/pingcap/tidb/languages","stargazers_url":"https://api.github.com/repos/pingcap/tidb/stargazers","contributors_url":"https://api.github.com/repos/pingcap/tidb/contributors","subscribers_url":"https://api.github.com/repos/pingcap/tidb/subscribers","subscription_url":"https://api.github.com/repos/pingcap/tidb/subscription","commits_url":"https://api.github.com/repos/pingcap/tidb/commits{/sha}","git_commits_url":"https://api.github.com/repos/pingcap/tidb/git/commits{/sha}","comments_url":"https://api.github.com/repos/pingcap/tidb/comments{/number}","issue_comment_url":"https://api.github.com/repos/pingcap/tidb/issues/comments{/number}","contents_url":"https://api.github.com/repos/pingcap/tidb/contents/{+path}","compare_url":"https://api.github.com/repos/pingcap/tidb/compare/{base}...{head}","merges_url":"https://api.github.com/repos/pingcap/tidb/merges","archive_url":"https://api.github.com/repos/pingcap/tidb/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/pingcap/tidb/downloads","issues_url":"https://api.github.com/repos/pingcap/tidb/issues{/number}","pulls_url":"https://api.github.com/repos/pingcap/tidb/pulls{/number}","milestones_url":"https://api.github.com/repos/pingcap/tidb/milestones{/number}","notifications_url":"https://api.github.com/repos/pingcap/tidb/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/pingcap/tidb/labels{/name}","releases_url":"https://api.github.com/repos/pingcap/tidb/releases{/id}","deployments_url":"https://api.github.com/repos/pingcap/tidb/deployments","created_at":"2015-09-06T04:01:52Z","updated_at":"2017-07-24T03:11:32Z","pushed_at":"2017-07-24T03:03:14Z","git_url":"git://github.com/pingcap/tidb.git","ssh_url":"git@github.com:pingcap/tidb.git","clone_url":"https://github.com/pingcap/tidb.git","svn_url":"https://github.com/pingcap/tidb","homepage":"https://pingcap.com","size":28449,"stargazers_count":8958,"watchers_count":8958,"language":"Go","has_issues":true,"has_projects":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":1226,"mirror_url":null,"open_issues_count":260,"forks":1226,"open_issues":260,"watchers":8958,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/3787"},"html":{"href":"https://github.com/pingcap/tidb/pull/3787"},"issue":{"href":"https://api.github.com/repos/pingcap/tidb/issues/3787"},"comments":{"href":"https://api.github.com/repos/pingcap/tidb/issues/3787/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/3787/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/3787/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tidb/statuses/5466d66652903a7bb005790e6836a8b1f1f75858"}}}}
{"actor":{"display_login":"siddontang"}}