{"action":"closed","number":7,"pull_request":{"url":"https://api.github.com/repos/maxbube/mydumper/pulls/7","id":78049055,"html_url":"https://github.com/maxbube/mydumper/pull/7","diff_url":"https://github.com/maxbube/mydumper/pull/7.diff","patch_url":"https://github.com/maxbube/mydumper/pull/7.patch","issue_url":"https://api.github.com/repos/maxbube/mydumper/issues/7","number":7,"state":"closed","locked":false,"title":"make changing trx isolation level a critical error, exit the program …","user":{"login":"grypyrg","id":1330700,"avatar_url":"https://avatars.githubusercontent.com/u/1330700?v=3","gravatar_id":"","url":"https://api.github.com/users/grypyrg","html_url":"https://github.com/grypyrg","followers_url":"https://api.github.com/users/grypyrg/followers","following_url":"https://api.github.com/users/grypyrg/following{/other_user}","gists_url":"https://api.github.com/users/grypyrg/gists{/gist_id}","starred_url":"https://api.github.com/users/grypyrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grypyrg/subscriptions","organizations_url":"https://api.github.com/users/grypyrg/orgs","repos_url":"https://api.github.com/users/grypyrg/repos","events_url":"https://api.github.com/users/grypyrg/events{/privacy}","received_events_url":"https://api.github.com/users/grypyrg/received_events","type":"User","site_admin":false},"body":"If not possible to change to `REPEATABLE-READ`, only a `WARNING` is issued when `WITH CONSISTENT SNAPSHOT` is used.\r\n\r\n\r\n# `REPEATABLE-READ`\r\n\r\n```\r\nsession2> set transaction isolation level repeatable read;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nsession2> start transaction with consistent snapshot;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nsession2> rollback;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n```\r\n\r\nThis works and a transaction is immediately started.\r\n\r\n\r\n# `READ-COMMITTED`\r\n\r\n```\r\nsession2> set transaction isolation level read committed;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n\r\nsession2> start transaction with consistent snapshot;\r\nQuery OK, 0 rows affected, 1 warning (0.00 sec)\r\n\r\nsession2> show warnings;\r\n+---------+------+-------------------------------------------------------------------------------------------------------------------------+\r\n| Level   | Code | Message                                                                                                                 |\r\n+---------+------+-------------------------------------------------------------------------------------------------------------------------+\r\n| Warning |  138 | InnoDB: WITH CONSISTENT SNAPSHOT was ignored because this phrase can only be used with REPEATABLE READ isolation level. |\r\n+---------+------+-------------------------------------------------------------------------------------------------------------------------+\r\n1 row in set (0.00 sec)\r\n\r\nsession2> rollback;\r\nQuery OK, 0 rows affected (0.00 sec)\r\n```\r\n\r\nHowever, this does not work and no consistent snapshot is provided.\r\n\r\n# Corresponding Code\r\n\r\nWhen quickly checking the code, there are checks to prevent this:\r\n\r\n```\r\nif (mysql_query(thrconn, \"SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ\")) {\r\n\tg_warning(\"Failed to set isolation level: %s\", mysql_error(thrconn));\r\n}\r\nif (mysql_query(thrconn, \"START TRANSACTION /*!40108 WITH CONSISTENT SNAPSHOT */\")) {\r\n\tg_critical(\"Failed to start consistent snapshot: %s\",mysql_error(thrconn));\r\n\terrors++;\r\n}\r\n```\r\nhttps://github.com/maxbube/mydumper/blob/9bce1df0938914122665f01ce5b2507da9962a61/mydumper.c#L426-L431\r\n\r\nHowever, this is only a warning message, this should be a critical as this does not guarantee you have a consistent backup\r\n\r\n(I'm not sure in which cases you cannot change the isolation level though, but better to prevent it).\r\n\r\nAlso I added `exit(EXIT_FAILURE)` on both these to avoid continuing to take a backup as it failed to get a consistent backup anyway.","created_at":"2016-07-19T21:06:05Z","updated_at":"2016-08-26T17:50:19Z","closed_at":"2016-08-26T17:50:18Z","merged_at":"2016-08-26T17:50:18Z","merge_commit_sha":"fb07aea8572dfe04049a312a77b4af1c23ed201e","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/maxbube/mydumper/pulls/7/commits","review_comments_url":"https://api.github.com/repos/maxbube/mydumper/pulls/7/comments","review_comment_url":"https://api.github.com/repos/maxbube/mydumper/pulls/comments{/number}","comments_url":"https://api.github.com/repos/maxbube/mydumper/issues/7/comments","statuses_url":"https://api.github.com/repos/maxbube/mydumper/statuses/b39cfe5ff44c75a62f1107baa96e1279746d0206","head":{"label":"grypyrg:trx_isolation_change_error","ref":"trx_isolation_change_error","sha":"b39cfe5ff44c75a62f1107baa96e1279746d0206","user":{"login":"grypyrg","id":1330700,"avatar_url":"https://avatars.githubusercontent.com/u/1330700?v=3","gravatar_id":"","url":"https://api.github.com/users/grypyrg","html_url":"https://github.com/grypyrg","followers_url":"https://api.github.com/users/grypyrg/followers","following_url":"https://api.github.com/users/grypyrg/following{/other_user}","gists_url":"https://api.github.com/users/grypyrg/gists{/gist_id}","starred_url":"https://api.github.com/users/grypyrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grypyrg/subscriptions","organizations_url":"https://api.github.com/users/grypyrg/orgs","repos_url":"https://api.github.com/users/grypyrg/repos","events_url":"https://api.github.com/users/grypyrg/events{/privacy}","received_events_url":"https://api.github.com/users/grypyrg/received_events","type":"User","site_admin":false},"repo":{"id":63727446,"name":"mydumper","full_name":"grypyrg/mydumper","owner":{"login":"grypyrg","id":1330700,"avatar_url":"https://avatars.githubusercontent.com/u/1330700?v=3","gravatar_id":"","url":"https://api.github.com/users/grypyrg","html_url":"https://github.com/grypyrg","followers_url":"https://api.github.com/users/grypyrg/followers","following_url":"https://api.github.com/users/grypyrg/following{/other_user}","gists_url":"https://api.github.com/users/grypyrg/gists{/gist_id}","starred_url":"https://api.github.com/users/grypyrg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/grypyrg/subscriptions","organizations_url":"https://api.github.com/users/grypyrg/orgs","repos_url":"https://api.github.com/users/grypyrg/repos","events_url":"https://api.github.com/users/grypyrg/events{/privacy}","received_events_url":"https://api.github.com/users/grypyrg/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/grypyrg/mydumper","description":"Official mydumper project","fork":true,"url":"https://api.github.com/repos/grypyrg/mydumper","forks_url":"https://api.github.com/repos/grypyrg/mydumper/forks","keys_url":"https://api.github.com/repos/grypyrg/mydumper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/grypyrg/mydumper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/grypyrg/mydumper/teams","hooks_url":"https://api.github.com/repos/grypyrg/mydumper/hooks","issue_events_url":"https://api.github.com/repos/grypyrg/mydumper/issues/events{/number}","events_url":"https://api.github.com/repos/grypyrg/mydumper/events","assignees_url":"https://api.github.com/repos/grypyrg/mydumper/assignees{/user}","branches_url":"https://api.github.com/repos/grypyrg/mydumper/branches{/branch}","tags_url":"https://api.github.com/repos/grypyrg/mydumper/tags","blobs_url":"https://api.github.com/repos/grypyrg/mydumper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/grypyrg/mydumper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/grypyrg/mydumper/git/refs{/sha}","trees_url":"https://api.github.com/repos/grypyrg/mydumper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/grypyrg/mydumper/statuses/{sha}","languages_url":"https://api.github.com/repos/grypyrg/mydumper/languages","stargazers_url":"https://api.github.com/repos/grypyrg/mydumper/stargazers","contributors_url":"https://api.github.com/repos/grypyrg/mydumper/contributors","subscribers_url":"https://api.github.com/repos/grypyrg/mydumper/subscribers","subscription_url":"https://api.github.com/repos/grypyrg/mydumper/subscription","commits_url":"https://api.github.com/repos/grypyrg/mydumper/commits{/sha}","git_commits_url":"https://api.github.com/repos/grypyrg/mydumper/git/commits{/sha}","comments_url":"https://api.github.com/repos/grypyrg/mydumper/comments{/number}","issue_comment_url":"https://api.github.com/repos/grypyrg/mydumper/issues/comments{/number}","contents_url":"https://api.github.com/repos/grypyrg/mydumper/contents/{+path}","compare_url":"https://api.github.com/repos/grypyrg/mydumper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/grypyrg/mydumper/merges","archive_url":"https://api.github.com/repos/grypyrg/mydumper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/grypyrg/mydumper/downloads","issues_url":"https://api.github.com/repos/grypyrg/mydumper/issues{/number}","pulls_url":"https://api.github.com/repos/grypyrg/mydumper/pulls{/number}","milestones_url":"https://api.github.com/repos/grypyrg/mydumper/milestones{/number}","notifications_url":"https://api.github.com/repos/grypyrg/mydumper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/grypyrg/mydumper/labels{/name}","releases_url":"https://api.github.com/repos/grypyrg/mydumper/releases{/id}","deployments_url":"https://api.github.com/repos/grypyrg/mydumper/deployments","created_at":"2016-07-19T20:55:36Z","updated_at":"2016-07-19T20:55:37Z","pushed_at":"2016-07-19T21:03:48Z","git_url":"git://github.com/grypyrg/mydumper.git","ssh_url":"git@github.com:grypyrg/mydumper.git","clone_url":"https://github.com/grypyrg/mydumper.git","svn_url":"https://github.com/grypyrg/mydumper","homepage":"","size":959,"stargazers_count":0,"watchers_count":0,"language":"C","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":"maxbube:master","ref":"master","sha":"9bce1df0938914122665f01ce5b2507da9962a61","user":{"login":"maxbube","id":4355976,"avatar_url":"https://avatars.githubusercontent.com/u/4355976?v=3","gravatar_id":"","url":"https://api.github.com/users/maxbube","html_url":"https://github.com/maxbube","followers_url":"https://api.github.com/users/maxbube/followers","following_url":"https://api.github.com/users/maxbube/following{/other_user}","gists_url":"https://api.github.com/users/maxbube/gists{/gist_id}","starred_url":"https://api.github.com/users/maxbube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxbube/subscriptions","organizations_url":"https://api.github.com/users/maxbube/orgs","repos_url":"https://api.github.com/users/maxbube/repos","events_url":"https://api.github.com/users/maxbube/events{/privacy}","received_events_url":"https://api.github.com/users/maxbube/received_events","type":"User","site_admin":false},"repo":{"id":45695616,"name":"mydumper","full_name":"maxbube/mydumper","owner":{"login":"maxbube","id":4355976,"avatar_url":"https://avatars.githubusercontent.com/u/4355976?v=3","gravatar_id":"","url":"https://api.github.com/users/maxbube","html_url":"https://github.com/maxbube","followers_url":"https://api.github.com/users/maxbube/followers","following_url":"https://api.github.com/users/maxbube/following{/other_user}","gists_url":"https://api.github.com/users/maxbube/gists{/gist_id}","starred_url":"https://api.github.com/users/maxbube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxbube/subscriptions","organizations_url":"https://api.github.com/users/maxbube/orgs","repos_url":"https://api.github.com/users/maxbube/repos","events_url":"https://api.github.com/users/maxbube/events{/privacy}","received_events_url":"https://api.github.com/users/maxbube/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/maxbube/mydumper","description":"Official mydumper project","fork":false,"url":"https://api.github.com/repos/maxbube/mydumper","forks_url":"https://api.github.com/repos/maxbube/mydumper/forks","keys_url":"https://api.github.com/repos/maxbube/mydumper/keys{/key_id}","collaborators_url":"https://api.github.com/repos/maxbube/mydumper/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/maxbube/mydumper/teams","hooks_url":"https://api.github.com/repos/maxbube/mydumper/hooks","issue_events_url":"https://api.github.com/repos/maxbube/mydumper/issues/events{/number}","events_url":"https://api.github.com/repos/maxbube/mydumper/events","assignees_url":"https://api.github.com/repos/maxbube/mydumper/assignees{/user}","branches_url":"https://api.github.com/repos/maxbube/mydumper/branches{/branch}","tags_url":"https://api.github.com/repos/maxbube/mydumper/tags","blobs_url":"https://api.github.com/repos/maxbube/mydumper/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/maxbube/mydumper/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/maxbube/mydumper/git/refs{/sha}","trees_url":"https://api.github.com/repos/maxbube/mydumper/git/trees{/sha}","statuses_url":"https://api.github.com/repos/maxbube/mydumper/statuses/{sha}","languages_url":"https://api.github.com/repos/maxbube/mydumper/languages","stargazers_url":"https://api.github.com/repos/maxbube/mydumper/stargazers","contributors_url":"https://api.github.com/repos/maxbube/mydumper/contributors","subscribers_url":"https://api.github.com/repos/maxbube/mydumper/subscribers","subscription_url":"https://api.github.com/repos/maxbube/mydumper/subscription","commits_url":"https://api.github.com/repos/maxbube/mydumper/commits{/sha}","git_commits_url":"https://api.github.com/repos/maxbube/mydumper/git/commits{/sha}","comments_url":"https://api.github.com/repos/maxbube/mydumper/comments{/number}","issue_comment_url":"https://api.github.com/repos/maxbube/mydumper/issues/comments{/number}","contents_url":"https://api.github.com/repos/maxbube/mydumper/contents/{+path}","compare_url":"https://api.github.com/repos/maxbube/mydumper/compare/{base}...{head}","merges_url":"https://api.github.com/repos/maxbube/mydumper/merges","archive_url":"https://api.github.com/repos/maxbube/mydumper/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/maxbube/mydumper/downloads","issues_url":"https://api.github.com/repos/maxbube/mydumper/issues{/number}","pulls_url":"https://api.github.com/repos/maxbube/mydumper/pulls{/number}","milestones_url":"https://api.github.com/repos/maxbube/mydumper/milestones{/number}","notifications_url":"https://api.github.com/repos/maxbube/mydumper/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/maxbube/mydumper/labels{/name}","releases_url":"https://api.github.com/repos/maxbube/mydumper/releases{/id}","deployments_url":"https://api.github.com/repos/maxbube/mydumper/deployments","created_at":"2015-11-06T17:11:15Z","updated_at":"2016-08-24T04:33:49Z","pushed_at":"2016-08-26T17:50:18Z","git_url":"git://github.com/maxbube/mydumper.git","ssh_url":"git@github.com:maxbube/mydumper.git","clone_url":"https://github.com/maxbube/mydumper.git","svn_url":"https://github.com/maxbube/mydumper","homepage":"","size":1072,"stargazers_count":38,"watchers_count":38,"language":"C","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":12,"mirror_url":null,"open_issues_count":8,"forks":12,"open_issues":8,"watchers":38,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/maxbube/mydumper/pulls/7"},"html":{"href":"https://github.com/maxbube/mydumper/pull/7"},"issue":{"href":"https://api.github.com/repos/maxbube/mydumper/issues/7"},"comments":{"href":"https://api.github.com/repos/maxbube/mydumper/issues/7/comments"},"review_comments":{"href":"https://api.github.com/repos/maxbube/mydumper/pulls/7/comments"},"review_comment":{"href":"https://api.github.com/repos/maxbube/mydumper/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/maxbube/mydumper/pulls/7/commits"},"statuses":{"href":"https://api.github.com/repos/maxbube/mydumper/statuses/b39cfe5ff44c75a62f1107baa96e1279746d0206"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"maxbube","id":4355976,"avatar_url":"https://avatars.githubusercontent.com/u/4355976?v=3","gravatar_id":"","url":"https://api.github.com/users/maxbube","html_url":"https://github.com/maxbube","followers_url":"https://api.github.com/users/maxbube/followers","following_url":"https://api.github.com/users/maxbube/following{/other_user}","gists_url":"https://api.github.com/users/maxbube/gists{/gist_id}","starred_url":"https://api.github.com/users/maxbube/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/maxbube/subscriptions","organizations_url":"https://api.github.com/users/maxbube/orgs","repos_url":"https://api.github.com/users/maxbube/repos","events_url":"https://api.github.com/users/maxbube/events{/privacy}","received_events_url":"https://api.github.com/users/maxbube/received_events","type":"User","site_admin":false},"comments":0,"review_comments":0,"commits":1,"additions":3,"deletions":2,"changed_files":1}}
{"actor":{"display_login":"maxbube"}}