[MDEV-24452] ALTER TABLE event take infinite time which for example breaks mysql_upgrade Created: 2020-12-20 Updated: 2021-04-19 Resolved: 2021-01-21 |
|
| Status: | Closed |
| Project: | MariaDB Server |
| Component/s: | Events, Locking |
| Affects Version/s: | 10.5.8, 10.5 |
| Fix Version/s: | 10.5.9 |
| Type: | Bug | Priority: | Blocker |
| Reporter: | naox | Assignee: | Michael Widenius |
| Resolution: | Fixed | Votes: | 0 |
| Labels: | None | ||
| Issue Links: |
|
||||||||||||||||
| Description |
|
Upgrade from mariadb 10.3 to 10.5.8 |
| Comments |
| Comment by Elena Stepanova [ 2021-01-12 ] | |||||||||||||||||||||||||||||||||
|
Thanks for the report. Starting from this commit in 10.5
after the first event is executed, the server acquires and keeps holding backup/metadata locks on mysql.event table – seemingly forever, as long as the event scheduler is enabled. It doesn't prevent further creation of events, but it blocks DDL on the table, hence the problem. I cannot tell whether this new locking routine was intentional; but even if it is, mysql_upgrade should somehow take it into account, maybe temporarily disable event_scheduler while it handles system tables. The test case below is dirty and shouldn't go as is into the regression suite, it's just a demonstration of the problem.
| |||||||||||||||||||||||||||||||||
| Comment by Sergei Golubchik [ 2021-01-13 ] | |||||||||||||||||||||||||||||||||
|
I agree it's a serious bug. event scheduler should close the transaction after reading the event table. | |||||||||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2021-01-21 ] | |||||||||||||||||||||||||||||||||
|
The problem was that update_timing_fields_for_event() didn't release all MDL locks it took. | |||||||||||||||||||||||||||||||||
| Comment by Michael Widenius [ 2021-01-21 ] | |||||||||||||||||||||||||||||||||
|
Fix pushed |