Bug #62104 | mysqldump --single_transaction option and READ COMMITTED isolation mode | ||
---|---|---|---|
Submitted: | 6 Aug 2011 7:10 | Modified: | 11 Mar 2013 17:19 |
Reporter: | Peter Laursen (Basic Quality Contributor) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Documentation | Severity: | S3 (Non-critical) |
Version: | any | OS: | Any |
Assigned to: | John Russell | CPU Architecture: | Any |
[6 Aug 2011 7:10]
Peter Laursen
[6 Aug 2011 7:13]
Peter Laursen
typo fix!
[6 Aug 2011 8:51]
Valeriy Kravchuk
So, is this a documentation request to clearly describe current behavior of mysqldump, or a feature request for mysqldump to always use REPEATABLE READ isolation level, or request for mysqldump to provide option to specify isolation level? Please, clarify.
[6 Aug 2011 9:00]
Peter Laursen
It is a request to either 1) always use REPEATABLE READ for the SESSION if --single_transaction is specified 2) or alternatively provide one more option that lets the user do so. It should have been added in 5.0 I think as it became possible with SESSION variables. There is an avoidable risk that an inconsistent shapshot is created if server is running READ_COMMITED globally.
[6 Aug 2011 10:09]
Sveta Smirnova
Thank you for the report. mysqldump actually adds REPEATABLE READ at the start of session when --single-transaction is specified. You can ensure that if run SET GLOBAL log_output='table', general_log=1;, then run mysqldump and examine its content: mysql> select * from mysql.general_log\G ... *************************** 5. row *************************** event_time: 2011-08-03 19:47:11 user_host: root[root] @ localhost [] thread_id: 17196 server_id: 51 command_type: Query argument: SET SESSION TRANSACTION ISOLATION LEVEL REPEATABLE READ *************************** 6. row *************************** event_time: 2011-08-03 19:47:11 user_host: root[root] @ localhost [] thread_id: 17196 server_id: 51 command_type: Query argument: START TRANSACTION /*!40100 WITH CONSISTENT SNAPSHOT */
[6 Aug 2011 10:28]
Peter Laursen
Could you please reopen and change category to 'documentation'? Documentation *does not* tell this. It only tells that it will execute START TRANSACTION or BEGIN (and that small inconsistence should be fixed in docs as well). In addition to what docs tells now something like this should be added "Also if --single_transaction is specified mysqldump will set transaction isolation mode to REPEATEBLE_READ"
[6 Aug 2011 10:29]
Peter Laursen
forgot a detail: ".. will set transaction isolation mode to REPEATEBLE_READ for the SESSION"
[6 Aug 2011 10:31]
Sveta Smirnova
Thank you for the feedback. Agreed and done.
[11 Mar 2013 17:19]
Paul DuBois
Thank you for your bug report. This issue has been addressed in the documentation. The updated documentation will appear on our website shortly, and will be included in the next release of the relevant products. Updated text: This option sets the transaction isolation mode to REPEATABLE READ and sends a START TRANSACTION SQL statement to the server before dumping data. It is useful only with transactional tables such as InnoDB, because then it dumps the consistent state of the database at the time when START TRANSACTION was issued without blocking any applications.