[MDEV-25573] MariaDB and all slaves crash after INSERT to utf8_bin column(index) Created: 2021-04-30  Updated: 2021-05-03

Status: Open
Project: MariaDB Server
Component/s: None
Affects Version/s: 10.4.18
Fix Version/s: None

Type: Bug Priority: Critical
Reporter: Jozef Kováč Assignee: Unassigned
Resolution: Unresolved Votes: 0
Labels: None
Environment:

Ubuntu 18.4.5 & RHEL 8.3


Attachments: File mariadb.log    

 Description   

Looks like some INSERT or index update on column with utf8_bin cause server crash, changing collation to utf8 resolved issue.

Some slaves was unable to start at all after crash, during crash recovery applying INSERT from relay_log with cause crash. Setting replicate-ignore-table and manually fixing any inconsistencies helps.

Replication also stops with: Error 'Duplicate entry '1|26405' for key 'store_ids_code_uid'' on query. Default database: 'd_w3lngeyumys5ph'. Query: 'INSERT INTO `pohoda_stocks` SET `store_ids_code_uid` = '1|26405', `store_ids` = '1', `code` = '26405', `count` = '10', `countReceivedOrders` = '0', `reservation` = '0''

Again skip error 1062 until all events are applied help.



 Comments   
Comment by Alice Sherepa [ 2021-04-30 ]

from the log:

Apr 29 13:33:40 mysqld: 2021-04-29 13:33:40 96469 [Note] Start binlog_dump to slave_server(24), pos(binary_log.006270, 129953678), using_gtid(1), gtid('1-13-955835481,2-14-13149585,3-15-2180204745')
Apr 29 13:34:00 mysqld: 2021-04-29 13:34:00 0x7f650cfde700  InnoDB: Assertion failure in file /home/buildbot/buildbot/build/storage/innobase/row/row0ins.cc line 2189
Apr 29 13:34:00 mysqld: InnoDB: Failing assertion: cmp < 0
 
Apr 29 13:34:00 mysqld: 210429 13:34:00 [ERROR] mysqld got signal 6 ;
 
Apr 29 13:34:05 mysqld: /lib/x86_64-linux-gnu/libc.so.6(gsignal+0xc7)[0x7f6b5ba88fb7]
Apr 29 13:34:06 mysqld: /lib/x86_64-linux-gnu/libc.so.6(abort+0x141)[0x7f6b5ba8a921]
Apr 29 13:34:08 mysqld: ut/ut0rbt.cc:218(rbt_tree_add_child(ib_rbt_t const*, ib_rbt_bound_t*, ib_rbt_node_t*) [clone .isra.4] [clone .part.5])[0x55735b72f0e6]
Apr 29 13:34:08 mysqld: row/row0ins.cc:3029(row_ins_sec_index_entry_low(unsigned long, unsigned long, dict_index_t*, mem_block_info_t*, mem_block_info_t*, dtuple_t*, unsigned long, que_thr_t*))[0x55735bcd84ea]
Apr 29 13:34:08 mysqld: row/row0ins.cc:3294(row_ins_sec_index_entry(dict_index_t*, dtuple_t*, que_thr_t*, bool))[0x55735bcd8793]
Apr 29 13:34:08 mysqld: row/row0ins.cc:3666(row_ins)[0x55735bcd8c8a]
Apr 29 13:34:08 mysqld: row/row0mysql.cc:1426(row_insert_for_mysql(unsigned char const*, row_prebuilt_t*, ins_mode_t))[0x55735bceb5ff]
Apr 29 13:34:08 mysqld: handler/ha_innodb.cc:8000(ha_innobase::write_row(unsigned char const*))[0x55735bc2a3b5]
Apr 29 13:34:08 mysqld: sql/handler.cc:6755(handler::ha_write_row(unsigned char const*))[0x55735ba4125f]
Apr 29 13:34:08 mysqld: sql/sql_insert.cc:2060(write_record(THD*, TABLE*, st_copy_info*))[0x55735b7f3a9a]
Apr 29 13:34:08 mysqld: sql/sql_insert.cc:1078(mysql_insert(THD*, TABLE_LIST*, List<Item>&, List<List<Item> >&, List<Item>&, List<Item>&, enum_duplicates, bool))[0x55735b7fa39b]
Apr 29 13:34:08 mysqld: sql/sql_parse.cc:4574(mysql_execute_command(THD*))[0x55735b829457]
Apr 29 13:34:08 mysqld: sql/sql_parse.cc:7959(mysql_parse(THD*, char*, unsigned int, Parser_state*, bool, bool))[0x55735b82ecf2]
Apr 29 13:34:08 mysqld: sql/sql_parse.cc:1917(dispatch_command(enum_server_command, THD*, char*, unsigned int, bool, bool))[0x55735b830e2a]
Apr 29 13:34:08 mysqld: sql/sql_parse.cc:1374(do_command(THD*))[0x55735b832422]
Apr 29 13:34:08 mysqld: sql/sql_connect.cc:1412(do_handle_one_connection(CONNECT*))[0x55735b911cda]
Apr 29 13:34:08 mysqld: sql/sql_connect.cc:1318(handle_one_connection)[0x55735b911dbd]
Apr 29 13:34:09 mysqld: /lib/x86_64-linux-gnu/libpthread.so.0(+0x76db)[0x7f6b5c9756db]
Apr 29 13:34:12 mysqld: /lib/x86_64-linux-gnu/libc.so.6(clone+0x3f)[0x7f6b5bb6b71f]
 
Apr 29 13:34:12 mysqld: Query (0x7f6338010100): INSERT INTO `pohoda_stocks` SET `store_ids_code_uid` = '7|00104P_Veľkosť_M', `store_ids` = '7', `code` = '00104P_Veľkosť_M', `count` = '0', `countReceivedOrders` = '0', `reservation` = '0'

Comment by Sergei Golubchik [ 2021-04-30 ]

what's the structure of the affected table? What does SHOW CREATE TABLE pohoda_stocks say?

Comment by Jozef Kováč [ 2021-05-03 ]

this was second time for different table, but:

CREATE TABLE `pohoda_stocks` (
`store_ids_code_uid` varchar(85) COLLATE 'utf8_bin' NOT NULL,
`store_ids` varchar(20) NOT NULL,
`code` varchar(64) NOT NULL,
`count` int(9) NOT NULL DEFAULT 0,
`countReceivedOrders` int(9) NOT NULL DEFAULT 0,
`reservation` int(9) NOT NULL DEFAULT 0,
`countIssuedOrders` int(9) NOT NULL DEFAULT 0,
`_id` int(11) NOT NULL AUTO_INCREMENT,
PRIMARY KEY (`_id`),
UNIQUE KEY `store_ids_code_uid` (`store_ids_code_uid`)
) DEFAULT CHARSET=utf8;

Generated at Thu Feb 08 09:38:43 UTC 2024 using Jira 8.20.16#820016-sha1:9d11dbea5f4be3d4cc21f03a88dd11d8c8687422.