Details
-
Bug
-
Status: Closed (View Workflow)
-
Major
-
Resolution: Fixed
-
10.2(EOL), (14)
10.3(EOL), 10.4(EOL), 10.5, 10.6, 10.7(EOL), 10.8(EOL), 10.9(EOL), 10.10(EOL), 10.11, 11.0(EOL), 11.1(EOL), 11.2(EOL), 11.3(EOL), 11.4
Description
The implementation of innodb_undo_log_truncate=ON in trx_purge_truncate_history() is interfering with log checkpoint and page write performance.
Before MDEV-13564, we used the MySQL 5.7 implementation, which would force a full flush of the entire buffer pool and a sharp log checkpoint. In MDEV-13564 we changed it so that only the pages of the being-truncated undo tablespace would be removed from the buffer pool, but no log checkpoint would be needed.
There is a less intrusive, lazy approach: We can actually let the 'garbage' undo log pages remain in the buffer pool, just like we do on DROP TABLE or DROP INDEX or when freeing pages in any operation: Simply, if the newest modification to a page (FIL_PAGE_LSN) is older than the LSN of the latest tablespace rebuild, we will discard the page, just like in MDEV-15528 we do for pages whose underlying file page has been freed. With this approach, there is no need for trx_purge_truncate_history() to traverse the buffer pool.
For the similar case of shrinking the InnoDB system tablespace (MDEV-14795), there would not be a complete tablespace rebuild (like there is with innodb_undo_log_truncate=ON), so we must only discard pages that are beyond the end of the current tablespace size; their FIL_PAGE_LSN must be older than the latest LSN of shrinking the FSP_SIZE. I think that we can do that by relaxing the logic around invoking fil_invalid_page_access_msg() in fil_space_t::io().
Attachments
Issue Links
- is blocked by
-
MDEV-25491 Race condition between DROP TABLE and purge of SYS_INDEXES record
-
- Closed
-
- relates to
-
MDEV-33213 History list is not shrunk unless there is a pause in the workload
-
- Closed
-
-
MDEV-13564 TRUNCATE TABLE and undo tablespace truncation are not compatible with Mariabackup
-
- Closed
-
-
MDEV-14795 InnoDB system tablespace cannot be shrunk
-
- Closed
-
-
MDEV-15528 Avoid writing freed InnoDB pages
-
- Closed
-
-
MDEV-33009 Server hangs for a long time with innodb_undo_log_truncate=ON
-
- Closed
-
Activity
Field | Original Value | New Value |
---|---|---|
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue relates to |
Link |
This issue relates to |
Status | Open [ 1 ] | In Progress [ 3 ] |
Link |
This issue is blocked by |
Fix Version/s | 10.5 [ 23123 ] |
Status | In Progress [ 3 ] | In Testing [ 10301 ] |
Assignee | Marko Mäkelä [ marko ] | Matthias Leich [ mleich ] |
Status | In Testing [ 10301 ] | Stalled [ 10000 ] |
Assignee | Matthias Leich [ mleich ] | Marko Mäkelä [ marko ] |
Assignee | Marko Mäkelä [ marko ] | Vladislav Lesin [ vlad.lesin ] |
Status | Stalled [ 10000 ] | In Review [ 10002 ] |
Status | In Review [ 10002 ] | Stalled [ 10000 ] |
Assignee | Vladislav Lesin [ vlad.lesin ] | Marko Mäkelä [ marko ] |
Link |
This issue relates to |
issue.field.resolutiondate | 2024-01-10 13:42:46.0 | 2024-01-10 13:42:45.529 |
Fix Version/s | 10.6.17 [ 29518 ] | |
Fix Version/s | 10.11.7 [ 29519 ] | |
Fix Version/s | 11.0.5 [ 29520 ] | |
Fix Version/s | 11.1.4 [ 29024 ] | |
Fix Version/s | 11.2.3 [ 29521 ] | |
Fix Version/s | 11.3.2 [ 29522 ] | |
Fix Version/s | 11.4.1 [ 29523 ] | |
Fix Version/s | 10.6 [ 24028 ] | |
Fix Version/s | 10.11 [ 27614 ] | |
Fix Version/s | 11.0 [ 28320 ] | |
Fix Version/s | 11.1 [ 28549 ] | |
Fix Version/s | 11.3 [ 28565 ] | |
Fix Version/s | 11.2 [ 28603 ] | |
Fix Version/s | 11.4 [ 29301 ] | |
Resolution | Fixed [ 1 ] | |
Status | Stalled [ 10000 ] | Closed [ 6 ] |