1
0
mirror of https://github.com/MariaDB/server.git synced 2025-08-08 11:22:35 +03:00

Merge 10.6 into 10.11

This commit is contained in:
Marko Mäkelä
2025-02-10 14:45:18 +02:00
22 changed files with 345 additions and 80 deletions

View File

@@ -11,9 +11,11 @@ insert into t1 values(5, repeat('.',12));
commit work;
SET GLOBAL innodb_fast_shutdown = 0;
# restart
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0,innodb_max_dirty_pages_pct=0;
SET GLOBAL innodb_max_dirty_pages_pct=99;
connect dml,localhost,root,,;
XA START 'x';
insert into t1 values (6, repeat('%', @@innodb_page_size/2));
insert into t1 values(6, repeat('%', @@innodb_page_size/2));
XA END 'x';
XA PREPARE 'x';
disconnect dml;
@@ -23,7 +25,6 @@ flush table t1 for export;
# restart
FOUND 1 /InnoDB: Recovered page \[page id: space=[1-9][0-9]*, page number=0\]/ in mysqld.1.err
# restart
XA ROLLBACK 'x';
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK
@@ -34,18 +35,13 @@ f1 f2
3 ////////////
4 ------------
5 ............
connect dml,localhost,root,,;
XA START 'x';
insert into t1 values (6, repeat('%', @@innodb_page_size/2));
XA END 'x';
XA PREPARE 'x';
disconnect dml;
connection default;
flush table t1 for export;
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0,innodb_max_dirty_pages_pct=0;
SET GLOBAL innodb_max_dirty_pages_pct=99;
XA ROLLBACK 'x';
FLUSH TABLE t1 FOR EXPORT;
# Kill the server
# restart
FOUND 4 /InnoDB: Recovered page \[page id: space=[1-9][0-9]*, page number=[03]\]/ in mysqld.1.err
XA ROLLBACK 'x';
check table t1;
Table Op Msg_type Msg_text
test.t1 check status OK

View File

@@ -1,10 +1,18 @@
CREATE TABLE `t`(`id` INT, PRIMARY KEY(`id`)) ENGINE=InnoDB STATS_PERSISTENT=0;
INSERT INTO t VALUES (1);
SET GLOBAL innodb_monitor_reset = "module_innodb";
SET GLOBAL innodb_monitor_disable="lock_row_lock_time";
SET GLOBAL innodb_monitor_disable="lock_row_lock_time_max";
SET GLOBAL innodb_monitor_reset_all='lock_row_lock_time';
SET GLOBAL innodb_monitor_reset_all='lock_row_lock_time_max';
SET GLOBAL innodb_monitor_enable="lock_row_lock_time";
SET GLOBAL innodb_monitor_enable="lock_row_lock_time_max";
BEGIN;
SELECT * FROM t FOR UPDATE;
id
1
SELECT @innodb_row_lock_time_before := variable_value
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_row_lock_time';
connect con1,localhost,root,,;
SET innodb_lock_wait_timeout = 1;
SELECT * FROM t FOR UPDATE;
@@ -12,29 +20,27 @@ ERROR HY000: Lock wait timeout exceeded; try restarting transaction
disconnect con1;
connection default;
COMMIT;
SELECT variable_value > 100 FROM information_schema.global_status
SELECT variable_value - @innodb_row_lock_time_before > 100
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_row_lock_time';
variable_value > 100
variable_value - @innodb_row_lock_time_before > 100
1
SELECT variable_value > 100 FROM information_schema.global_status
SELECT variable_value > 100
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
variable_value > 100
1
SELECT variable_value > 100 FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
variable_value > 100
1
SELECT count_reset > 100 FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME="lock_row_lock_time";
SELECT count_reset > 100
FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME='lock_row_lock_time';
count_reset > 100
1
SELECT count_reset > 100 FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME="lock_row_lock_time_max";
count_reset > 100
1
SELECT count_reset > 100 FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME="lock_row_lock_time_avg";
SELECT count_reset > 100
FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME='lock_row_lock_time_max';
count_reset > 100
1
DROP TABLE t;
SET GLOBAL innodb_monitor_reset=default;
SET GLOBAL innodb_monitor_enable=default;
SET GLOBAL innodb_monitor_disable=default;
SET GLOBAL innodb_monitor_reset_all=default;

View File

@@ -1,7 +1,9 @@
[strict_crc32]
--innodb-checksum-algorithm=strict_crc32
--innodb-use-atomic-writes=0
--innodb-undo-tablespaces=0
[strict_full_crc32]
--innodb-checksum-algorithm=strict_full_crc32
--innodb-use-atomic-writes=0
--innodb-undo-tablespaces=0

View File

@@ -42,10 +42,17 @@ commit work;
SET GLOBAL innodb_fast_shutdown = 0;
let $shutdown_timeout=;
--source include/restart_mysqld.inc
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0,innodb_max_dirty_pages_pct=0;
let $wait_condition =
SELECT variable_value = 0
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
--source include/wait_condition.inc
SET GLOBAL innodb_max_dirty_pages_pct=99;
--source ../include/no_checkpoint_start.inc
connect (dml,localhost,root,,);
XA START 'x';
insert into t1 values (6, repeat('%', @@innodb_page_size/2));
insert into t1 values(6, repeat('%', @@innodb_page_size/2));
XA END 'x';
XA PREPARE 'x';
disconnect dml;
@@ -53,10 +60,12 @@ connection default;
flush table t1 for export;
let $restart_parameters=;
--let CLEANUP_IF_CHECKPOINT=XA COMMIT 'x';drop table t1;
--let CLEANUP_IF_CHECKPOINT=drop table t1, unexpected_checkpoint;
--source ../include/no_checkpoint_end.inc
--copy_file $MYSQLD_DATADIR/ibdata1 $MYSQLD_DATADIR/ibdata1.bak
--copy_file $MYSQLD_DATADIR/ib_logfile0 $MYSQLD_DATADIR/ib_logfile0.bak
perl;
use IO::Handle;
do "$ENV{MTR_SUITE_DIR}/include/crc32.pl";
@@ -145,6 +154,12 @@ let $shutdown_timeout=0;
--source include/shutdown_mysqld.inc
let $shutdown_timeout=;
# Corrupt the file in a better way.
--remove_file $MYSQLD_DATADIR/ibdata1
--remove_file $MYSQLD_DATADIR/ib_logfile0
--move_file $MYSQLD_DATADIR/ibdata1.bak $MYSQLD_DATADIR/ibdata1
--move_file $MYSQLD_DATADIR/ib_logfile0.bak $MYSQLD_DATADIR/ib_logfile0
perl;
use IO::Handle;
my $fname= "$ENV{'MYSQLD_DATADIR'}test/t1.ibd";
@@ -157,22 +172,23 @@ syswrite(FILE, chr(0) x ($page_size/2));
close FILE;
EOF
--source include/start_mysqld.inc
XA ROLLBACK 'x';
check table t1;
select f1, f2 from t1;
SET GLOBAL innodb_max_dirty_pages_pct_lwm=0,innodb_max_dirty_pages_pct=0;
let $wait_condition =
SELECT variable_value = 0
FROM information_schema.global_status
WHERE variable_name = 'INNODB_BUFFER_POOL_PAGES_DIRTY';
--source include/wait_condition.inc
SET GLOBAL innodb_max_dirty_pages_pct=99;
--source ../include/no_checkpoint_start.inc
connect (dml,localhost,root,,);
XA START 'x';
insert into t1 values (6, repeat('%', @@innodb_page_size/2));
XA END 'x';
XA PREPARE 'x';
disconnect dml;
connection default;
XA ROLLBACK 'x';
FLUSH TABLE t1 FOR EXPORT;
flush table t1 for export;
let $restart_parameters=;
# If we are skipping the test at this point due to an unexpected
# checkpoint, we will already have tested a part of this functionality.
--let CLEANUP_IF_CHECKPOINT=drop table t1;
--source ../include/no_checkpoint_end.inc
# Zero out the first page in file and try to recover from dblwr
@@ -186,7 +202,6 @@ EOF
--source include/start_mysqld.inc
let SEARCH_PATTERN=InnoDB: Recovered page \\[page id: space=[1-9][0-9]*, page number=[03]\\];
--source include/search_pattern_in_file.inc
XA ROLLBACK 'x';
check table t1;
select f1, f2 from t1;
drop table t1;

View File

@@ -5,11 +5,26 @@ CREATE TABLE `t`(`id` INT, PRIMARY KEY(`id`)) ENGINE=InnoDB STATS_PERSISTENT=0;
INSERT INTO t VALUES (1);
SET GLOBAL innodb_monitor_reset = "module_innodb";
SET GLOBAL innodb_monitor_disable="lock_row_lock_time";
SET GLOBAL innodb_monitor_disable="lock_row_lock_time_max";
SET GLOBAL innodb_monitor_reset_all='lock_row_lock_time';
SET GLOBAL innodb_monitor_reset_all='lock_row_lock_time_max';
SET GLOBAL innodb_monitor_enable="lock_row_lock_time";
SET GLOBAL innodb_monitor_enable="lock_row_lock_time_max";
BEGIN;
SELECT * FROM t FOR UPDATE;
# We can't predict (innodb/lock)_row_lock_time_avg value, because it's counted
# as the whole waiting time divided by the amount of waits. The
# corresponding counters in lock_sys can't be reset with any query.
--disable_result_log
SELECT @innodb_row_lock_time_before := variable_value
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_row_lock_time';
--enable_result_log
--connect(con1,localhost,root,,)
SET innodb_lock_wait_timeout = 1;
--error ER_LOCK_WAIT_TIMEOUT
@@ -19,24 +34,28 @@ SELECT * FROM t FOR UPDATE;
--connection default
COMMIT;
SELECT variable_value > 100 FROM information_schema.global_status
SELECT variable_value - @innodb_row_lock_time_before > 100
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_row_lock_time';
SELECT variable_value > 100 FROM information_schema.global_status
# We can't use 'variable_value - @innodb_row_lock_time_max_before' trick for
# innodb_row_lock_time_max, because we can't reset it, and we don't know the
# initial value at the moment of the test execution.
SELECT variable_value > 100
FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_row_lock_time_max';
SELECT variable_value > 100 FROM information_schema.global_status
WHERE LOWER(variable_name) = 'innodb_row_lock_time_avg';
SELECT count_reset > 100 FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME="lock_row_lock_time";
SELECT count_reset > 100 FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME="lock_row_lock_time_max";
SELECT count_reset > 100 FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME="lock_row_lock_time_avg";
SELECT count_reset > 100
FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME='lock_row_lock_time';
SELECT count_reset > 100
FROM INFORMATION_SCHEMA.INNODB_METRICS
WHERE NAME='lock_row_lock_time_max';
DROP TABLE t;
--disable_warnings
SET GLOBAL innodb_monitor_reset=default;
SET GLOBAL innodb_monitor_enable=default;
SET GLOBAL innodb_monitor_disable=default;
SET GLOBAL innodb_monitor_reset_all=default;
--enable_warnings
--source include/wait_until_count_sessions.inc