MDEV-29342 Assertion failure in file que0que.cc line 728

- During shutdown, InnoDB fts fails to update synced doc id
when there is only one doc id about to sync. While starting
the server, InnoDB fetches the already synced doc id from
config table. In the subsequent sync operation, InnoDB fails
with DB_DUPLICATE_KEY error.
This commit is contained in:
Thirunarayanan Balathandayuthapani 2022-08-29 22:54:25 +05:30
parent f501f815bc
commit ac49b7a845
3 changed files with 29 additions and 1 deletions

View file

@ -5,3 +5,16 @@ set debug_dbug="+d,fts_instrument_sync_request";
INSERT INTO mdev21563 VALUES('This is a test');
ALTER TABLE mdev21563 DISCARD TABLESPACE;
DROP TABLE mdev21563;
#
# MDEV-29342 Assertion failure in file que0que.cc line 728
#
CREATE TABLE t1(f1 CHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
INSERT INTO t1 VALUES('mysql'), ('innodb');
set debug_dbug="+d,fts_instrument_sync_debug";
INSERT INTO t1 VALUES('test');
set debug_dbug="-d,fts_instrument_sync_debug";
INSERT INTO t1 VALUES('This is a fts issue');
set debug_dbug="+d,fts_instrument_sync_debug";
UPDATE t1 SET f1="mariadb";
set debug_dbug="-d,fts_instrument_sync_debug";
DROP TABLE t1;

View file

@ -10,3 +10,18 @@ INSERT INTO mdev21563 VALUES('This is a test');
ALTER TABLE mdev21563 DISCARD TABLESPACE;
--source include/restart_mysqld.inc
DROP TABLE mdev21563;
--echo #
--echo # MDEV-29342 Assertion failure in file que0que.cc line 728
--echo #
CREATE TABLE t1(f1 CHAR(100), FULLTEXT idx(f1))ENGINE=InnoDB;
INSERT INTO t1 VALUES('mysql'), ('innodb');
set debug_dbug="+d,fts_instrument_sync_debug";
INSERT INTO t1 VALUES('test');
set debug_dbug="-d,fts_instrument_sync_debug";
INSERT INTO t1 VALUES('This is a fts issue');
--source include/restart_mysqld.inc
set debug_dbug="+d,fts_instrument_sync_debug";
UPDATE t1 SET f1="mariadb";
set debug_dbug="-d,fts_instrument_sync_debug";
DROP TABLE t1;

View file

@ -2667,7 +2667,7 @@ retry:
}
mutex_exit(&cache->doc_id_lock);
if (cmp_doc_id > *doc_id) {
if (cmp_doc_id && cmp_doc_id >= *doc_id) {
error = fts_update_sync_doc_id(
table, cache->synced_doc_id, trx);
}