diff options
author | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-27 15:35:04 +0200 |
---|---|---|
committer | Marko Mäkelä <marko.makela@mariadb.com> | 2020-10-27 15:47:18 +0200 |
commit | 42e1815ad850384fad292534665ff61b78dd96f6 (patch) | |
tree | 88e1dbc62723abf652911cd73838c0e8797dae01 /mysql-test | |
parent | 8761571a71f0d628c5a82abed115e170d63e34c0 (diff) | |
download | mariadb-git-42e1815ad850384fad292534665ff61b78dd96f6.tar.gz |
MDEV-16952 Introduce SET GLOBAL innodb_max_purge_lag_wait
Let us introduce a dummy variable innodb_max_purge_lag_wait
for waiting that the InnoDB history list length is below
the user-specified limit. Specifically,
SET GLOBAL innodb_max_purge_lag_wait=0;
should wait for all history to be purged. This could be useful
when upgrading from an older version to MariaDB 10.3 or later,
to avoid hitting MDEV-15912.
Note: the history cannot be purged if there exist transactions
that may see old versions.
Reviewed by: Vladislav Vaintroub
Diffstat (limited to 'mysql-test')
-rw-r--r-- | mysql-test/suite/innodb/include/wait_all_purged.inc | 24 | ||||
-rw-r--r-- | mysql-test/suite/sys_vars/r/sysvars_innodb.result | 12 |
2 files changed, 20 insertions, 16 deletions
diff --git a/mysql-test/suite/innodb/include/wait_all_purged.inc b/mysql-test/suite/innodb/include/wait_all_purged.inc index 992e14f0843..e3a506c7622 100644 --- a/mysql-test/suite/innodb/include/wait_all_purged.inc +++ b/mysql-test/suite/innodb/include/wait_all_purged.inc @@ -1,25 +1,17 @@ # Wait for everything to be purged. # The user should have set innodb_purge_rseg_truncate_frequency=1. +--disable_query_log if (!$wait_all_purged) { - let $wait_all_purged= 0; + SET GLOBAL innodb_max_purge_lag_wait= 0; } -let $remaining_expect= `select concat('InnoDB ',$wait_all_purged)`; - -let $wait_counter= 600; -while ($wait_counter) +if ($wait_all_purged) { - --replace_regex /.*History list length ([0-9]+).*/\1/ - let $remaining= `SHOW ENGINE INNODB STATUS`; - if ($remaining == $remaining_expect) - { - let $wait_counter= 0; - } - if ($wait_counter) - { - real_sleep 0.1; - dec $wait_counter; - } + eval SET GLOBAL innodb_max_purge_lag_wait= $wait_all_purged; } +--enable_query_log + +--replace_regex /.*History list length ([0-9]+).*/\1/ +let $remaining= `SHOW ENGINE INNODB STATUS`; echo $remaining transactions not purged; diff --git a/mysql-test/suite/sys_vars/r/sysvars_innodb.result b/mysql-test/suite/sys_vars/r/sysvars_innodb.result index d3d30f8f53f..89138c2fedd 100644 --- a/mysql-test/suite/sys_vars/r/sysvars_innodb.result +++ b/mysql-test/suite/sys_vars/r/sysvars_innodb.result @@ -1686,6 +1686,18 @@ NUMERIC_BLOCK_SIZE 0 ENUM_VALUE_LIST NULL READ_ONLY NO COMMAND_LINE_ARGUMENT REQUIRED +VARIABLE_NAME INNODB_MAX_PURGE_LAG_WAIT +SESSION_VALUE NULL +DEFAULT_VALUE 4294967295 +VARIABLE_SCOPE GLOBAL +VARIABLE_TYPE INT UNSIGNED +VARIABLE_COMMENT Wait until History list length is below the specified limit +NUMERIC_MIN_VALUE 0 +NUMERIC_MAX_VALUE 4294967295 +NUMERIC_BLOCK_SIZE 0 +ENUM_VALUE_LIST NULL +READ_ONLY NO +COMMAND_LINE_ARGUMENT REQUIRED VARIABLE_NAME INNODB_MAX_UNDO_LOG_SIZE SESSION_VALUE NULL DEFAULT_VALUE 10485760 |