row0undo.c:

  Partial fix to a hang introduced in CREATE TABLE in the push last night
parent 93b301ba
...@@ -253,9 +253,17 @@ row_undo( ...@@ -253,9 +253,17 @@ row_undo(
} }
} }
/* Prevent DROP TABLE etc. while we are rolling back this row */ /* Prevent DROP TABLE etc. while we are rolling back this row.
If we are doing a TABLE CREATE or some other dictionary operation,
then we already have dict_operation_lock locked in x-mode. Do not
try to lock again in s-mode, because that would cause a hang.
TODO: keep track when trx exactly has the latch locked!!!
TODO: trx->dict_operation tells it only in some cases!!! */
rw_lock_s_lock(&dict_operation_lock); if (!trx->dict_operation) {
rw_lock_s_lock(&dict_operation_lock);
}
if (node->state == UNDO_NODE_INSERT) { if (node->state == UNDO_NODE_INSERT) {
...@@ -267,7 +275,10 @@ row_undo( ...@@ -267,7 +275,10 @@ row_undo(
err = row_undo_mod(node, thr); err = row_undo_mod(node, thr);
} }
rw_lock_s_unlock(&dict_operation_lock); if (!trx->dict_operation) {
rw_lock_s_unlock(&dict_operation_lock);
}
/* Do some cleanup */ /* Do some cleanup */
btr_pcur_close(&(node->pcur)); btr_pcur_close(&(node->pcur));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment