WL#5470: DDL locking: SW lock should have higher priority than SNRW if requester has SR lock
Affects: Server-5.6 — Status: Un-Assigned — Priority: Medium
Change priorities so that a pending MDL_SHARED_WRITE lock has a higher priority than MDL_SHARED_NO_READ_WRITE if the requester has MDL_SHARED_READ. This would allow transactions to complete, rather than abort on deadlock, despite a pending DDL on the table. Example: con1: begin; con1: select * from t1; con2: lock table t1 ... -- or RENAME, TRUNCATE, CREATE/DROP TRIGGER, OPTIMIZE, ANALYZE, blocks on shared lock con1: update t1 set a=3; <-- currently produces ER_LOCK_DEADLOCK.
Consider making all lock upgrades higher priority than lock acquisitions (a fairly simple implementation).
Copyright (c) 2000, 2017, Oracle Corporation and/or its affiliates. All rights reserved.