Bug #25628 | mysqlbinlog crashes while processing binary logs | ||
---|---|---|---|
Submitted: | 15 Jan 2007 14:47 | Modified: | 9 Mar 2007 14:23 |
Reporter: | Hartmut Holzgraefe | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Replication | Severity: | S2 (Serious) |
Version: | 5.1.14-ndb-6.1.0-telco, 5.1bk, 5.1.12 | OS: | Linux (linux) |
Assigned to: | Guilhem Bichot | CPU Architecture: | Any |
Tags: | bfsm_2007_01_18 |
[15 Jan 2007 14:47]
Hartmut Holzgraefe
[30 Jan 2007 21:41]
Guilhem Bichot
indeed I observed that this IO_CACHE has a problem, and I have asked Mats to tell me if we could get rid of it.
[8 Feb 2007 14:27]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/19565 ChangeSet@1.2372, 2007-02-08 16:24:52+01:00, guilhem@gbichot3.local +6 -0 Fix for BUG#25628: "mysqlbinlog crashes while processing binary logs". mysqlbinlog prints all row-based events of a single statement as a single "BINLOG" statement containing the concatenation of those events. Big (i.e. >64k) concatenations of row-based events (e.g. Write_rows_log_event) caused mysqlbinlog's IO_CACHE to overflow to a temporary file but the IO_CACHE had not been inited with open_cached_file(), so it tried to create a temporary file in an uninitialized directory (thus failing to create, then to write; some OS errors were printed, and it finally segfaulted). After fixing this, it appeared that mysqlbinlog was printing only a piece of big concatenations of row-based events (it printed at most the size of the IO_CACHE's buffer i.e. 64k); that caused data loss at restore. We fix and test that. Last, mysqlbinlog's printouts looked a bit strange with the informative header (#-prefixed) of groupped Rows_log_event all on one line, so we insert \n. After that, a small bug in the --hexdump code appeared (only if the string to hex-print had its length a multiple of 16), we fix it.
[23 Feb 2007 21:24]
Bugs System
A patch for this bug has been committed. After review, it may be pushed to the relevant source trees for release in the next version. You can access the patch from: http://lists.mysql.com/commits/20506 ChangeSet@1.2413, 2007-02-23 22:23:54+01:00, gbichot@dl145h.mysql.com +6 -0 Fix for BUG#25628: "mysqlbinlog crashes while processing binary logs". mysqlbinlog prints all row-based events of a single statement as a single "BINLOG" statement containing the concatenation of those events. Big (i.e. >64k) concatenations of row-based events (e.g. Write_rows_log_event) caused mysqlbinlog's IO_CACHE to overflow to a temporary file but the IO_CACHE had not been inited with open_cached_file(), so it tried to create a temporary file in an uninitialized directory (thus failing to create, then to write; some OS errors were printed, and it finally segfaulted). After fixing this, it appeared that mysqlbinlog was printing only a piece of big concatenations of row-based events (it printed at most the size of the IO_CACHE's buffer i.e. 64k); that caused data loss at restore. We fix and test that. Last, mysqlbinlog's printouts looked a bit strange with the informative header (#-prefixed) of groupped Rows_log_event all on one line, so we insert \n. After that, a small bug in the --hexdump code appeared (only if the string to hex-print had its length a multiple of 16), we fix it.
[24 Feb 2007 10:14]
Guilhem Bichot
pushed into the replication team tree mysql-5.1-rpl. There were two bugs when a statement inserted/updated/deleted a lot of data in row-based binary logging: - not all changes were recorded into the binlog (=> data loss on the slave or on restore from mysqlbinlog) - mysqlbinlog would show OS errors or even crash, if run on the binlog. "A lot of data" means ~ tens of kilobytes or more.
[8 Mar 2007 8:35]
Andrei Elkin
pushed to 5.1.17-beta
[9 Mar 2007 14:23]
MC Brown
A note has been added to the 5.1.17 changelog.