[MDEV-14051] 'Undo log record is too big.' error occurring in very narrow range of string lengths Created: 2017-10-12 Updated: 2022-09-29 Resolved: 2017-10-25 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Storage Engine - InnoDB |
| Affects Version/s: | 10.1.26, 5.5.57, 10.0.32, 10.2.9 |
| Fix Version/s: | 5.5.59, 10.0.33, 10.1.29, 10.2.10, 10.3.3 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Geoff Montee (Inactive) | Assignee: | Marko Mäkelä |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | innodb, upstream | ||
| Attachments: |
|
||||||||||||||||
| Issue Links: |
|
||||||||||||||||
| Description |
|
A user is seeing an 'Undo log record is too big.' error that only occurs if they update 2 mediumtext fields at once, and if the length of the existing values in each those fields happen to be between 3962 and 4030 characters long. Some other interesting notes about this:
I have attached an SQL file that can be used to reproduce this issue. Upstream bug report: https://bugs.mysql.com/bug.php?id=88150 |
| Comments |
| Comment by Geoff Montee (Inactive) [ 2017-10-12 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Some thoughts from marko:
| |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Claudio Nanni [ 2017-10-20 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
For completeness the problem is reproducible also with one single field, upper limit should be of 8061 characters. ------------------
------------------
------------------ mysql> update test_tab set a_str_18=CONCAT(a_str_18,1); mysql> UPDATE test_tab set a_str_18=LEFT(a_str_18,8000); mysql> update test_tab set a_str_18=CONCAT(a_str_18,1); | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-10-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I believe that the problem must be in the function dtuple_convert_big_rec() or in the related logic. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-10-23 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
My guess was wrong, and this indeed is a bug with the InnoDB undo log format.
saved into a .test file, executed with
and then
In this function, I started to single-step. The first invocation of trx_undo_page_report_modify() can ‘safely’ fail; there is a fall-back that retries with an empty undo log page.
After some single-stepping I set breakpoints to every return statement in the function.
The first one (above) logs every updated column.
The space runs out during this loop, apparently at the very last user column. We abort at ptr-$3-$4=15933, right here in the second loop:
Because this second loop is writing the column number to the undo log record, the fix might be as simple as omitting those indexed columns that were logged as updated. Furthermore, in MariaDB 10.2 (and MySQL 5.7) the undo log format has changed due to indexed virtual columns ( | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-10-24 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
I pushed to bb-5.5-marko. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-10-25 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
Merged up to 10.2 so far. | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2018-01-02 ] | |||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
|
This bug caused a permanent ‘corruption’ of data files that causes performance regression for accessing secondary indexes: |