[MDEV-28706] ALTER TABLE ... FORCE harvests 1879: Upgrade index name failed, Created: 2022-05-31  Updated: 2023-09-19  Resolved: 2022-06-30

Status: Closed
Project: MariaDB Server
Component/s: Full-text Search, Storage Engine - InnoDB
Affects Version/s: 10.6.9
Fix Version/s: 10.3.36, 10.4.26, 10.5.17, 10.6.9

Type: Bug Priority: Major
Reporter: Matthias Leich Assignee: Thirunarayanan Balathandayuthapani
Resolution: Fixed Votes: 0
Labels: affects-tests, rr-profile

Issue Links:
Blocks
blocks MDEV-18361 row0log.cc:3057: dberr_t row_log_tabl... Closed
Relates
relates to MDEV-18867 Long Time to Stop and Start Closed

 Description   

origin/bb-10.6-MDEV-13542 a8421f9011857b2653531093d0abf75510e16d7e 2022-05-25T13:42:59+03:00
Per Marko: The problem is around fulltext indexes and not specific to the development tree used.
 
Scenario:
1. Start the server and load some initial data.
2. Several sessions run a DDL/DML mix
3. During 2. is ongoing the server gets intentional killed (SIGSEGV) 
4. Restart attempt with success
5. Check user defined tables 
     CHECK TABLE `test`.`table400_innodb_int_autoinc` EXTENDED.
     ANALYZE TABLE `test`.`table400_innodb_int_autoinc`.
     OPTIMIZE TABLE `test`.`table400_innodb_int_autoinc`.
      REPAIR TABLE `test`.`table400_innodb_int_autoinc` EXTENDED.
      ALTER TABLE `test`.`table400_innodb_int_autoinc` FORCE.
      The last command  harvests 1879:
       Upgrade index name failed, please use create index(alter table)
      algorithm copy to rebuild index.
6. RQG reacts with killing the DB server.
 
RQG
====
# git clone https://github.com/mleich1/rqg --branch experimental RQG
#
# GIT_SHOW: HEAD -> experimental, origin/experimental cde044cdbbf79770db78ee95394eb31fd65a1b6f 2022-05-17T16:38:21+02:00
# rqg.pl  : Version 4.0.5 (2022-04)
#
# $RQG_HOME/rqg.pl \
# --gendata=conf/engines/innodb/full_text_search.zz \
# --max_gd_duration=1200 \
# --short_column_names \
# --grammar=conf/engines/innodb/full_text_search.yy \
# --redefine=conf/mariadb/alter_table.yy \
# --redefine=conf/mariadb/instant_add.yy \
# --redefine=conf/mariadb/modules/alter_table_columns.yy \
# --redefine=conf/mariadb/bulk_insert.yy \
# --redefine=conf/mariadb/modules/foreign_keys.yy \
# --redefine=conf/mariadb/modules/locks.yy \
# --redefine=conf/mariadb/modules/sql_mode.yy \
# --redefine=conf/mariadb/redefine_temporary_tables.yy \
# --redefine=conf/mariadb/versioning.yy \
# --redefine=conf/mariadb/sequences.yy \
# --mysqld=--innodb_file_per_table=0 \
# --mysqld=--loose-innodb_lock_schedule_algorithm=fcfs \
# --mysqld=--loose-idle_write_transaction_timeout=0 \
# --mysqld=--loose-idle_transaction_timeout=0 \
# --mysqld=--loose-idle_readonly_transaction_timeout=0 \
# --mysqld=--connect_timeout=60 \
# --mysqld=--interactive_timeout=28800 \
# --mysqld=--slave_net_timeout=60 \
# --mysqld=--net_read_timeout=30 \
# --mysqld=--net_write_timeout=60 \
# --mysqld=--loose-table_lock_wait_timeout=50 \
# --mysqld=--wait_timeout=28800 \
# --mysqld=--lock-wait-timeout=86400 \
# --mysqld=--innodb-lock-wait-timeout=50 \
# --no-mask \
# --queries=10000000 \
# --seed=random \
# --reporters=Backtrace \
# --reporters=ErrorLog \
# --reporters=Deadlock1 \
# --validators=None \
# --mysqld=--log_output=none \
# --mysqld=--log_bin_trust_function_creators=1 \
# --mysqld=--loose-debug_assert_on_not_freed_memory=0 \
# --engine=InnoDB \
# --restart_timeout=360 \
# --mysqld=--plugin-load-add=file_key_management.so \
# --mysqld=--loose-file-key-management-filename=$RQG_HOME/conf/mariadb/encryption_keys.txt \
# --mysqld=--plugin-load-add=provider_lzo.so \
# --mysqld=--plugin-load-add=provider_bzip2.so \
# --mysqld=--plugin-load-add=provider_lzma.so \
# --mysqld=--plugin-load-add=provider_snappy.so \
# --mysqld=--plugin-load-add=provider_lz4.so \
# --duration=300 \
# --mysqld=--loose-innodb_fatal_semaphore_wait_threshold=300 \
# --mysqld=--loose-innodb_read_only_compressed=OFF \
# --reporters=CrashRecovery1 \
# --duration=100 \
# --mysqld=--innodb_stats_persistent=on \
# --mysqld=--innodb_adaptive_hash_index=off \
# --mysqld=--log-bin \
# --mysqld=--sync-binlog=1 \
# --mysqld=--loose-innodb_evict_tables_on_commit_debug=on \
# --mysqld=--loose-max-statement-time=30 \
# --threads=9 \
# --mysqld=--innodb-use-native-aio=0 \
# --mysqld=--loose-gdb \
# --mysqld=--loose-debug-gdb \
# --rr=Extended \
# --rr_options=--chaos --wait \
# --mysqld=--innodb_rollback_on_timeout=OFF \
# --mysqld=--innodb_page_size=16K \
# --mysqld=--innodb-buffer-pool-size=256M \
# --no_mask \
# <local settings>
 
pluto:/data/results/1653478004/TBR-1513/dev/shm/rqg/1653478004/266/1/rr
Error pattern for RQG
[ 'TBR-1513', 'INFO: Reporter \'CrashRecovery1\': Attempting database recovery using the server.+INFO: Reporter \'CrashRecovery1\': Executing ALTER TABLE .{1,70} FORCE.+ERROR: ALTER TABLE .{1,70} FORCE harvested 1879: Upgrade index name failed.+\[Note\] InnoDB: Starting crash recovery from checkpoint LSN.+\[Note\] .{1,200}mysqld: ready for connections.+RESULT: The RQG run ended with status STATUS_RECOVERY_FAILURE' ],
 



 Comments   
Comment by Marko Mäkelä [ 2022-05-31 ]

I think that the ER_INNODB_FT_AUX_NOT_HEX_ID should have been removed as part of MDEV-18867.

Comment by Thirunarayanan Balathandayuthapani [ 2022-06-07 ]

--source include/have_innodb.inc
set global innodb_file_per_table=0;
create table t1(f1 char(100), f2 char(100),
                fulltext(f1))row_format=redundant, engine=innodb;
insert into t1 values("mysql", "innodb");
--source include/restart_mysqld.inc
alter table t1 add fulltext(f2), algorithm=inplace;
show create table t1;
drop table t1;

Above test case fails with the above failure. Problem is that InnoDB fails to load flags2 while loading the table because of redundant system tablespace.

Comment by Matthias Leich [ 2022-06-14 ]

origin/10.6 e11b82f8f5c7006f7bf271f0db8e8c514cc9baad 2022-06-09T13:34:52+03:00
+ Thiru's patch for MDEV-28706 performed well in RQG testing.

Comment by Marko Mäkelä [ 2022-06-28 ]

The patch looks OK to me. I suppose that this only affects ROW_FORMAT=REDUNDANT tables, where we could not trust to read some previously unused SYS_TABLES column that was repurposed to store table flags.

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