[MDEV-28456] Assert ut_ad(!index == (err != DB_SUCCESS)) in row_create_index_for_mysql() Created: 2022-05-02  Updated: 2023-07-18

Status: Open
Project: MariaDB Server
Component/s: Storage Engine - InnoDB
Affects Version/s: 10.6
Fix Version/s: 10.6

Type: Bug Priority: Major
Reporter: Thirunarayanan Balathandayuthapani Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None


 Description   

In row_create_index_for_mysql(), InnoDB have too strict saying
ut_ad(!index == (err != DB_SUCCESS)), node->index was assigned in ind_create_graph_create(). While inserting the entry into
sys_indexes, InnoDB can run out of memory, and it could lead to failure DB_LOCK_TABLE_FULL error. Assert
ut_ad(!index == (err != DB_SUCCESS)); can fail because of this issue.

Pasting the stack trace where we do set DB_LOCK_TABLE_FULL error:

 
 
(rr) where
#0  row_ins_clust_index_entry_low (flags=0, mode=33, index=0x616000036a08, n_uniq=2, entry=0x616012806b08, n_ext=0, thr=0x61a00023ea90)
    at /data/Server/bb-10.6-thiru/storage/innobase/row/row0ins.cc:2742
#1  0x00005577885f04c4 in row_ins_clust_index_entry (index=0x616000036a08, entry=0x616012806b08, thr=0x61a00023ea90, n_ext=0)
    at /data/Server/bb-10.6-thiru/storage/innobase/row/row0ins.cc:3154
#2  0x00005577885f0c05 in row_ins_index_entry (index=0x616000036a08, entry=0x616012806b08, thr=0x61a00023ea90)
    at /data/Server/bb-10.6-thiru/storage/innobase/row/row0ins.cc:3263
#3  0x00005577885f1c75 in row_ins_index_entry_step (node=0x6160128074a0, thr=0x61a00023ea90)
    at /data/Server/bb-10.6-thiru/storage/innobase/row/row0ins.cc:3431
#4  0x00005577885f26c9 in row_ins (node=0x6160128074a0, thr=0x61a00023ea90) at /data/Server/bb-10.6-thiru/storage/innobase/row/row0ins.cc:3578
#5  0x00005577885f37f9 in row_ins_step (thr=0x61a00023ea90) at /data/Server/bb-10.6-thiru/storage/innobase/row/row0ins.cc:3724
#6  0x000055778856962b in que_thr_step (thr=0x61a00023ea90) at /data/Server/bb-10.6-thiru/storage/innobase/que/que0que.cc:632
#7  0x0000557788569b80 in que_run_threads_low (thr=0x61a00023ea90) at /data/Server/bb-10.6-thiru/storage/innobase/que/que0que.cc:709
#8  0x0000557788569d22 in que_run_threads (thr=0x61a00023ea90) at /data/Server/bb-10.6-thiru/storage/innobase/que/que0que.cc:729
#9  0x00005577886392c8 in row_create_index_for_mysql (index=0x616012805008, trx=0x270b25247440, field_lengths=0x603000046288, 
    mode=FIL_ENCRYPTION_DEFAULT, key_id=1) at /data/Server/bb-10.6-thiru/storage/innobase/row/row0mysql.cc:2249
#10 0x00005577882f9648 in create_index (trx=0x270b25247440, form=0x478913eb88e0, table=0x618000067908, key_num=1)
    at /data/Server/bb-10.6-thiru/storage/innobase/handler/ha_innodb.cc:11060
#11 0x00005577882c0a5c in create_table_info_t::create_table (this=0x478913eb8270, create_fk=true)
    at /data/Server/bb-10.6-thiru/storage/innobase/handler/ha_innodb.cc:12803
#12 0x00005577882fb6f0 in ha_innobase::create (this=0x61d00088a4b8, name=0x478913ebbbdf "./test/#sql-alter-3bb6c4-22", form=0x478913eb88e0, 
    create_info=0x478913ebc650, file_per_table=true, trx=0x270b25247440)
    at /data/Server/bb-10.6-thiru/storage/innobase/handler/ha_innodb.cc:13274
#13 0x00005577882c25b0 in ha_innobase::create (this=0x61d00088a4b8, name=0x478913ebbbdf "./test/#sql-alter-3bb6c4-22", form=0x478913eb88e0, 
    create_info=0x478913ebc650) at /data/Server/bb-10.6-thiru/storage/innobase/handler/ha_innodb.cc:13312
#14 0x00005577879c3cfc in handler::ha_create (this=0x61d00088a4b8, name=0x478913ebbbdf "./test/#sql-alter-3bb6c4-22", form=0x478913eb88e0, 
    info_arg=0x478913ebc650) at /data/Server/bb-10.6-thiru/sql/handler.cc:5446
#15 0x00005577879c7f73 in ha_create_table (thd=0x62b00012d218, path=0x478913ebbbdf "./test/#sql-alter-3bb6c4-22", db=0x62b000134ae0 "test", 
    table_name=0x62b0001343a8 "t1", create_info=0x478913ebc650, frm=0x478913eb9830, skip_frm_file=false)
    at /data/Server/bb-10.6-thiru/sql/handler.cc:5911
#16 0x000055778745012f in mysql_alter_table (thd=0x62b00012d218, new_db=0x62b000131c18, new_name=0x62b000132030, create_info=0x478913ebc650, 
    table_list=0x62b0001343f8, alter_info=0x478913ebc520, order_num=0, order=0x0, ignore=false, if_exists=false)
    at /data/Server/bb-10.6-thiru/sql/sql_table.cc:10333
#17 0x00005577875dea62 in Sql_cmd_alter_table::execute (this=0x62b000134c38, thd=0x62b00012d218)
    at /data/Server/bb-10.6-thiru/sql/sql_alter.cc:542
#18 0x00005577871e048e in mysql_execute_command (thd=0x62b00012d218, is_called_from_prepared_stmt=false)
    at /data/Server/bb-10.6-thiru/sql/sql_parse.cc:6012
--Type <RET> for more, q to quit, c to continue without paging--
#19 0x00005577871ec876 in mysql_parse (thd=0x62b00012d218, 
    rawbuf=0x62b000134238 "ALTER TABLE t1 MODIFY COLUMN col1 INT NOT NULL, LOCK = SHARED, ALGORITHM = COPY  /* E_R Thread2 QNO 1553 CON_ID 34 */", length=117, parser_state=0x478913ebdb20) at /data/Server/bb-10.6-thiru/sql/sql_parse.cc:8045
#20 0x00005577871c4c6f in dispatch_command (command=COM_QUERY, thd=0x62b00012d218, 
    packet=0x629000cfd219 " ALTER TABLE t1 MODIFY COLUMN col1 INT NOT NULL, LOCK = SHARED, ALGORITHM = COPY  /* E_R Thread2 QNO 1553 CON_ID 34 */ ", packet_length=119, blocking=true) at /data/Server/bb-10.6-thiru/sql/sql_parse.cc:1912
#21 0x00005577871c1ea5 in do_command (thd=0x62b00012d218, blocking=true) at /data/Server/bb-10.6-thiru/sql/sql_parse.cc:1409
#22 0x00005577875c4e98 in do_handle_one_connection (connect=0x608000003a38, put_in_cache=true)
    at /data/Server/bb-10.6-thiru/sql/sql_connect.cc:1418
#23 0x00005577875c4724 in handle_one_connection (arg=0x6080000033b8) at /data/Server/bb-10.6-thiru/sql/sql_connect.cc:1312
#24 0x00007fe524685609 in start_thread (arg=<optimized out>) at pthread_create.c:477
#25 0x000067183e88f293 in clone () at ../sysdeps/unix/sysv/linux/x86_64/clone.S:95
 
 
(rr) p err
$23 = DB_LOCK_TABLE_FULL

Relaxing the assert could be the simplest solution


Generated at Thu Feb 08 10:00:53 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.