Bug #59134 | DDL hang on ALTER TABLE in 5.5.8, but not in 5.1, 5.0, or 4.1 | ||
---|---|---|---|
Submitted: | 23 Dec 2010 15:11 | Modified: | 2 Jun 2015 7:56 |
Reporter: | Justin Cranford | Email Updates: | |
Status: | Can't repeat | Impact on me: | |
Category: | MySQL Server: DDL | Severity: | S4 (Feature request) |
Version: | 5.5 | OS: | Windows |
Assigned to: | CPU Architecture: | Any |
[23 Dec 2010 15:11]
Justin Cranford
[23 Dec 2010 16:26]
Valeriy Kravchuk
I think this manual page, http://dev.mysql.com/doc/refman/5.5/en/metadata-locking.html, explains change that happened in 5.5.x, and explains the reasons for it. Please, check.
[23 Dec 2010 18:54]
Justin Cranford
That new 5.5 manual describes the exact behaviour I found. Thanks. Based on this new information, I changed the severity from S2 (serious) to S4 (feature request). I still have a concern though, and a suggestion for an enhancement. Is the table metadata lock configurable? After all, we are talking about a single, row-level, read-only, DML statement blocking *all* DDL statements. What this means is a complete system test will now be required to validation our product on MySQL 5.5. There was nothing in the release notes to indicate this would be necessary, but the devil is in the details. At the very least, you should consider an enhancement to make the "table metadata locking" more granular. In the example I provided, the two statements are orthagonal (no overlap). It definitely makes sense to block on *some* DDL statements, but not *all*. My concern stems somewhat from a similar experience with validating DB2 9.1 and 9.5 for the same product. We had to abandon support for those versions because table level locks like this were incompatible with the product. Only the Oracle-style locking in 9.7 allowed us to support any version of DB2 at all. In that particular case, a row-level UPDATE in DB2 9.1/9.5 would block all read operations in other transactions. In particular, the code was trying to read MAX(id) in a different thread. That value should be in the table's metadata, but the transaction was blocked by another thread holding a row-level exclusive lock. It was not even updating the id column, so the statements were orthagonal. Anyway, I would put this new MySQL 5.5.3 behaviour is in the same category. It could definitely lead to some unexpected problems. Anyway, getting back to the point about configuration. If this behaviour change is for the binary log only, what about the case where the binary log is turned off. The binary log is only used for replication and restore, but those features are not always required. Perhaps the metadata table lock should only be used if-and-only-if the binary log is turned on? In summary, please consider the following enhancements for MySQL 5.5... 1) More granular metatable locking to avoid blocking orthagonal access, and 2) Configurable metadata table lock depending (only if binary log turned on)
[24 Dec 2010 9:21]
MySQL Verification Team
does it timeout after --lock_wait_timeout expires?
[27 Jan 2011 11:42]
Dmitry Lenev
Hello Justin! Regarding your suggestions: "1) More granular metatable locking to avoid blocking orthagonal access" Currently metadata locks have table-level granularity. So open transaction can block only DDL on tables which are used in this transaction. It should not block DDL on unrelated tables. If you observe behavior when open transaction is blocking other, unrelated DDL then it is definitely a bug. Could you please confirm if it is or it is not the case? Thank you in advance! "2) Configurable metadata table lock depending (only if binary log turned on)" Metadata locking is necessary not only because of binary logging. It is also simplifies storage engines implementation and InnoDB in particular (it can rely on the fact that table used by some transaction won't be dropped while transaction is active).
[28 Feb 2011 0:00]
Bugs System
No feedback was provided for this bug for over a month, so it is being suspended automatically. If you are able to provide the information that was originally requested, please do so and change the status of the bug back to "Open".