| Bug #115348 | Expansion of the undo tablespace | ||
|---|---|---|---|
| Submitted: | 16 Jun 2024 15:56 | Modified: | 9 Jan 11:24 |
| Reporter: | Xiaocong Ding (OCA) | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: InnoDB storage engine | Severity: | S3 (Non-critical) |
| Version: | 8.0.40 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | Contribution, Tablespace, undo | ||
[16 Jun 2024 15:56]
Xiaocong Ding
[17 Jun 2024 2:08]
Xiaocong Ding
Just use UNDO_INITIAL_SIZE_IN_PAGES instead of actual size when open an undo tablespace. (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: Fix suggestion.rtf (text/rtf), 1.03 KiB.
[17 Jun 2024 7:32]
MySQL Verification Team
Hello Shay Fabio, Thank you for the report and contribution. regards, Umesh
[9 Jan 11:24]
Xiaocong Ding
Here is a code suggestion. In function trx_rseg_add_rollback_segments, the parameter use_current of fil_space_set_undo_size should be false.
No need to use space->size to set the m_undo_initial. Otherwise this may result in a large initial_size for the undo tablespace, especially after a crash or OOM restart, potentially causing a huge undo tablespace which won't be truncated. Therefore, use_current here should be set to false.
This is the code I suggested:
diff --git a/storage/innobase/trx/trx0rseg.cc b/storage/innobase/trx/trx0rseg.cc
index 0070a54cbec..d3d1b3d20ed 100644
--- a/storage/innobase/trx/trx0rseg.cc
+++ b/storage/innobase/trx/trx0rseg.cc
@@ -961,7 +961,7 @@ bool trx_rseg_add_rollback_segments(space_id_t space_id, ulong target_rsegs,
/* Save the size of the undo tablespace now that all rsegs have been created.
No need to do this for the system temporary tablespace. */
if (type == UNDO) {
- fil_space_set_undo_size(space_id, true);
+ fil_space_set_undo_size(space_id, false);
}
return (success);
}
[14 Nov 10:11]
Azar Md
Is this implemented in mysql version 8.0.40. Even after the restart still i could see the same size for the undo logs. Any suggestion to fix it , iam having a issue where the history list length is in millions and undo log file size in higher gb's.
