| Bug #118132 | Alter general log takes a lot of time during upgrade | ||
|---|---|---|---|
| Submitted: | 8 May 2025 8:30 | Modified: | 13 May 2025 16:01 |
| Reporter: | karry zhang (OCA) | Email Updates: | |
| Status: | Verified | Impact on me: | |
| Category: | MySQL Server: Logging | Severity: | S3 (Non-critical) |
| Version: | 8.0 | OS: | Any |
| Assigned to: | CPU Architecture: | Any | |
| Tags: | Contribution | ||
[8 May 2025 8:30]
karry zhang
[12 May 2025 6:04]
karry zhang
Hello, Verification Team, this is my patch. (*) I confirm the code being submitted is offered under the terms of the OCA, and that I am authorized to contribute it.
Contribution: fix.txt (text/plain), 2.98 KiB.
[13 May 2025 16:01]
MySQL Verification Team
Hello karry zhang, Thank you for the report and contribution. regards, Umesh
[30 Mar 5:56]
Tarang Ranpara
Feasibility Review: The upgrade script alters mysql.general_log twice in a row (scripts/mysql_system_tables_fix.sql:239) while the table is defined as a CSV log table (scripts/mysql_system_tables.sql:355). CSV forces every ALTER TABLE to copy the full file, so with gigabyte-scale logs we copy the data twice and stall the upgrade; that's the core problem. From first principles, the fastest possible upgrade path is to: (a) avoid touching the table unless its shape diverges from the desired definition. (b) if we must touch it, do the entire transformation in one pass so we pay for at most one copy. Patch Assessment: The diff collapses the two ALTER TABLE statements into one and introduces a metadata check that inspects the six columns we care about in INFORMATION_SCHEMA.COLUMNS; only if any column deviates do we prepare and execute the ALTER. TL;DR: Logically correct. We'll merge if it shows performance gains during the upgrade process.
