Commit graph

2 commits

Author SHA1 Message Date
Ajo Robert
820bf7b1f1 Bug #18075170 SQL NODE RESTART REQUIRED TO
AVOID DEADLOCK AFTER RESTORE

Test Failure Fix.
2015-05-12 20:27:26 +05:30
Ajo Robert
515b2203c5 Bug #18075170 SQL NODE RESTART REQUIRED TO
AVOID DEADLOCK AFTER RESTORE

Analysis
--------
Accessing the restored NDB table in an active multi-statement
transaction was resulting in deadlock found error.

MySQL Server needs to discover metadata of NDB table from
data nodes after table is restored from backup. Metadata
discovery happens on the first access to restored table.
Current code mandates this statement to be the first one
in the transaction. This is because discover needs exclusive
metadata lock on the table. Lock upgrade at this point can
lead to MDL deadlock and the code was written at the time
when MDL deadlock detector was not present. In case when
discovery attempted in the statement other than the first
one in transaction ER_LOCK_DEADLOCK error is reported
pessimistically.

Fix:
---
Removed the constraint as any potential deadlock will be
handled by deadlock detector. Also changed code in discover
to keep metadata locks of active transaction.

Same issue was present in table auto repair scenario. Same
fix is added in repair path also.
2015-05-11 16:05:50 +05:30
Renamed from mysql-test/r/merge_recover.result (Browse further)