[MDEV-32964] Debug assert failure in Wsrep patch of row_upd_sec_index_entry Created: 2023-12-07  Updated: 2024-02-05  Resolved: 2024-01-30

Status: Closed
Project: MariaDB Server
Component/s: Galera, Tests
Affects Version/s: 10.4.32
Fix Version/s: 10.4.33, 10.5.24, 10.6.17, 10.11.7, 11.0.5, 11.1.4, 11.2.3, 11.3.2

Type: Bug Priority: Critical
Reporter: Denis Protivensky Assignee: Denis Protivensky
Resolution: Fixed Votes: 0
Labels: None


 Description   

Local abort of an DML operation because of MDL conflict causes debug assert in InnoDB to fire:

2023-12-07 14:33:12 19 [Note] WSREP: MDL conflict·
schema:  test
request: (19    seqno 712   wsrep (toi, exec, committed) cmd 3 3    ALTER TABLE tt_1_fk ADD COLUMN vN252 VARCHAR(11), LOCK=NONE, ALGORITHM=DEFAULT)
granted: (23    seqno -1    wsrep (local, exec, executing) cmd 3 7  DELETE FROM tt_1_fk)
2023-12-07 14:33:12 19 [Note] WSREP: MDL ticket: type: MDL_SHARED_WRITE space: TABLE db: test name: tt_1_fk (Waiting for table metadata lock)
2023-12-07 14:33:12 24 [Note] WSREP: before_rollback_enter
    server: 49c6efec-94f4-11ee-b183-3f81ba368dc3, client: 24, state: exec, mode: local
    trx_id: 4183, seqno: -1, flags: 1
    state: must_abort, bfa_state: executing, error: success, status: 0
    is_sr: 0, frags: 0, frags size: 0, unit: 0, size: 0, counter: 0, log_pos: 0, sr_rb: 0
    own: 1 thread_id: 7fb0bc1f8700
2023-12-07 14:33:12 19 [Note] WSREP: MDL conflict-> BF abort
schema:  test
request: (19    seqno 712   wsrep (toi, exec, committed) cmd 3 3    ALTER TABLE tt_1_fk ADD COLUMN vN252 VARCHAR(11), LOCK=NONE, ALGORITHM=DEFAULT)
granted: (23    seqno -1    wsrep (local, exec, executing) cmd 3 7  DELETE FROM tt_1_fk)
2023-12-07 14:33:12 24 [Note] WSREP: client: 24 txc: 4183 state: must_abort -> aborting
2023-12-07 14:33:12 19 [Note] WSREP: MDL ticket: type: MDL_SHARED_WRITE space: TABLE db: test name: tt_1_fk (Waiting for table metadata lock)
2023-12-07 14:33:12 24 [Note] WSREP: before_rollback_leave
    server: 49c6efec-94f4-11ee-b183-3f81ba368dc3, client: 24, state: exec, mode: local
    trx_id: 4183, seqno: -1, flags: 1
    state: aborting, bfa_state: executing, error: success, status: 0
    is_sr: 0, frags: 0, frags size: 0, unit: 0, size: 0, counter: 0, log_pos: 0, sr_rb: 0
    own: 1 thread_id: 7fb0bc1f8700
2023-12-07 14:33:12 19 [Note] WSREP: Seqno -1 successfully BF aborted 4195 victim_seqno -1
2023-12-07 14:33:12 19 [Note] WSREP: client: 23 txc: 4195 state: executing -> must_abort
2023-12-07 14:33:12 19 [Note] WSREP: wsrep_abort_thd, by: 140397090907904, victim: 140397089679104
2023-12-07 14:33:12 23 [ERROR] WSREP: Foreign key check fail: Operation interrupted on table tt_1_fki0 index test/tt_1_fk query DELETE FROM tt_1_fk
mysqld: /home/denis/dev/mariadb-server-features/storage/innobase/row/row0upd.cc:2509: dberr_t row_upd_sec_index_entry(upd_node_t*, que_thr_t*): Assertion `err == DB_SUCCESS || err == DB_LOCK_W
T@32   : 14:33:12.355455 row_upd: error: handling fatal signal
231207 14:33:12 [ERROR] mysqld got signal 6 ;

Stacktrace:

mysys/stacktrace.c:174(my_print_stacktrace)[0x55b1fa5dea0d]
sql/signal_handler.cc:235(handle_fatal_signal)[0x55b1f9e0d74a]
sigaction.c:0(__restore_rt)[0x7fb0d2650420]
addr2line: DWARF error: section .debug_info is larger than its filesize! (0x93ef57 vs 0x530f28)
/lib/x86_64-linux-gnu/libc.so.6(gsignal+0xcb)[0x7fb0d215600b]
/lib/x86_64-linux-gnu/libc.so.6(abort+0x12b)[0x7fb0d2135859]
/lib/x86_64-linux-gnu/libc.so.6(+0x22729)[0x7fb0d2135729]
/lib/x86_64-linux-gnu/libc.so.6(+0x33fd6)[0x7fb0d2146fd6]
row/row0upd.cc:2577(row_upd_sec_index_entry(upd_node_t*, que_thr_t*))[0x55b1fa33b659]
row/row0upd.cc:2598(row_upd_step(que_thr_t*))[0x55b1fa33bbec]
row/row0mysql.cc:1804(row_update_for_mysql(row_prebuilt_t*))[0x55b1fa2e8234]
handler/ha_innodb.cc:9081(ha_innobase::delete_row(unsigned char const*))[0x55b1fa177904]
sql/handler.cc:6992(handler::ha_delete_row(unsigned char const*))[0x55b1f9e21836]
sql/sql_delete.cc:292(TABLE::delete_row())[0x55b1f9fa8fc8]
sql/sql_delete.cc:826(mysql_delete(THD*, TABLE_LIST*, Item*, SQL_I_List<st_order>*, unsigned long long, unsigned long long, select_result*))[0x55b1f9fa82cd]
sql/sql_parse.cc:4819(mysql_execute_command(THD*))[0x55b1f9b80c27]
sql/sql_parse.cc:8062(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55b1f9b880d4]
sql/sql_class.h:4050(THD::get_stmt_da())[0x55b1f9b88bcf]
sql/sql_parse.cc:1843(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55b1f9b8b302]
sql/sql_parse.cc:1379(do_command(THD*))[0x55b1f9b8ebca]
sql/sql_connect.cc:1419(do_handle_one_connection(CONNECT*))[0x55b1f9cc00ca]
sql/sql_connect.cc:1325(handle_one_connection)[0x55b1f9cc0191]
perfschema/pfs.cc:1872(pfs_spawn_thread)[0x55b1fa103c90]
nptl/pthread_create.c:478(start_thread)[0x7fb0d2644609]
addr2line: DWARF error: section .debug_info is larger than its filesize! (0x93ef57 vs 0x530f28)
/lib/x86_64-linux-gnu/libc.so.6(clone+0x43)[0x7fb0d2232133]



 Comments   
Comment by Denis Protivensky [ 2023-12-07 ]

The issue is that DB_INTERRUPTED is unexpected as the return code from wsrep_row_upd_check_foreign_constraints call.

Comment by Denis Protivensky [ 2023-12-07 ]

The fix: https://github.com/MariaDB/server/pull/2908

Comment by Julius Goryavsky [ 2023-12-20 ]

Thanks, fix merged with head revision: https://github.com/MariaDB/server/commit/ddd8a90812e8ab7675b989696023e0a9966b6409

Comment by Julius Goryavsky [ 2023-12-20 ]

Reopend by request from the Codership - additional correction is required

Comment by Sergei Golubchik [ 2024-01-08 ]

what kind of correction?

Comment by Denis Protivensky [ 2024-01-09 ]

serg I was asked to provide an MTR test for the fix, although the change is trivial and affects debug-only builds. Working on an MTR test will require some time.

Comment by Sergei Golubchik [ 2024-01-30 ]

feel free to work on the test case still, but the fix is pushed and the release is ready, your test case will be in the next release, but I'm closing with the FixVersion of where the actual fix is.

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