mirror of
https://github.com/MariaDB/server.git
synced 2025-02-02 12:01:42 +01:00
branches/zip: Fast index creation: Clarify why lock waits may occur in
row_merge_lock_table(). ha_innobase::final_drop_index(): Set the dictionary operation mode to TRX_DICT_OP_INDEX_MAY_WAIT for the duration of the row_merge_lock_table() call.
This commit is contained in:
parent
da1e0d7f1a
commit
6690972b6c
1 changed files with 10 additions and 3 deletions
|
@ -701,7 +701,9 @@ err_exit:
|
||||||
|
|
||||||
/* Flag this transaction as a dictionary operation, so that
|
/* Flag this transaction as a dictionary operation, so that
|
||||||
the data dictionary will be locked in crash recovery. Prevent
|
the data dictionary will be locked in crash recovery. Prevent
|
||||||
warnings if row_merge_lock_table() results in a lock wait. */
|
warnings if row_merge_lock_table() results in a lock wait,
|
||||||
|
i.e., when another transaction is holding a conflicting lock
|
||||||
|
on the table, e.g., because of SELECT ... FOR UPDATE. */
|
||||||
trx_set_dict_operation(trx, TRX_DICT_OP_INDEX_MAY_WAIT);
|
trx_set_dict_operation(trx, TRX_DICT_OP_INDEX_MAY_WAIT);
|
||||||
|
|
||||||
/* Acquire a lock on the table before creating any indexes. */
|
/* Acquire a lock on the table before creating any indexes. */
|
||||||
|
@ -1095,8 +1097,11 @@ ha_innobase::final_drop_index(
|
||||||
row_mysql_lock_data_dictionary(trx);
|
row_mysql_lock_data_dictionary(trx);
|
||||||
|
|
||||||
/* Flag this transaction as a dictionary operation, so that
|
/* Flag this transaction as a dictionary operation, so that
|
||||||
the data dictionary will be locked in crash recovery. */
|
the data dictionary will be locked in crash recovery. Prevent
|
||||||
trx_set_dict_operation(trx, TRX_DICT_OP_INDEX);
|
warnings if row_merge_lock_table() results in a lock wait,
|
||||||
|
i.e., when another transaction is holding a conflicting lock
|
||||||
|
on the table, e.g., because of SELECT ... FOR UPDATE. */
|
||||||
|
trx_set_dict_operation(trx, TRX_DICT_OP_INDEX_MAY_WAIT);
|
||||||
|
|
||||||
/* Lock the table exclusively, to ensure that no active
|
/* Lock the table exclusively, to ensure that no active
|
||||||
transaction depends on an index that is being dropped. */
|
transaction depends on an index that is being dropped. */
|
||||||
|
@ -1109,6 +1114,8 @@ ha_innobase::final_drop_index(
|
||||||
goto func_exit;
|
goto func_exit;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
trx_set_dict_operation(trx, TRX_DICT_OP_INDEX);
|
||||||
|
|
||||||
index = dict_table_get_first_index(prebuilt->table);
|
index = dict_table_get_first_index(prebuilt->table);
|
||||||
|
|
||||||
while (index) {
|
while (index) {
|
||||||
|
|
Loading…
Add table
Reference in a new issue