Skip to content

Commit c93f8ac

Browse files
committed
MDEV-22618 Assertion !dict_index_is_online_ddl ... in lock_table_locks_lookup
lock_table_locks_lookup(): Relax the assertion. Locks must not exist while online secondary index creation is in progress. However, if CREATE UNIQUE INDEX has not been committed yet, but the index creation has been completed, concurrent DML transactions may acquire record locks on the index. Furthermore, such concurrent DML may cause duplicate key violation, causing the DDL operation to be rolled back. After that, the online_status may be ONLINE_INDEX_ABORTED or ONLINE_INDEX_ABORTED_DROPPED. So, the debug assertion may only forbid the state ONLINE_INDEX_CREATION.
1 parent 141cf43 commit c93f8ac

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

storage/innobase/lock/lock0lock.cc

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6636,7 +6636,8 @@ lock_table_locks_lookup(
66366636
ut_a(lock->trx == trx);
66376637

66386638
if (lock_get_type_low(lock) == LOCK_REC) {
6639-
ut_ad(!dict_index_is_online_ddl(lock->index)
6639+
ut_ad(lock->index->online_status
6640+
!= ONLINE_INDEX_CREATION
66406641
|| dict_index_is_clust(lock->index));
66416642
if (lock->index->table == table) {
66426643
break;

0 commit comments

Comments
 (0)