summaryrefslogtreecommitdiff
path: root/mysql-test/suite/perfschema
Commit message (Collapse)AuthorAgeFilesLines
...
| | | | | | | * MDEV-29446 Change SHOW CREATE TABLE to display default collationAlexander Barkov2022-09-1212-66/+66
| | | | | | | |
| * | | | | | | Merge branch '10.8' into 10.9Oleksandr Byelkin2022-08-0931-7/+2896
| |\ \ \ \ \ \ \ | | |/ / / / / /
| | * | | | | | Merge branch '10.7' into 10.8Oleksandr Byelkin2022-08-0931-7/+2896
| | |\ \ \ \ \ \ | | | |/ / / / /
* | | | | | | | Merge branch '10.9' into 10.10Oleksandr Byelkin2022-08-0931-7/+2896
|\ \ \ \ \ \ \ \
| * \ \ \ \ \ \ \ Merge branch '10.8' into 10.9Oleksandr Byelkin2022-08-0831-7/+2896
| |\ \ \ \ \ \ \ \ | | |/ / / / / / / | |/| | | | | | |
| | * | | | | | | Merge branch '10.7' into 10.8Oleksandr Byelkin2022-08-0831-7/+2896
| | |\ \ \ \ \ \ \ | | | |/ / / / / / | | |/| / / / / / | | | |/ / / / /
| | | * | | | | Merge branch '10.6' into 10.7Oleksandr Byelkin2022-08-0831-7/+2896
| | | |\ \ \ \ \ | | | | |/ / / /
| | | | * | | | Merge branch '10.5' into bb-10.6-releaseOleksandr Byelkin2022-08-0331-7/+2896
| | | | |\ \ \ \ | | | | | |/ / /
| | | | | * | | Merge branch 'merge-perfschema-5.7' into 10.5Oleksandr Byelkin2022-08-0231-7/+2896
| | | | | |\ \ \
| | | | | | * | | mysql-5.7.39Oleksandr Byelkin2022-07-29125-44/+3032
| | | | | | | | |
* | | | | | | | | MDEV-20122: Deprecate MASTER_USE_GTID=Current_Pos to favor new ↵Brandon Nesterenko2022-07-262-27/+27
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | MASTER_DEMOTE_TO_SLAVE option New Feature: ======== This feature adds a safe replacement to the MASTER_USE_GTID=Current_Pos option for CHANGE MASTER TO as MASTER_DEMOTE_TO_SLAVE=<bool>. The use case of Current_Pos is to transition a master to become a slave; however, can break replication state if the slave executes local transactions due to actively updating gtid_current_pos with gtid_binlog_pos and gtid_slave_pos. MASTER_DEMOTE_TO_SLAVE changes this use case by forcing users to set Using_Gtid=Slave_Pos and merging gtid_binlog_pos into gtid_slave_pos once at CHANGE MASTER TO time. Note that if gtid_slave_pos is more recent than gtid_binlog_pos (as in the case of chain replication), the replication state should be preserved. Additionally, deprecate the `Current_Pos` option of MASTER_USE_GTID to suggest the safe alternative option MASTER_DEMOTE_TO_SLAVE=TRUE. Reviewed By: ============ Andrei Elkin <andrei.elkin@mariadb.com>
* | | | | | | | | MDEV-28554: Remove innodb_versionMarko Mäkelä2022-06-031-1/+0
|/ / / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | INNODB_VERSION_STR: Replaced with PACKAGE_VERSION (non-functional change). INNODB_VERSION_SHORT: Replaced with direct use of MYSQL_VERSION_MAJOR << 8 | MYSQL_VERSION_MINOR. check_version(): Simplify the mariadb-backup version check, and require the server version to be MariaDB 10.8 or later, because that is when the InnoDB redo log format was last changed.
* | | | | | | | Merge branch '10.8' into 10.9mariadb-10.9.1Sergei Golubchik2022-05-197-29/+64
|\ \ \ \ \ \ \ \ | |/ / / / / / /
| * | | | | | | Merge branch '10.7' into 10.8Sergei Golubchik2022-05-117-29/+64
| |\ \ \ \ \ \ \ | | |/ / / / / /
| | * | | | | | Merge branch '10.6' into 10.7Sergei Golubchik2022-05-115-29/+31
| | |\ \ \ \ \ \ | | | |/ / / / /
| | | * | | | | Merge branch '10.5' into 10.6Sergei Golubchik2022-05-105-29/+31
| | | |\ \ \ \ \ | | | | |/ / / /
| | | | * | | | Merge branch '10.4' into 10.5Sergei Golubchik2022-05-095-29/+31
| | | | |\ \ \ \ | | | | | | |/ / | | | | | |/| |
| | | | | * | | Merge branch '10.3' into 10.4Sergei Golubchik2022-05-084-4/+5
| | | | | |\ \ \ | | | | | | | |/ | | | | | | |/|
| | | | | | * | test fixes for FreeBSDSergei Golubchik2022-05-044-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * FreeBSD returns errno 31 (EMLINK, Too many links), not 40 (ELOOP, Too many levels of symbolic links) * (`mysqlbinlog|mysql`) was just crazy, why did it ever work? * socket_ipv6.inc check (that checked whether ipv6 is supported) only worked correctly when ipv6 was supported * perfschema.socket_summary_by_instance was changing global variables and then skip-ing the test (because on missing ipv6)
| | | * | | | | Merge 10.5 into 10.6Marko Mäkelä2022-04-261-4/+0
| | | |\ \ \ \ \ | | | | |/ / / /
| | | | * | | | MDEV-27094 Debug builds include useless InnoDB "disabled" optionsMarko Mäkelä2022-04-221-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is a backport of commit 4489a89c71ea78f2562159ca0303fbb83da5baa0 in order to remove the test innodb.redo_log_during_checkpoint that would cause trouble in the DBUG subsystem invoked by safe_mutex_lock() via log_checkpoint(). Before commit 7cffb5f6e8a231a041152447be8980ce35d2c9b8 these mutexes were of different type. The following options were introduced in commit 2e814d4702d71a04388386a9f591d14a35980bfe (mariadb-10.2.2) and have little use: innodb_disable_resize_buffer_pool_debug had no effect even in MariaDB 10.2.2 or MySQL 5.7.9. It was introduced in mysql/mysql-server@5c4094cf4971eebab89da4ee4ae92c71f69cd524 to work around a problem that was fixed in mysql/mysql-server@2957ae4f990bf3aed25822b0ce15d3ccad0b54b6 (but the parameter was not removed). innodb_page_cleaner_disabled_debug and innodb_master_thread_disabled_debug are only used by the test innodb.redo_log_during_checkpoint that will be removed as part of this commit. innodb_dict_stats_disabled_debug is only used by that test, and it is redundant because one could simply use innodb_stats_persistent=OFF or the STATS_PERSISTENT=0 attribute of the table in the test to achieve the same effect.
| | * | | | | | MDEV-28344:sys.ps_setup_save and dependent procedures fail with ↵anel2022-04-272-0/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ER_ILLEGAL_HA_CREATE_OPTION - The problem: ============== - Commit f7216fa63d69448c3de1532a1dd197d0f28faefd created the check function for default temporary storage engine and in case the SE doesn't support temporary tables the error `ER_ILLEGAL_HA_CREATE_OPTION` is raised. Before that commit in such cases temporary tables were created by silently substituting default SE (RocksDB, Connect, PerfSchema) with MyISAM. - The test `pr_diagnostics.test` was modified in that commit with raising the error, since I didn't check the root cause of test itself. - The solution: =============== - This commit update the root case: procedure `ps_setup_save()` that uses temporary tables created from performance schema tables definition using `LIKE`, what is not supported. The suggested fix is to use InnoDB table by using `AS SELECT`. - Note that test `pr_diagnostics` will raise this error for `medium/full` third argument, but not for `current` value of third argument. - Additionally this patch updates the test case of commit f7216fa, by adding missing relation between temporary tables and Performance schema in `perfschema.misc` test. - Reviewed by: <wlad@mariadb.com>
* | | | | | | | MDEV-28201: Server crashes upon SHOW ANALYZE/EXPLAIN FORMAT=JSONSergei Petrunia2022-04-291-37/+37
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - Describe the lifetime of EXPLAIN data structures in sql_explain.h:ExplainDataStructureLifetime. - Make Item_field::set_field() call set_refers_to_temp_table() when it refers to a temp. table. - Introduce QT_DONT_ACCESS_TMP_TABLES flag for Item::print. It directs Item_field::print to not try access its the temp table. - Introduce Explain_query::notify_tables_are_closed() and call it right before the query closes its tables. - Make Explain data stuctures' print_explain_json() methods accept "no_tmp_tbl" parameter which means pass QT_DONT_ACCESS_TMP_TABLES when printing items. - Make Show_explain_request::call_in_target_thread() not call set_current_thd(). This wasn't needed as the code inside lex->print_explain() uses output->thd anyway. output->thd refers to the SHOW command's THD object.
* | | | | | | | MDEV-28124 Server crashes in Explain_aggr_filesort::print_json_membersOleg Smirnov2022-04-291-19/+19
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | SHOW EXPLAIN/ANALYZE FORMAT=JSON tries to access items that have already been freed by a call to free_items() during THD::cleanup_after_query(). The solution is to disallow APC calls including SHOW EXPLAIN/ANALYZE just before the call to free_items().
* | | | | | | | MDEV-27021 Add explicit indication of SHOW EXPLAIN/ANALYZE.Oleg Smirnov2022-04-2948-48/+48
|/ / / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1. Add explicit indication that the output is produced by SHOW EXPLAIN/ANALYZE FORMAT=JSON command. 2. Remove useless "r_total_time_ms" field from SHOW ANALYZE FORMAT=JSON output when there is no timed statistics gathered. 3. Add "r_query_time_in_progress_ms" to the output of SHOW ANALYZE FORMAT=JSON.
* | | | | | | Merge 10.7 into 10.8Nayuta Yanagisawa2022-04-132-3/+7
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Merge 10.6 into 10.7Marko Mäkelä2022-04-122-3/+7
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | Merge 10.5 into 10.6Marko Mäkelä2022-04-122-3/+7
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | MDEV-28255 "Error" instead of NULL in P_S.THREADS_CONNECTION_TYPE for ↵Sergei Golubchik2022-04-092-3/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | background threads use vio_type_names[] values as in MySQL
* | | | | | | Merge 10.7 into 10.8Daniel Black2022-03-257-7/+15
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Merge 10.6 into 10.7Daniel Black2022-03-257-7/+15
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | Merge 10.5 to 10.6Daniel Black2022-03-257-7/+15
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | MDEV-23974 fixup: rpl.rpl_gtid_stop_start failsMarko Mäkelä2022-03-247-7/+15
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The call mtr.add_suppression() that was added in commit 75b7cd680b8272ac5a0848791757c1d310501574 for MemorySanitizer and Valgrind runs is causing a result difference for the test rpl.rpl_gtid_stop_start. Let us disable the binlog for executing that statement. Also, the test perfschema.statement_program_lost_inst would fail due to the changes to have_innodb.inc in this commit. To compensate for that, we will make more --suite=perfschema tests run without InnoDB, and explicitly enable InnoDB in those tests that depend on a transactional storage engine.
* | | | | | | Merge 10.7 into 10.8Marko Mäkelä2022-02-254-23/+26
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Merge 10.6 into 10.7Marko Mäkelä2022-02-254-23/+26
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | Merge 10.5 into 10.6Marko Mäkelä2022-02-252-23/+23
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | MDEV-27932: perfschema.dml_file_instances mtr failureDaniel Black2022-02-242-23/+23
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Order by results in MTR test to make it predictable.
| | * | | | | MDEV-27935: Enable performance_schema profiling for trx_rseg_t latchKrunal Bauskar2022-02-242-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - In 10.6, trx_rseg_t mutex was ported to use latch. As part of this porting profiling of the patch was removed. This patch reenables it given that the said latch continues to occupy the top-slots in the contention list.
* | | | | | | MDEV-27774 Reduce scalability bottlenecks in mtr_t::commit()Marko Mäkelä2022-02-101-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | A prominent bottleneck in mtr_t::commit() is log_sys.mutex between log_sys.append_prepare() and log_close(). User-visible change: The minimum innodb_log_file_size will be increased from 1MiB to 4MiB so that some conditions can be trivially satisfied. log_sys.latch (log_latch): Replaces log_sys.mutex and log_sys.flush_order_mutex. Copying mtr_t::m_log to log_sys.buf is protected by a shared log_sys.latch. Writes from log_sys.buf to the file system will be protected by an exclusive log_sys.latch. log_sys.lsn_lock: Protects the allocation of log buffer in log_sys.append_prepare(). sspin_lock: A simple spin lock, for log_sys.lsn_lock. Thanks to Vladislav Vaintroub for suggesting this idea, and for reviewing these changes. mariadb-backup: Replace some use of log_sys.mutex with recv_sys.mutex. buf_pool_t::insert_into_flush_list(): Implement sorting of flush_list because ordering is otherwise no longer guaranteed. Ordering by LSN is needed for the proper operation of redo log checkpoints. log_sys.append_prepare(): Advance log_sys.lsn and log_sys.buf_free by the length, and return the old values. Also increment write_to_buf, which was previously done in log_close(). mtr_t::finish_write(): Obtain the buffer pointer from log_sys.append_prepare(). log_sys.buf_free: Make the field Atomic_relaxed, to simplify log_flush_margin(). Use only loads and stores to avoid costly read-modify-write atomic operations. buf_pool.flush_list_requests: Replaces export_vars.innodb_buffer_pool_write_requests and srv_stats.buf_pool_write_requests. Protected by buf_pool.flush_list_mutex. buf_pool_t::insert_into_flush_list(): Do not invoke page_cleaner_wakeup(). Let the caller do that after a batch of calls. recv_recover_page(): Invoke a minimal part of buf_pool.insert_into_flush_list(). ReleaseBlocks::modified: A number of pages added to buf_pool.flush_list. ReleaseBlocks::operator(): Merge buf_flush_note_modification() here. log_t::set_capacity(): Renamed from log_set_capacity().
* | | | | | | Merge branch '10.7' into 10.8Oleksandr Byelkin2022-02-043-0/+202
|\ \ \ \ \ \ \ | |/ / / / / /
| * | | | | | Merge branch '10.6' into 10.7Oleksandr Byelkin2022-02-043-0/+202
| |\ \ \ \ \ \ | | |/ / / / /
| | * | | | | Merge branch '10.5' into 10.6Oleksandr Byelkin2022-02-033-0/+202
| | |\ \ \ \ \ | | | |/ / / /
| | | * | | | Merge branch 'merge-perfschema-5.7' into 10.5Oleksandr Byelkin2022-01-283-0/+202
| | | |\ \ \ \ | | | | | |_|/ | | | | |/| |
| | | | * | | 5.7.37Oleksandr Byelkin2022-01-252-0/+220
| | | | | | |
| | | | * | | 5.7.34Sergei Golubchik2021-05-0389-1080/+1240
| | | | | | |
| | | | * | | 5.7.30Sergei Golubchik2020-05-081-123/+132
| | | | | | |
| | | | * | | 5.7.28Sergei Golubchik2019-12-11152-1034/+1373
| | | | | | |
| | | | * | | 5.7.13Sergei Golubchik2016-07-28698-28048/+111406
| | | | | | |
* | | | | | | MDEV-14425 Improve the redo log for concurrencyMarko Mäkelä2022-01-211-3/+2
|/ / / / / / | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The InnoDB redo log used to be formatted in blocks of 512 bytes. The log blocks were encrypted and the checksum was calculated while holding log_sys.mutex, creating a serious scalability bottleneck. We remove the fixed-size redo log block structure altogether and essentially turn every mini-transaction into a log block of its own. This allows encryption and checksum calculations to be performed on local mtr_t::m_log buffers, before acquiring log_sys.mutex. The mutex only protects a memcpy() of the data to the shared log_sys.buf, as well as the padding of the log, in case the to-be-written part of the log would not end in a block boundary of the underlying storage. For now, the "padding" consists of writing a single NUL byte, to allow recovery and mariadb-backup to detect the end of the circular log faster. Like the previous implementation, we will overwrite the last log block over and over again, until it has been completely filled. It would be possible to write only up to the last completed block (if no more recent write was requested), or to write dummy FILE_CHECKPOINT records to fill the incomplete block, by invoking the currently disabled function log_pad(). This would require adjustments to some logic around log checkpoints, page flushing, and shutdown. An upgrade after a crash of any previous version is not supported. Logically empty log files from a previous version will be upgraded. An attempt to start up InnoDB without a valid ib_logfile0 will be refused. Previously, the redo log used to be created automatically if it was missing. Only with with innodb_force_recovery=6, it is possible to start InnoDB in read-only mode even if the log file does not exist. This allows the contents of a possibly corrupted database to be dumped. Because a prepared backup from an earlier version of mariadb-backup will create a 0-sized log file, we will allow an upgrade from such log files, provided that the FIL_PAGE_FILE_FLUSH_LSN in the system tablespace looks valid. The 512-byte log checkpoint blocks at 0x200 and 0x600 will be replaced with 64-byte log checkpoint blocks at 0x1000 and 0x2000. The start of log records will move from 0x800 to 0x3000. This allows us to use 4096-byte aligned blocks for all I/O in a future revision. We extend the MDEV-12353 redo log record format as follows. (1) Empty mini-transactions or extra NUL bytes will not be allowed. (2) The end-of-minitransaction marker (a NUL byte) will be replaced with a 1-bit sequence number, which will be toggled each time when the circular log file wraps back to the beginning. (3) After the sequence bit, a CRC-32C checksum of all data (excluding the sequence bit) will written. (4) If the log is encrypted, 8 bytes will be written before the checksum and included in it. This is part of the initialization vector (IV) of encrypted log data. (5) File names, page numbers, and checkpoint information will not be encrypted. Only the payload bytes of page-level log will be encrypted. The tablespace ID and page number will form part of the IV. (6) For padding, arbitrary-length FILE_CHECKPOINT records may be written, with all-zero payload, and with the normal end marker and checksum. The minimum size is 7 bytes, or 7+8 with innodb_encrypt_log=ON. In mariadb-backup and in Galera snapshot transfer (SST) scripts, we will no longer remove ib_logfile0 or create an empty ib_logfile0. Server startup will require a valid log file. When resizing the log, we will create a logically empty ib_logfile101 at the current LSN and use an atomic rename to replace ib_logfile0 with it. See the test innodb.log_file_size. Because there is no mandatory padding in the log file, we are able to create a dummy log file as of an arbitrary log sequence number. See the test mariabackup.huge_lsn. The parameter innodb_log_write_ahead_size and the INFORMATION_SCHEMA.INNODB_METRICS counter log_padded will be removed. The minimum value of innodb_log_buffer_size will be increased to 2MiB (because log_sys.buf will replace recv_sys.buf) and the increment adjusted to 4096 bytes (the maximum log block size). The following INFORMATION_SCHEMA.INNODB_METRICS counters will be removed: os_log_fsyncs os_log_pending_fsyncs log_pending_log_flushes log_pending_checkpoint_writes The following status variables will be removed: Innodb_os_log_fsyncs (this is included in Innodb_data_fsyncs) Innodb_os_log_pending_fsyncs (this was limited to at most 1 by design) log_sys.get_block_size(): Return the physical block size of the log file. This is only implemented on Linux and Microsoft Windows for now, and for the power-of-2 block sizes between 64 and 4096 bytes (the minimum and maximum size of a checkpoint block). If the block size is anything else, the traditional 512-byte size will be used via normal file system buffering. If the file system buffers can be bypassed, a message like the following will be issued: InnoDB: File system buffers for log disabled (block size=512 bytes) InnoDB: File system buffers for log disabled (block size=4096 bytes) This has been tested on Linux and Microsoft Windows with both sizes. On Linux, only enable O_DIRECT on the log for innodb_flush_method=O_DSYNC. Tests in 3 different environments where the log is stored in a device with a physical block size of 512 bytes are yielding better throughput without O_DIRECT. This could be due to the fact that in the event the last log block is being overwritten (if multiple transactions would become durable at the same time, and each of will write a small number of bytes to the last log block), it should be faster to re-copy data from log_sys.buf or log_sys.flush_buf to the kernel buffer, to be finally written at fdatasync() time. The parameter innodb_flush_method=O_DSYNC will imply O_DIRECT for data files. This option will enable O_DIRECT on the log file on Linux. It may be unsafe to use when the storage device does not support FUA (Force Unit Access) mode. When the server is compiled WITH_PMEM=ON, we will use memory-mapped I/O for the log file if the log resides on a "mount -o dax" device. We will identify PMEM in a start-up message: InnoDB: log sequence number 0 (memory-mapped); transaction id 3 On Linux, we will also invoke mmap() on any ib_logfile0 that resides in /dev/shm, effectively treating the log file as persistent memory. This should speed up "./mtr --mem" and increase the test coverage of PMEM on non-PMEM hardware. It also allows users to estimate how much the performance would be improved by installing persistent memory. On other tmpfs file systems such as /run, we will not use mmap(). mariadb-backup: Eliminated several variables. We will refer directly to recv_sys and log_sys. backup_wait_for_lsn(): Detect non-progress of xtrabackup_copy_logfile(). In this new log format with arbitrary-sized blocks, we can only detect log file overrun indirectly, by observing that the scanned log sequence number is not advancing. xtrabackup_copy_logfile(): On PMEM, do not modify the sequence bit, because we are not allowed to modify the server's log file, and our memory mapping is read-only. trx_flush_log_if_needed_low(): Do not use the callback on pmem. Using neither flush_lock nor write_lock around PMEM writes seems to yield the best performance. The pmem_persist() calls may still be somewhat slower than the pwrite() and fdatasync() based interface (PMEM mounted without -o dax). recv_sys_t::buf: Remove. We will use log_sys.buf for parsing. recv_sys_t::MTR_SIZE_MAX: Replaces RECV_SCAN_SIZE. recv_sys_t::file_checkpoint: Renamed from mlog_checkpoint_lsn. recv_sys_t, log_sys_t: Removed many data members. recv_sys.lsn: Renamed from recv_sys.recovered_lsn. recv_sys.offset: Renamed from recv_sys.recovered_offset. log_sys.buf_size: Replaces srv_log_buffer_size. recv_buf: A smart pointer that wraps log_sys.buf[recv_sys.offset] when the buffer is being allocated from the memory heap. recv_ring: A smart pointer that wraps a circular log_sys.buf[] that is backed by ib_logfile0. The pointer will wrap from recv_sys.len (log_sys.file_size) to log_sys.START_OFFSET. For the record that wraps around, we may copy file name or record payload data to the auxiliary buffer decrypt_buf in order to have a contiguous block of memory. The maximum size of a record is less than innodb_page_size bytes. recv_sys_t::parse(): Take the smart pointer as a template parameter. Do not temporarily add a trailing NUL byte to FILE_ records, because we are not supposed to modify the memory-mapped log file. (It is attached in read-write mode already during recovery.) recv_sys_t::parse_mtr(): Wrapper for recv_sys_t::parse(). recv_sys_t::parse_pmem(): Like parse_mtr(), but if PREMATURE_EOF would be returned on PMEM, use recv_ring to wrap around the buffer to the start. mtr_t::finish_write(), log_close(): Do not enforce log_sys.max_buf_free on PMEM, because it has no meaning on the mmap-based log. log_sys.write_to_buf: Count writes to log_sys.buf. Replaces srv_stats.log_write_requests and export_vars.innodb_log_write_requests. Protected by log_sys.mutex. Updated consistently in log_close(). Previously, mtr_t::commit() conditionally updated the count, which was inconsistent. log_sys.write_to_log: Count swaps of log_sys.buf and log_sys.flush_buf, for writing to log_sys.log (the ib_logfile0). Replaces srv_stats.log_writes and export_vars.innodb_log_writes. Protected by log_sys.mutex. log_sys.waits: Count waits in append_prepare(). Replaces srv_stats.log_waits and export_vars.innodb_log_waits. recv_recover_page(): Do not unnecessarily acquire log_sys.flush_order_mutex. We are inserting the blocks in arbitary order anyway, to be adjusted in recv_sys.apply(true). We will change the definition of flush_lock and write_lock to avoid potential false sharing. Depending on sizeof(log_sys) and CPU_LEVEL1_DCACHE_LINESIZE, the flush_lock and write_lock could share a cache line with each other or with the last data members of log_sys. Thanks to Matthias Leich for providing https://rr-project.org traces for various failures during the development, and to Thirunarayanan Balathandayuthapani for his help in debugging some of the recovery code. And thanks to the developers of the rr debugger for a tool without which extensive changes to InnoDB would be very challenging to get right. Thanks to Vladislav Vaintroub for useful feedback and to him, Axel Schwenke and Krunal Bauskar for testing the performance.
* | | | | | Merge 10.6 into 10.7Marko Mäkelä2022-01-041-0/+1
|\ \ \ \ \ \ | |/ / / / /