Bug #44569 | Online backup crashes the server when run on large tables under load | ||
---|---|---|---|
Submitted: | 30 Apr 2009 7:29 | Modified: | 6 Aug 2009 19:47 |
Reporter: | Omer Barnir (OCA) | Email Updates: | |
Status: | Closed | Impact on me: | |
Category: | MySQL Server: Backup | Severity: | S3 (Non-critical) |
Version: | 6.0.11 | OS: | Any |
Assigned to: | Rafal Somla | CPU Architecture: | Any |
[30 Apr 2009 7:29]
Omer Barnir
[30 Apr 2009 7:32]
Omer Barnir
Observed with 6.0.11 but likely to have been there before
[30 Apr 2009 10:41]
Rafal Somla
I'd like to look at this if no one objects.
[15 Jul 2009 11:59]
Rafal Somla
Trying to repeat the failure with Omer's help.
[15 Jul 2009 23:44]
Omer Barnir
Step #4 above should be 'run_crash' and not 'run_wait' - cut and paste error form bug#44568 - :-(
[27 Jul 2009 14:31]
Rafal Somla
REFINED PROBLEM DESCRIPTION =========================== The problem lies in this fragment of bstream_end_chunk() function (stream_v1_transport.c:1279): if (s->buf.pos == s->buf.header) { ASSERT(s->buf.pos < s->buf.end); *(s->buf.header++)= FR_EOC; s->buf.pos= s->buf.header; } The code assumes that in the case of empty fragment (buf.pos == buf.header) we always have at least one byte left to the end of the output block. But this assumption is not true. As illustrated in BUG#45737 it is possible to arrive at a situation where buf.pos == buf.header == buf.end in which case the above assertion fails.
[28 Jul 2009 9: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/79388 2851 Rafal Somla 2009-07-28 BUG#44569 - Online backup crashes the server when run on large tables under load The logic of bstream_end_chunk() was using wrong assumptions. This patch refactors this logic adding comments explaining how it works. Patch also adds a unit test for testing the logic of bstream_end_chunk(). @ sql/backup/stream_v1.h - In st_backup_stream, replace FIRST_BLOCK state with an independent first_block flag. - Add NEW_CHUNK state for handling empty chunks. @ sql/backup/stream_v1_transport.c - Replaced FIRST_BLOCK state with first_block flag, to make the two independent. - In bstream_write_part() added code for handling the case where there is only one byte left in the current output block. - fixed logic of bstream_end_chunk(). - In bstream_read_part() added check for the situation where the next fragemnt in the stream contains no data but just an EOC marker. @ unittest/backup/Makefile.am Added new unit test bstr_eoc-t. @ unittest/backup/bstr_eoc-t.c A unit test which checks correct behaviour of bstream_end_chunk() function.
[28 Jul 2009 13:34]
Chuck Bell
Approved with changes.
[3 Aug 2009 8:00]
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/79858 2852 Rafal Somla 2009-08-03 BUG#44569 - Online backup crashes the server when run on large tables under load The logic of bstream_end_chunk() was using wrong assumptions. This patch refactors this logic adding comments explaining how it works. Patch also adds a unit test for testing the logic of bstream_end_chunk(). @ sql/backup/stream_v1.h - In st_backup_stream, replace FIRST_BLOCK state with an independent first_block flag. - Add NEW_CHUNK state for handling empty chunks. @ sql/backup/stream_v1_transport.c - Replaced FIRST_BLOCK state with first_block flag, to make the two independent. - In bstream_write_part() added code for handling the case where there is only one byte left in the current output block. - fixed logic of bstream_end_chunk(). - In bstream_read_part() added check for the situation where the next fragment in the stream contains no data but just an EOC marker. @ unittest/backup/Makefile.am Added new unit test bstr_eoc-t. @ unittest/backup/bstr_eoc-t.c A unit test which checks correct behaviour of bstream_end_chunk() function.
[4 Aug 2009 6:42]
Rafal Somla
Pushed to mysql-6.0-backup tree on 2009-08-03.
[6 Aug 2009 8:26]
Bugs System
Pushed into 5.4.4-alpha (revid:alik@sun.com-20090806082225-qssc912qdv1mm6xv) (version source revid:rafal.somla@sun.com-20090803075951-s5vvarlxj53muy8l) (merge vers: 5.4.4-alpha) (pib:11)
[6 Aug 2009 19:47]
Paul DuBois
Not in any released version. No changelog entry needed.
[14 Aug 2009 2:20]
Omer Barnir
Verified original test scenario not crashing when tested on the backup tree (rev 2857)
[23 Dec 2009 15:46]
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/95559 3011 Chuck Bell 2009-12-23 BUG#44569 - Online backup crashes the server when run on large tables under load The logic of bstream_end_chunk() was using wrong assumptions. This patch refactors this logic adding comments explaining how it works. Patch also adds a unit test for testing the logic of bstream_end_chunk(). original changeset: 2599.157.12 @ unittest/backup/bstr_eoc-t.c A unit test which checks correct behaviour of bstream_end_chunk() function.