mariadb/storage/xtradb/include
Marko Mäkelä e52315a4a2 MDEV-16855 Fix fts_sync_synchronization in InnoDB
This is a backport of the following fix from MySQL 5.7.23.
Some code refactoring has been omitted, and the test case has
been adapted to MariaDB.

commit 7a689acaa65e9d602575f7aa53fe36a64a07460f
Author: Krzysztof Kapuścik <krzysztof.kapuscik@oracle.com>
Date:   Tue Mar 13 12:34:03 2018 +0100

Bug#27082268 Invalid FTS sync synchronization

The fix closes two issues:
Bug #27082268 - INNODB: FAILING ASSERTION: SYM_NODE->TABLE != NULL DURING FTS SYNC
Bug #27095935 - DEADLOCK BETWEEN FTS_DROP_INDEX AND FTS_OPTIMIZE_SYNC_TABLE

Both issues were related to a FTS cache sync being done during
operations that perfomed DDL actions on internal FTS tables
(ALTER TABLE, TRUNCATE). In some cases the FTS tables and/or
internal cache structures could get removed while still being
used to perform FTS synchronization leading to crashes. In other
the sync operations could not get finishes as it was waiting for
dict lock which was taken by thread waiting for the background
sync to be finished.

The changes done includes:
- Stopping background operations during ALTER TABLE and TRUNCATE.
- Removal of unused code in FTS.
- Cleanup of FTS sync related code to make it more readable and
easier to maintain.

RB#18262
2018-07-30 18:06:30 +03:00
..
api0api.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
api0misc.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
btr0btr.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
btr0btr.ic MDEV-13103 Assertion `flags & BUF_PAGE_PRINT_NO_CRASH' failed in buf_page_print 2017-09-06 14:01:15 +03:00
btr0cur.h Revert "MDEV-6928: Add trx pointer to struct mtr_t" 2018-01-29 11:05:17 +02:00
btr0cur.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
btr0pcur.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
btr0pcur.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
btr0sea.h 5.5.55-38.8 2017-07-18 19:47:01 +02:00
btr0sea.ic Merge branch '5.5' into 10.0 2017-03-03 01:37:54 +02:00
btr0types.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
buf0buddy.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
buf0buddy.ic 5.5.55-38.8 2017-07-18 19:47:01 +02:00
buf0buf.h Follow-up to MDEV-13103: Do not add __attribute__((nonnull)) 2017-09-07 11:58:21 +03:00
buf0buf.ic Merge branch 'merge-xtradb-5.5' into 5.5 2016-10-13 12:40:24 +02:00
buf0checksum.h 5.6.25-73.1 2015-08-01 15:04:20 +02:00
buf0dblwr.h Merge branch 'merge-xtradb-5.6' into 10.0 2017-05-17 12:11:12 +03:00
buf0dump.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
buf0flu.h MDEV-13039 innodb_fast_shutdown=0 may fail to purge all undo log 2017-06-09 16:20:42 +03:00
buf0flu.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
buf0lru.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
buf0lru.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
buf0rea.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
buf0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
data0data.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
data0data.ic 5.6.31-77.0 2016-08-10 19:24:58 +02:00
data0type.h Merge remote-tracking branch '5.5' into 10.0 2018-01-24 12:29:31 +02:00
data0type.ic Fix -Wimplicit-fallthrough 2018-04-23 13:04:58 +03:00
data0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
db0err.h XtraDB-5.6.23-72.1 2015-05-05 00:08:58 +02:00
dict0boot.h MDEV-11694 InnoDB tries to create unused table SYS_ZIP_DICT 2017-01-03 19:32:47 +02:00
dict0boot.ic MDEV-11694 InnoDB tries to create unused table SYS_ZIP_DICT 2017-01-03 19:32:47 +02:00
dict0crea.h MDEV-11694 InnoDB tries to create unused table SYS_ZIP_DICT 2017-01-03 19:32:47 +02:00
dict0crea.ic 5.6.31-77.0 2016-08-10 19:24:58 +02:00
dict0dict.h Merge remote-tracking branch '5.5' into 10.0 2018-01-24 12:29:31 +02:00
dict0dict.ic Merge branch 'merge-xtradb-5.6' into 10.0 2018-01-24 20:20:11 +02:00
dict0load.h MDEV-11694 InnoDB tries to create unused table SYS_ZIP_DICT 2017-01-03 19:32:47 +02:00
dict0load.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
dict0mem.h Merge branch 'merge-xtradb-5.6' into 10.0 2018-01-24 20:20:11 +02:00
dict0mem.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
dict0priv.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
dict0priv.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
dict0stats.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
dict0stats.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
dict0stats_bg.h Merge branch 'merge-xtradb-5.6' into 10.0 2018-01-24 20:20:11 +02:00
dict0stats_bg.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
dict0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
dyn0dyn.h 5.5.55-38.8 2017-07-18 19:47:01 +02:00
dyn0dyn.ic Merge branch 'merge-xtradb-5.5' into 5.5 2017-07-18 19:50:11 +02:00
eval0eval.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
eval0eval.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
eval0proc.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
eval0proc.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
fil0fil.h MDEV-16124 fil_rename_tablespace() times out and crashes server during table-rebuilding ALTER TABLE 2018-06-05 18:16:12 +03:00
fsp0fsp.h 5.5.55-38.8 2017-07-18 19:47:01 +02:00
fsp0fsp.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
fsp0types.h MDEV-11802 innodb.innodb_bug14676111 fails 2017-02-20 12:20:52 +02:00
fts0ast.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
fts0blex.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
fts0fts.h MDEV-16855 Fix fts_sync_synchronization in InnoDB 2018-07-30 18:06:30 +03:00
fts0opt.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
fts0pars.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
fts0priv.h MDEV-16855 Fix fts_sync_synchronization in InnoDB 2018-07-30 18:06:30 +03:00
fts0priv.ic 5.6.31-77.0 2016-08-10 19:24:58 +02:00
fts0tlex.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
fts0types.h MDEV-11802 innodb.innodb_bug14676111 fails 2017-02-20 12:20:52 +02:00
fts0types.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
fts0vlc.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
fut0fut.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
fut0fut.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
fut0lst.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
fut0lst.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
ha0ha.h 5.6.36-82.0 2017-05-16 14:16:11 +03:00
ha0ha.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
ha0storage.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
ha0storage.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
ha_prototypes.h Fix some __attribute__((nonnull)) misuse 2017-05-18 09:07:15 +03:00
handler0alter.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
hash0hash.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
hash0hash.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
ibuf0ibuf.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
ibuf0ibuf.ic 5.6.27-76.0 2015-12-13 10:13:18 +01:00
ibuf0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
lock0iter.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
lock0lock.h MDEV-11802 innodb.innodb_bug14676111 fails 2017-02-20 12:20:52 +02:00
lock0lock.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
lock0priv.h Merge branch 'merge/merge-xtradb-5.6' into 10.0 2016-08-10 19:55:45 +02:00
lock0priv.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
lock0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
log0log.h MDEV-11802 innodb.innodb_bug14676111 fails 2017-02-20 12:20:52 +02:00
log0log.ic Merge branch 'merge-xtradb-5.6' into 0.0 2016-06-21 15:27:09 +02:00
log0online.h Merge remote-tracking branch '5.5' into 10.0 2018-01-24 12:29:31 +02:00
log0recv.h Merge 5.5 into 10.0 2017-03-08 11:40:43 +02:00
log0recv.ic 5.6.30-76.3 2016-06-21 14:20:09 +02:00
mach0data.h 5.5.55-38.8 2017-07-18 19:47:01 +02:00
mach0data.ic 5.6.38-83.0 2018-01-23 18:04:34 +02:00
mem0dbg.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
mem0dbg.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
mem0mem.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
mem0mem.ic Merge remote-tracking branch '5.5' into 10.0 2018-01-24 12:29:31 +02:00
mem0pool.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
mem0pool.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
mtr0log.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
mtr0log.ic MDEV-12569 InnoDB suggests filing bugs at MySQL bug tracker 2017-10-26 13:29:28 +03:00
mtr0mtr.h Revert "MDEV-6928: Add trx pointer to struct mtr_t" 2018-01-29 11:05:17 +02:00
mtr0mtr.ic Revert "MDEV-6928: Add trx pointer to struct mtr_t" 2018-01-29 11:05:17 +02:00
mtr0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
os0file.h Merge branch 'merge-xtradb-5.6' into 10.0 2018-01-24 20:20:11 +02:00
os0file.ic 5.6.38-83.0 2018-01-23 18:04:34 +02:00
os0once.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
os0proc.h 5.6.27-76.0 2015-12-13 10:13:18 +01:00
os0proc.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
os0stacktrace.h MDEV-7369: MariaDB build fails when XTRADB_STORAGE_ENGINE enabled 2014-12-28 13:44:30 +02:00
os0sync.h Fix the Solaris compilation after MDEV-12674 2017-05-15 10:26:42 +03:00
os0sync.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
os0thread.h Merge branch 'merge-xtradb-5.6' into 10.0 2017-03-05 00:59:57 +02:00
os0thread.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
page0cur.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
page0cur.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
page0page.h Merge branch 'merge-xtradb-5.5' into 5.5 2017-07-18 19:50:11 +02:00
page0page.ic MDEV-13103 Assertion `flags & BUF_PAGE_PRINT_NO_CRASH' failed in buf_page_print 2017-09-06 14:01:15 +03:00
page0types.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
page0zip.h 5.5.55-38.8 2017-07-18 19:47:01 +02:00
page0zip.ic 5.6.38-83.0 2018-01-23 18:04:34 +02:00
pars0grm.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
pars0opt.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
pars0opt.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
pars0pars.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
pars0pars.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
pars0sym.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
pars0sym.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
pars0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
que0que.h removed garbase struct member 2017-11-15 09:28:28 +08:00
que0que.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
que0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
read0i_s.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
read0read.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
read0read.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
read0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
rem0cmp.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
rem0cmp.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
rem0rec.h 5.5.55-38.8 2017-07-18 19:47:01 +02:00
rem0rec.ic Merge remote-tracking branch '5.5' into 10.0 2018-01-24 12:29:31 +02:00
rem0types.h 5.6.33-79.0 2016-10-25 17:01:37 +02:00
row0ext.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0ext.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0ftsort.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0import.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0import.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0ins.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0ins.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0log.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0log.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0merge.h MDEV-13838: Wrong result after altering a partitioned table 2017-10-10 17:03:40 +03:00
row0mysql.h Make row_mysql_table_id_reassign() static 2018-01-18 09:29:49 +02:00
row0mysql.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0purge.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0purge.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0quiesce.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0quiesce.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0row.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0row.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0sel.h 5.6.37-82.2 2017-09-19 00:44:27 +03:00
row0sel.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0uins.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0uins.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0umod.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0umod.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0undo.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0undo.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
row0upd.h MDEV-15249 Crash in MVCC read after IMPORT TABLESPACE 2018-02-08 12:59:32 +02:00
row0upd.ic MDEV-15249 Crash in MVCC read after IMPORT TABLESPACE 2018-02-08 12:59:32 +02:00
row0vers.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
row0vers.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
srv0conc.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
srv0mon.h MDEV-12534 Use atomic operations whenever available 2017-04-20 16:29:12 +03:00
srv0mon.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
srv0srv.h Remove xtradb "fragmentation-statistics" patches 2018-01-24 20:21:58 +02:00
srv0srv.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
srv0start.h MDEV-13039 innodb_fast_shutdown=0 may fail to purge all undo log 2017-06-09 16:20:42 +03:00
sync0arr.h Merge branch 'merge/merge-xtradb-5.6' into 10.0 2016-08-10 19:55:45 +02:00
sync0arr.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
sync0rw.h Merge branch 'merge/merge-xtradb-5.6' into 10.0 2016-08-10 19:55:45 +02:00
sync0rw.ic Merge branch 'merge/merge-xtradb-5.6' into 10.0 2016-08-10 19:55:45 +02:00
sync0sync.h Merge branch 'merge/merge-xtradb-5.6' into 10.0 2016-08-10 19:55:45 +02:00
sync0sync.ic Merge branch '5.5' into 10.0 2016-08-10 19:19:05 +02:00
sync0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
trx0i_s.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
trx0purge.h MDEV-11802 innodb.innodb_bug14676111 fails 2017-02-20 12:20:52 +02:00
trx0purge.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
trx0rec.h Merge branch 'merge-xtradb-5.6' into 10.0 2018-01-24 20:20:11 +02:00
trx0rec.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
trx0roll.h MDEV-12323 Rollback progress log messages during crash recovery are intermixed with unrelated log messages 2017-12-13 18:56:22 +02:00
trx0roll.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
trx0rseg.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
trx0rseg.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
trx0sys.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
trx0sys.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
trx0trx.h Merge branch 'merge-xtradb-5.5' into 5.5 2017-07-18 19:50:11 +02:00
trx0trx.ic 5.6.31-77.0 2016-08-10 19:24:58 +02:00
trx0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
trx0undo.h Revert "MDEV-6928: Add trx pointer to struct mtr_t" 2018-01-29 11:05:17 +02:00
trx0undo.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
trx0xa.h Merge branch 'merge-xtradb-5.6' into 10.0 2017-05-17 12:11:12 +03:00
univ.i Merge branch 'merge-xtradb-5.6' into 10.0 2018-04-26 14:13:58 +02:00
usr0sess.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
usr0sess.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
usr0types.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0bh.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0bh.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0byte.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
ut0byte.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0counter.h MDEV-12674 Innodb_row_lock_current_waits has overflow 2017-05-12 12:24:53 +03:00
ut0crc32.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0dbg.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
ut0list.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0list.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0lst.h Fix gcc 6.3.x compiler warnings. 2017-02-16 12:02:31 +02:00
ut0mem.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
ut0mem.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0rbt.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0rnd.h 5.6.31-77.0 2016-08-10 19:24:58 +02:00
ut0rnd.ic 5.6.38-83.0 2018-01-23 18:04:34 +02:00
ut0sort.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0ut.h Merge branch 'merge-xtradb-5.6' into 10.0 2018-04-26 14:13:58 +02:00
ut0ut.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0vec.h move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0vec.ic move to storage/xtradb 2015-05-04 19:15:28 +02:00
ut0wqueue.h MDEV-11802 innodb.innodb_bug14676111 fails 2017-02-20 12:20:52 +02:00