[MDEV-13471] Test failure on innodb.log_file_size,4k Created: 2017-08-08 Updated: 2021-05-13 Resolved: 2017-08-31 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Galera, Storage Engine - InnoDB, Storage Engine - XtraDB |
| Affects Version/s: | 10.1, 10.2 |
| Fix Version/s: | 10.1.27, 10.0.32-galera, 10.2.9, 10.3.2 |
| Type: | Bug | Priority: | Critical |
| Reporter: | Jan Lindström (Inactive) | Assignee: | Jan Lindström (Inactive) |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Description |
|
WSREP XID is stored in the TRX_SYS page at innodb_page_size-3500, which overlaps with rseg undo slots, causing the following kind of error:
In debug build this could also cause innodb-alter-tempfile,4k,innodb_plugin:
For reference see: |
| Comments |
| Comment by Jan Lindström (Inactive) [ 2017-08-09 ] | ||||||||||||||||||||||||||||||||||
|
https://github.com/MariaDB/server/commit/b4a4e79865399a443abc6a54c809eaf60d460fee This does not really require Galera knowledge. | ||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-08-10 ] | ||||||||||||||||||||||||||||||||||
|
The problem is that with innodb_page_size=4k, the Galera WSREP XID would be written to byte offset 4096-3500, overwriting rollback segment slots in a TRX_SYS page.
In the first affected slot, the least significant 16 bits of TRX_SYS_RSEG_SPACE would be overwritten with 0x7773, and the most significant 16 bits of TRX_SYS_RSEG_PAGE_NO would be overwritten with 0x7265. The default value of innodb_undo_logs (or innodb_rollback_segments) always was 128 in MariaDB Server 10.x. It might have been possible to avoid this collision when using a non-default smaller value for that parameter. But, by default, Galera would never work with innodb_page_size=4k due to this collision. Note: In slot 0, we should always have the TRX_SYS_RSEG_SPACE:TRX_SYS_RSEG_PAGE_NO pair 0:6. In slots 1 to 127, if the space_id is 0, the page number would be allocated from the system tablespace. If the database was used for a long time with innodb_undo_logs=1 (or if it was originally created before this parameter was introduced), it is possible that the subsequent rollback segment slots would have very high page numbers. In slots 1 to 127, if the space_id is not 0, the page number should always be 3, because the page is allocated straight after the undo tablespace creation. Originally, the undo tablespace ID would always be between 0 and 127. Starting with MySQL 5.6.36 which introduced This is just the first collision. The WSREP XID data would overwrite subsequent slots. | ||||||||||||||||||||||||||||||||||
| Comment by Marko Mäkelä [ 2017-08-10 ] | ||||||||||||||||||||||||||||||||||
|
Please simplify the patch. We do not need to deal with 2 locations of the WSREP XID information when using innodb_page_size=4k. | ||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-08-10 ] | ||||||||||||||||||||||||||||||||||
|
5.5-galera not effected. | ||||||||||||||||||||||||||||||||||
| Comment by Jan Lindström (Inactive) [ 2017-08-22 ] | ||||||||||||||||||||||||||||||||||
|
10.0.32-galera:
|