[MDEV-28699] Shrink temporary tablespaces without restart Created: 2022-05-30 Updated: 2024-01-05 Resolved: 2023-10-27 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Data Definition - Temporary, Storage Engine - InnoDB |
| Fix Version/s: | 11.3.1 |
| Type: | Task | Priority: | Blocker |
| Reporter: | William Edwards | Assignee: | Thirunarayanan Balathandayuthapani |
| Resolution: | Fixed | Votes: | 2 |
| Labels: | Preview_11.3 | ||
| Issue Links: |
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
| Description |
|
The documentation at https://mariadb.com/kb/en/innodb-temporary-tablespaces/ says:
This means temporary tablespaces will keep growing until MariaDB is restarted. Having to restart MariaDB periodically is not optimal. It would be welcome if MariaDB shrinks temporary tablespaces on disk without restarting. To achieve this, we would introduce new syntax:
|
| Comments |
| Comment by Marko Mäkelä [ 2022-05-31 ] | |
|
Before we can fix this, I think that When it comes to shrinking InnoDB data files, the groundwork is laid out in For the temporary tablespace, we do not even have to think about recovery or logging. Possibly we could extend the idea of | |
| Comment by William Edwards [ 2022-07-24 ] | |
|
Thank you for your substantive reply, Marko. I think that this issue, together with | |
| Comment by Marko Mäkelä [ 2023-01-10 ] | |
|
I think that this will be easier to implement, once | |
| Comment by Marko Mäkelä [ 2023-09-07 ] | |
|
Now that tests by mleich seem to be reasonably stable, I reviewed the current development version. The logic looks mostly OK. The only problem that I found is a lock order inversion (or latching order violation) when we are evicting page allocation bitmap pages that would be in the to-be-freed page range. We must never wait for a page latch while holding buf_pool.mutex. If a "trylock" fails, we need a fallback path that will involve releasing and reacquiring buf_pool.mutex. See buf_page_create_low() for an example. | |
| Comment by Marko Mäkelä [ 2023-09-12 ] | |
|
This rebase is OK to push to the preview release. Thank you for separating the bug fixes into separate commits. I did not notice any correctness problems, but it would be nice to address my minor review comments. | |
| Comment by Matthias Leich [ 2023-10-10 ] | |
|
performed quite good in RQG testing (with innodb_truncate_temporary_tablespace_now etc.). No new InnoDB related problems related to the modifications of | |
| Comment by Marko Mäkelä [ 2023-10-25 ] | |
|
This could not be pushed to 11.3 before |