summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMarko Mäkelä <marko.makela@mariadb.com>2020-05-19 10:21:16 +0300
committerMarko Mäkelä <marko.makela@mariadb.com>2020-05-19 10:42:56 +0300
commitc93f8aca656b897d0d5ce6d94196662a4161ad38 (patch)
tree606d26a8d74ff221d28b365fc2585bab18f8514b
parent141cf43e61d262ac5c0d0c031f8585c02ef7d0fe (diff)
downloadmariadb-git-c93f8aca656b897d0d5ce6d94196662a4161ad38.tar.gz
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.
-rw-r--r--storage/innobase/lock/lock0lock.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/storage/innobase/lock/lock0lock.cc b/storage/innobase/lock/lock0lock.cc
index 6e18d24a4d3..11c080066d6 100644
--- a/storage/innobase/lock/lock0lock.cc
+++ b/storage/innobase/lock/lock0lock.cc
@@ -6636,7 +6636,8 @@ lock_table_locks_lookup(
ut_a(lock->trx == trx);
if (lock_get_type_low(lock) == LOCK_REC) {
- ut_ad(!dict_index_is_online_ddl(lock->index)
+ ut_ad(lock->index->online_status
+ != ONLINE_INDEX_CREATION
|| dict_index_is_clust(lock->index));
if (lock->index->table == table) {
break;