diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-26 15:59:30 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-26 17:09:01 +0200 |
commit | 45ed9dd957eebc7fc84feb2509f4aa6baa908a95 (patch) | |
tree | ffc0c6988ce5edaf1f6fb60b4964c57e48f9c08a /storage/innobase/dict | |
parent | 3a9a3be1c64b14c05648e87ebe0f1dd96457de41 (diff) | |
download | mariadb-git-45ed9dd957eebc7fc84feb2509f4aa6baa908a95.tar.gz |
MDEV-23855: Remove fil_system.LRU and reduce fil_system.mutex contention
Also fixes MDEV-23929: innodb_flush_neighbors is not being ignored
for system tablespace on SSD
When the maximum configured number of file is exceeded, InnoDB will
close data files. We used to maintain a fil_system.LRU list and
a counter fil_node_t::n_pending to achieve this, at the huge cost
of multiple fil_system.mutex operations per I/O operation.
fil_node_open_file_low(): Implement a FIFO replacement policy:
The last opened file will be moved to the end of fil_system.space_list,
and files will be closed from the start of the list. However, we will
not move tablespaces in fil_system.space_list while
i_s_tablespaces_encryption_fill_table() is executing
(producing output for INFORMATION_SCHEMA.INNODB_TABLESPACES_ENCRYPTION)
because it may cause information of some tablespaces to go missing.
We also avoid this in mariabackup --backup because datafiles_iter_next()
assumes that the ordering is not changed.
IORequest: Fold more parameters to IORequest::type.
fil_space_t::io(): Replaces fil_io().
fil_space_t::flush(): Replaces fil_flush().
OS_AIO_IBUF: Remove. We will always issue synchronous reads of the
change buffer pages in buf_read_page_low().
We will always ignore some errors for background reads.
This should reduce fil_system.mutex contention a little.
fil_node_t::complete_write(): Replaces fil_node_t::complete_io().
On both read and write completion, fil_space_t::release_for_io()
will have to be called.
fil_space_t::io(): Do not acquire fil_system.mutex in the normal
code path.
xb_delta_open_matching_space(): Do not try to open the system tablespace
which was already opened. This fixes a file sharing violation in
mariabackup --prepare --incremental.
Reviewed by: Vladislav Vaintroub
Diffstat (limited to 'storage/innobase/dict')
-rw-r--r-- | storage/innobase/dict/dict0crea.cc | 2 | ||||
-rw-r--r-- | storage/innobase/dict/dict0load.cc | 8 |
2 files changed, 5 insertions, 5 deletions
diff --git a/storage/innobase/dict/dict0crea.cc b/storage/innobase/dict/dict0crea.cc index 7a27160ccd5..fb3247ecdcf 100644 --- a/storage/innobase/dict/dict0crea.cc +++ b/storage/innobase/dict/dict0crea.cc @@ -951,7 +951,7 @@ void dict_drop_index_tree(btr_pcur_t* pcur, trx_t* trx, mtr_t* mtr) if (fil_space_t* s = fil_space_acquire_silent(space_id)) { /* Ensure that the tablespace file exists in order to avoid a crash in buf_page_get_gen(). */ - if (s->size || fil_space_get_size(space_id)) { + if (root_page_no < s->get_size()) { btr_free_if_exists(page_id_t(space_id, root_page_no), s->zip_size(), mach_read_from_8(ptr), mtr); diff --git a/storage/innobase/dict/dict0load.cc b/storage/innobase/dict/dict0load.cc index 489f4d491d1..753bcf74967 100644 --- a/storage/innobase/dict/dict0load.cc +++ b/storage/innobase/dict/dict0load.cc @@ -2975,15 +2975,15 @@ err_exit: } if (err == DB_SUCCESS && table->is_readable()) { - if (table->space && !fil_space_get_size(table->space_id)) { + const auto root = dict_table_get_first_index(table)->page; + + if (root >= table->space->get_size()) { corrupted: table->corrupted = true; table->file_unreadable = true; err = DB_CORRUPTION; } else { - const page_id_t page_id( - table->space->id, - dict_table_get_first_index(table)->page); + const page_id_t page_id(table->space->id, root); mtr.start(); buf_block_t* block = buf_page_get( page_id, table->space->zip_size(), |