{"action":"created","comment":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/comments/93599898","pull_request_review_id":14130040,"id":93599898,"diff_hunk":"@@ -313,32 +305,32 @@ func (s *session) Retry() error {\n \tvar err error\n \tretryCnt := 0\n \tfor {\n-\t\tPrepareTxnCtx(s)\n-\t\tsuccess := true\n-\t\ts.sessionVars.RetryInfo.ResetOffset()\n-\t\tfor _, sr := range nh.history {\n-\t\t\tst := sr.st\n-\t\t\ttxt := st.OriginText()\n-\t\t\tif len(txt) > sqlLogMaxLen {\n-\t\t\t\ttxt = txt[:sqlLogMaxLen]\n-\t\t\t}\n-\t\t\tlog.Warnf(\"Retry %s (len:%d)\", txt, len(st.OriginText()))\n-\t\t\t_, err = st.Exec(s)\n-\t\t\tif err != nil {\n-\t\t\t\tif s.isRetryableError(err) {\n-\t\t\t\t\tsuccess = false\n+\t\terr = PrepareTxnCtx(s)","path":"session.go","position":105,"original_position":105,"commit_id":"e7bab9e241346e9b11d9399151611a75b52f5dbe","original_commit_id":"e7bab9e241346e9b11d9399151611a75b52f5dbe","user":{"login":"hanfei1991","id":20884546,"avatar_url":"https://avatars.githubusercontent.com/u/20884546?v=3","gravatar_id":"","url":"https://api.github.com/users/hanfei1991","html_url":"https://github.com/hanfei1991","followers_url":"https://api.github.com/users/hanfei1991/followers","following_url":"https://api.github.com/users/hanfei1991/following{/other_user}","gists_url":"https://api.github.com/users/hanfei1991/gists{/gist_id}","starred_url":"https://api.github.com/users/hanfei1991/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hanfei1991/subscriptions","organizations_url":"https://api.github.com/users/hanfei1991/orgs","repos_url":"https://api.github.com/users/hanfei1991/repos","events_url":"https://api.github.com/users/hanfei1991/events{/privacy}","received_events_url":"https://api.github.com/users/hanfei1991/received_events","type":"User","site_admin":false},"body":"how about if err = PrepareTxnCtx(s); err == nil {...}","created_at":"2016-12-22T10:34:35Z","updated_at":"2016-12-22T10:41:15Z","html_url":"https://github.com/pingcap/tidb/pull/2298#discussion_r93599898","pull_request_url":"https://api.github.com/repos/pingcap/tidb/pulls/2298","_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments/93599898"},"html":{"href":"https://github.com/pingcap/tidb/pull/2298#discussion_r93599898"},"pull_request":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/2298"}}},"pull_request":{"url":"https://api.github.com/repos/pingcap/tidb/pulls/2298","id":98932098,"html_url":"https://github.com/pingcap/tidb/pull/2298","diff_url":"https://github.com/pingcap/tidb/pull/2298.diff","patch_url":"https://github.com/pingcap/tidb/pull/2298.patch","issue_url":"https://api.github.com/repos/pingcap/tidb/issues/2298","number":2298,"state":"open","locked":false,"title":"*: refactor `context.Context`","user":{"login":"coocood","id":891222,"avatar_url":"https://avatars.githubusercontent.com/u/891222?v=3","gravatar_id":"","url":"https://api.github.com/users/coocood","html_url":"https://github.com/coocood","followers_url":"https://api.github.com/users/coocood/followers","following_url":"https://api.github.com/users/coocood/following{/other_user}","gists_url":"https://api.github.com/users/coocood/gists{/gist_id}","starred_url":"https://api.github.com/users/coocood/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/coocood/subscriptions","organizations_url":"https://api.github.com/users/coocood/orgs","repos_url":"https://api.github.com/users/coocood/repos","events_url":"https://api.github.com/users/coocood/events{/privacy}","received_events_url":"https://api.github.com/users/coocood/received_events","type":"User","site_admin":false},"body":"Make transaction life cycle under control, prepare for correctly handle schema out of date error.\r\nThe old `GetTxn(forceNew boll)` is replaced by `Txn` and `NewTxn`,\r\n`CommitTxn` and `RollbackTxn` is removed.","created_at":"2016-12-21T13:25:07Z","updated_at":"2016-12-22T10:41:15Z","closed_at":null,"merged_at":null,"merge_commit_sha":"16878975f635d1eb26ae84cc91d9edc5b31c8f47","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/pingcap/tidb/pulls/2298/commits","review_comments_url":"https://api.github.com/repos/pingcap/tidb/pulls/2298/comments","review_comment_url":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}","comments_url":"https://api.github.com/repos/pingcap/tidb/issues/2298/comments","statuses_url":"https://api.github.com/repos/pingcap/tidb/statuses/e7bab9e241346e9b11d9399151611a75b52f5dbe","head":{"label":"pingcap:coocood/refactor-context","ref":"coocood/refactor-context","sha":"e7bab9e241346e9b11d9399151611a75b52f5dbe","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":41986369,"name":"tidb","full_name":"pingcap/tidb","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/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":"2016-12-22T08:37:41Z","pushed_at":"2016-12-22T10:41:13Z","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":"","size":19978,"stargazers_count":5583,"watchers_count":5583,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":732,"mirror_url":null,"open_issues_count":160,"forks":732,"open_issues":160,"watchers":5583,"default_branch":"master"}},"base":{"label":"pingcap:master","ref":"master","sha":"f32eaedcb30790f4785025b2119fb90d66b127ed","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":41986369,"name":"tidb","full_name":"pingcap/tidb","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/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":"2016-12-22T08:37:41Z","pushed_at":"2016-12-22T10:41:13Z","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":"","size":19978,"stargazers_count":5583,"watchers_count":5583,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":732,"mirror_url":null,"open_issues_count":160,"forks":732,"open_issues":160,"watchers":5583,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/2298"},"html":{"href":"https://github.com/pingcap/tidb/pull/2298"},"issue":{"href":"https://api.github.com/repos/pingcap/tidb/issues/2298"},"comments":{"href":"https://api.github.com/repos/pingcap/tidb/issues/2298/comments"},"review_comments":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/2298/comments"},"review_comment":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/pingcap/tidb/pulls/2298/commits"},"statuses":{"href":"https://api.github.com/repos/pingcap/tidb/statuses/e7bab9e241346e9b11d9399151611a75b52f5dbe"}}}}
{"actor":{"display_login":"hanfei1991"}}