MDL resource held outside TO isolation

Bug #1073220 reported by Teemu Ollakka
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL patches by Codership
Fix Released
Medium
Seppo Jaakola

Bug Description

Regression test for lp:861212 causes inconsistency. The following log snippet reveals that some MDL resources are held outside TOI critical section by locally executed ALTER.

121030 16:36:34 [Note] [Debug] WSREP: galera/src/replicator_smm.cpp:to_isolation_begin():965: Executing TO isolated action: source: 2f58f6ca-229f-11e2-0800-9c24304618ba version: 2 local: 1 state: APPLYING flags: 65 conn_id: 22 trx_id: -1 seqnos (l: 414, g: 7751450, s: 7751437, d: 7751449, ts: 1351607794729079543)
121030 16:36:34 [Note] WSREP: TO BEGIN: 7751450, 2
121030 16:36:34 [Note] WSREP: TO END: 7751450, 2 : ALTER TABLE comm02 DROP COLUMN d
121030 16:36:34 [Note] [Debug] WSREP: galera/src/replicator_smm.cpp:to_isolation_end():991: Done executing TO isolated action: source: 2f58f6ca-229f-11e2-0800-9c24304618ba version: 2 local: 1 state: APPLYING flags: 65 conn_id: 22 trx_id: -1 seqnos (l: 414, g: 7751450, s: 7751437, d: 7751449, ts: 1351607794729079543)
121030 16:36:34 [Note] [Debug] WSREP: galera/src/replicator_smm.cpp:to_isolation_begin():965: Executing TO isolated action: source: 2f58f6ca-229f-11e2-0800-9c24304618ba version: 2 local: 1 state: APPLYING flags: 65 conn_id: 21 trx_id: -1 seqnos (l: 415, g: 7751451, s: 7751438, d: 7751450, ts: 1351607794745565333)
121030 16:36:34 [Note] WSREP: TO BEGIN: 7751451, 2
121030 16:36:34 [Note] WSREP: MDL conflict
request: (21 seqno 7751451 wsrep (2, 1, 0) cmd 3 3 ALTER TABLE comm02 ADD COLUMN (d DATETIME))
granted: (22 seqno 7751450 wsrep (2, 1, 0) cmd 3 3 ALTER TABLE comm02 DROP COLUMN d)
121030 16:36:34 [Note] WSREP: MDL BF-BF conflict
request: (21 seqno 7751451 wsrep (2, 1, 0) cmd 3 3 ALTER TABLE comm02 ADD COLUMN (d DATETIME))
granted: (22 seqno 7751450 wsrep (2, 1, 0) cmd 3 3 ALTER TABLE comm02 DROP COLUMN d)
121030 16:36:34 [Note] WSREP: TO END: 7751450
121030 16:36:34 [Note] WSREP: TO END: 7751451, 2 : ALTER TABLE comm02 ADD COLUMN (d DATETIME)
121030 16:36:34 [Note] [Debug] WSREP: galera/src/replicator_smm.cpp:to_isolation_end():991: Done executing TO isolated action: source: 2f58f6ca-229f-11e2-0800-9c24304618ba version: 2 local: 1 state: APPLYING flags: 65 conn_id: 21 trx_id: -1 seqnos (l: 415, g: 7751451, s: 7751438, d: 7751450, ts: 1351607794745565333)

Changed in codership-mysql:
importance: Undecided → High
status: New → In Progress
assignee: nobody → Teemu Ollakka (teemu-ollakka)
milestone: none → 5.5.28-23.7
Changed in codership-mysql:
status: In Progress → New
assignee: Teemu Ollakka (teemu-ollakka) → nobody
importance: High → Medium
Revision history for this message
Seppo Jaakola (seppo-jaakola) wrote :

regression test lp1073220 can surface reliably inconsistencies in schema level

Changed in codership-mysql:
assignee: nobody → Seppo Jaakola (seppo-jaakola)
Revision history for this message
Seppo Jaakola (seppo-jaakola) wrote :

Problem seems to be that DDL statement can hold MDL, either before TO isolation processing started or after it has ended. This can cause DDL vs DDL conflict over some MDL resource.

Commit in revision: http://bazaar.launchpad.net/~codership/codership-mysql/wsrep-5.5/revision/3814 fixes these race vulnerabilities.

Changed in codership-mysql:
status: New → In Progress
status: In Progress → Fix Committed
Changed in codership-mysql:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.