mariadb/include
Marko Mäkelä ea37b14409 MDEV-16678 Prefer MDL to dict_sys.latch for innodb background tasks
This is joint work with Thirunarayanan Balathandayuthapani.
The MDL interface between InnoDB and the rest of the server
(in storage/innobase/dict/dict0dict.cc and in include/)
is my work, while most everything else is Thiru's.

The collection of InnoDB persistent statistics and the
defragmentation were not refactored to use MDL. They will
keep relying on lower-level interlocking with
fil_check_pending_operations().

The purge of transaction history and the background operations on
fulltext indexes will use MDL. We will revert
commit 2c4844c9e7
(MDEV-17813) because thanks to MDL, purge cannot conflict
with DDL operations anymore. For a similar reason, we will remove
the MDEV-16222 test case from gcol.innodb_virtual_debug_purge.

Purge is essentially replacing all use of the global dict_sys.latch
with MDL. Purge will skip the undo log records for tables whose names
start with #sql-ib or #sql2. Theoretically, such tables might
be renamed back to visible table names if TRUNCATE fails to
create a new table, or the final rename in ALTER TABLE...ALGORITHM=COPY
fails. In that case, purge could permanently leave some garbage
in the table. Such garbage will be tolerated; the table would not
be considered corrupted.

To avoid repeated MDL releases and acquisitions,
trx_purge_attach_undo_recs() will sort undo log records by table_id,
and purge_node_t will keep the MDL and table handle open for multiple
successive undo log records.

get_purge_table(): A new accessor, used during the purge of
history for indexed virtual columns. This interface should ideally
not exist at all.

thd_mdl_context(): Accessor of THD::mdl_context.
Wrapped in a new thd_mdl_service.

dict_get_db_name_len(): Define inline.

dict_acquire_mdl_shared(): Acquire explicit shared MDL on a table name
if needed.

dict_table_open_on_id(): Return MDL_ticket, if requested.

dict_table_close(): Release MDL ticket, if requested.

dict_fts_index_syncing(), dict_index_t::index_fts_syncing: Remove.
row_drop_table_for_mysql() no longer needs to check these, because
MDL guarantees that a fulltext index sync will not be in progress
while MDL_EXCLUSIVE is protecting a DDL operation.

dict_table_t::parse_name(): Parse the table name for acquiring MDL.

purge_node_t::undo_recs: Change the type to std::list<trx_purge_rec_t*>
(different container, and storing also roll_ptr).

purge_node_t: Add mdl_ticket, last_table_id, purge_thd, mdl_hold_recs
for acquiring MDL and for keeping the table open across multiple
undo log records.

purge_vcol_info_t, row_purge_store_vsec_cur(), row_purge_restore_vsec_cur():
Remove. We will acquire the MDL earlier.

purge_sys_t::heap: Added, for reading undo log records.

fts_sync_during_ddl(): Invoked during ALGORITHM=INPLACE operations
to ensure that fts_sync_table() will not conflict with MDL_EXCLUSIVE.
Uses fts_t::sync_message for bookkeeping.
2019-12-10 15:42:50 +02:00
..
atomic MDEV-19696 - Cleanup gcc sync builtins 2019-07-03 12:11:22 +03:00
mysql MDEV-16678 Prefer MDL to dict_sys.latch for innodb background tasks 2019-12-10 15:42:50 +02:00
aria_backup.h MDEV-20306 Assert when converting encrypted Aria table to S3 2019-08-23 22:02:39 +02:00
big_endian.h Update FSF address 2019-05-11 19:25:02 +03:00
byte_order_generic.h Update FSF address 2019-05-11 19:25:02 +03:00
byte_order_generic_x86.h Update FSF address 2019-05-11 19:25:02 +03:00
byte_order_generic_x86_64.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
CMakeLists.txt Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
decimal.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
dur_prop.h Merge InnoDB 5.7 from mysql-5.7.9. 2016-09-02 13:22:28 +03:00
errmsg.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
ft_global.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
handler_ername.h Follow-up to changing FSF address 2019-05-11 18:30:45 +03:00
handler_state.h Fix for MDEV-533: Confusing error code when doing auto-increment insert for out-of-range values 2012-09-18 15:14:19 +03:00
hash.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
heap.h Merge 5.5 into 10.1 2019-11-06 08:17:03 +02:00
json_lib.h MDEV-5313 Improving audit API. 2019-01-18 03:18:02 +04:00
keycache.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
lf.h Merge 10.3 into 10.4 2019-12-02 12:51:53 +03:00
little_endian.h Update FSF address 2019-05-11 19:25:02 +03:00
m_ctype.h MDEV-8844 Unreadable control characters printed as is in warnings 2019-12-06 18:51:05 +04:00
m_string.h MDEV-21133: Introduce memmove_aligned() 2019-11-29 11:23:35 +02:00
ma_dyncol.h MDEV-19897 Rename source code variable names from utf8 to utf8mb3 2019-06-28 12:37:04 +04:00
maria.h move Aria/S3 specific flag into Aria code 2019-08-23 22:02:39 +02:00
my_alarm.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_alloc.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_atomic.h MDEV-19696 - Cleanup gcc sync builtins 2019-07-03 12:11:22 +03:00
my_attribute.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_base.h move Aria/S3 specific flag into Aria code 2019-08-23 22:02:39 +02:00
my_bit.h MDEV-19787 Speedup Table_map_iterator, via compiler intrinsics 2019-06-19 11:10:49 +02:00
my_bitmap.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_byteorder.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_check_opt.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_compare.h Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
my_compiler.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_context.h Merge branch '10.1' into 10.2 2016-03-23 22:36:46 +01:00
my_counter.h MDEV-17441 - InnoDB transition to C++11 atomics 2019-01-07 19:45:50 +04:00
my_cpu.h MDEV-19845: Adaptive spin loops 2019-06-27 10:53:18 +03:00
my_crypt.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_dbug.h MDEV-20525 rocksdb debug compilation fails on Windows due to unresolved my_assert variable 2019-09-13 15:28:53 +03:00
my_decimal_limits.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
my_default.h MDEV-12684 Show what config file a sysvar got a value from 2019-10-14 10:29:30 +02:00
my_dir.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_getopt.h MDEV-12684 Show what config file a sysvar got a value from 2019-10-14 10:29:30 +02:00
my_global.h Merge 10.4 into 10.5 2019-10-11 08:41:36 +03:00
my_handler_errors.h Merge 10.4 into 10.5 2019-05-23 10:32:21 +03:00
my_libwrap.h Update FSF Address 2019-05-11 21:29:06 +03:00
my_list.h Update FSF Address 2019-05-11 21:29:06 +03:00
my_md5.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_net.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_nosys.h Update FSF Address 2019-05-11 21:29:06 +03:00
my_pthread.h MDEV-20279 Increase Aria index length limit 2019-08-23 11:26:04 +02:00
my_rdtsc.h MDEV-19845: Define my_timer_cycles() inline 2019-06-28 19:19:31 +03:00
my_rnd.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
my_service_manager.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
my_stack_alloc.h alloc_on_stack: simplify the API 2019-08-23 22:01:39 +02:00
my_stacktrace.h Merge 10.4 into 10.5 2019-05-23 10:32:21 +03:00
my_sys.h Merge 10.4 into 10.5 2019-11-19 10:45:28 +08:00
my_time.h MDEV-20432 : add MYSQL_PLUGIN_IMPORT 2019-08-29 18:33:58 +02:00
my_tree.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_uctype.h Update FSF Address 2019-05-11 21:29:06 +03:00
my_user.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
my_valgrind.h Merge 10.2 to 10.3 2019-08-13 19:28:51 +03:00
my_xml.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
myisam.h MDEV-20279 Increase Aria index length limit 2019-08-23 11:26:04 +02:00
myisamchk.h alloc_on_stack: simplify the API 2019-08-23 22:01:39 +02:00
myisammrg.h MDEV-19955 make argument of handler::ha_write_row() const 2019-07-05 13:14:19 +03:00
myisampack.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
mysql.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
mysql.h.pp MDEV-16470 - Session user variables tracker 2019-09-24 15:49:35 +04:00
mysql_async.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
mysql_com.h MDEV-16470 - Session user variables tracker 2019-09-24 15:49:35 +04:00
mysql_com_server.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mysql_embed.h Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
mysql_time.h Merge branch '5.5' into 10.1 2019-05-11 22:19:05 +03:00
mysql_version.h.in Fixed that mariadb-# binaries reads their corresponding entry from my.cnf 2019-07-18 15:32:22 +03:00
mysqld_default_groups.h Fixed that mariadb-# binaries reads their corresponding entry from my.cnf 2019-07-18 15:32:22 +03:00
mysys_err.h Update FSF Address 2019-05-11 21:29:06 +03:00
pack.h Merge branch '10.2' into bb-10.2-connector-c-integ-subm 2016-09-21 12:54:56 +02:00
password.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
probes_mysql.d.base Update FSF Address 2019-05-11 21:29:06 +03:00
probes_mysql.h Update FSF Address 2019-05-11 21:29:06 +03:00
probes_mysql_nodtrace.h.in Merge branch '5.5' into 10.0 2016-02-15 22:50:59 +01:00
queues.h Misc. typos 2018-04-05 15:26:57 +04:00
rijndael.h Update FSF Address 2019-05-11 21:29:06 +03:00
service_versions.h MDEV-16678 Prefer MDL to dict_sys.latch for innodb background tasks 2019-12-10 15:42:50 +02:00
source_revision.h.in SOURCE_REVISION should always be defined in source_revision.h 2017-11-01 13:20:32 +00:00
sql_common.h Merge 10.1 into 10.2 2019-05-13 17:54:04 +03:00
ssl_compat.h MDEV-18531 : Use WolfSSL instead of YaSSL as "bundled" SSL/encryption library 2019-05-22 13:48:25 +02:00
sslopt-case.h MDEV-18531 : Use WolfSSL instead of YaSSL as "bundled" SSL/encryption library 2019-05-22 13:48:25 +02:00
sslopt-longopts.h MDEV-14101 Provide an option to select TLS protocol version 2019-06-17 12:26:25 +02:00
sslopt-vars.h MDEV-14101 Provide an option to select TLS protocol version 2019-06-17 12:26:25 +02:00
t_ctype.h Update FSF Address 2019-05-11 21:29:06 +03:00
thr_alarm.h Update FSF Address 2019-05-11 21:29:06 +03:00
thr_lock.h Merge branch '10.3' into 10.4 2019-05-19 20:55:37 +02:00
thr_timer.h MDEV-16264 - prerequisite patch, periodic thr_timer 2019-11-15 16:50:22 +01:00
thread_pool_priv.h Merge 10.4 into 10.5 2019-05-23 10:32:21 +03:00
typelib.h MDEV-19863 Add const to TYPELIB pointers 2019-06-26 05:29:44 +04:00
violite.h MDEV-14101 Provide an option to select TLS protocol version 2019-06-17 12:26:25 +02:00
waiting_threads.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
welcome_copyright_notice.h Update FSF Address 2019-05-11 21:29:06 +03:00
wqueue.h Merge 10.2 into 10.3 2019-05-14 17:18:46 +03:00
wsrep.h Decrease stack space usage of mysql_execute_command() 2019-08-23 22:06:30 +02:00