[MDEV-31646] Online alter applies binlog cache limit to cache writes Created: 2023-07-07 Updated: 2023-08-16 Resolved: 2023-08-16 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Alter Table |
| Affects Version/s: | N/A |
| Fix Version/s: | 11.2.1 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Elena Stepanova | Assignee: | Nikita Malyavin |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||
| Description |
|
Note: To get the error shown below (ER_TRANS_CACHE_FULL), I had to modify log.cc:
This over-zealous assertion prevents any testing causing binlog write errors, even those which are supposed to be properly handled (it has been discussed with the replication team); and the test could not be run on a non-debug build because it uses debug sync facility. Binary logging has two hard limits for the caches, max_binlog_cache_size is applied to (multi-statement) transactions and max_binlog_stmt_cache_size to individual statements.
If we instead modify max_binlog_stmt_cache_size in the test case, it doesn't fail. Here is the matching test case for the traditional binary log:
Here update is not affected by the limit change and passes. |
| Comments |
| Comment by Elena Stepanova [ 2023-07-09 ] |
|
Come to think of it, it doesn't seem right at all that the DML fails here (regardless which cache limit is in use). Binary logging of DML here is only needed for ALTER, so if anything fails here, it should be ALTER. |
| Comment by Nikita Malyavin [ 2023-07-13 ] |
|
elenst there is binlog_bug23533.test, that sets to the minimal value and makes lots of inserts, so it may be my wrong usage of some underlying functions |
| Comment by Elena Stepanova [ 2023-07-13 ] |
|
If you mean the assertion failure, no, it's not you, it fails readily with vanilla binary logging. If you take the 2nd test case from the description (of course with max_binlog_stmt_cache_size instead of max_binlog_cache_size), it will fail on that assertion even with 10.4. I'm not sure what is different in binlog_bug23533. Maybe it doesn't fail the exact same way with the transaction cache; or maybe it doesn't fail the same way with CREATE ... SELECT (which is the only query they execute with minimal cache limits); or maybe binlog_cache_size prevents the failure on max_binlog_cache_size; or whatever. |
| Comment by Nikita Malyavin [ 2023-07-13 ] |
|
Good to know. I didn't manae to reproduce it myself by varying an amount of rows and their width and inserting sporadic log flushes in-between with the aforementioned test. |
| Comment by Nikita Malyavin [ 2023-07-19 ] |
|
Please review these commits: |