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

Merge 10.3 into 10.4

This commit is contained in:
Marko Mäkelä
2019-02-05 12:48:02 +02:00
126 changed files with 6707 additions and 1109 deletions

View File

@@ -0,0 +1,17 @@
--- r/wsrep-recover-v25.result 2019-02-05 12:33:42.681586950 +0200
+++ r/wsrep-recover-v25.reject 2019-02-05 12:34:41.661752903 +0200
@@ -18,11 +18,10 @@
connection default;
SET DEBUG_SYNC = "now WAIT_FOR after_prepare_reached";
# Kill the server
-Expect seqno 7
-7
-Expect 5 7
+Expect seqno 6
+6
+Expect 5
SELECT * FROM t1;
f1
5
-7
DROP TABLE t1;

View File

@@ -0,0 +1,28 @@
# Kill the server
Expect seqno 1
1
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
# Kill the server
Expect seqno 3
3
INSERT INTO t1 VALUES (5);
# Kill the server
Expect seqno 5
5
SELECT VARIABLE_VALUE `expect 6` FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed';
expect 6
6
connect con1, localhost, root;
SET DEBUG_SYNC = "ha_commit_trans_after_prepare SIGNAL after_prepare_reached WAIT_FOR continue";
INSERT INTO t1 VALUES (7);
connection default;
SET DEBUG_SYNC = "now WAIT_FOR after_prepare_reached";
# Kill the server
Expect seqno 7
7
Expect 5 7
SELECT * FROM t1;
f1
5
7
DROP TABLE t1;

View File

@@ -0,0 +1,7 @@
!include ../my.cnf
[mysqld.1]
wsrep-on=ON
wsrep-cluster-address=gcomm://
wsrep-provider=@ENV.WSREP_PROVIDER
binlog-format=ROW

View File

@@ -0,0 +1,4 @@
[binlogon]
log-bin
[binlogoff]

View File

@@ -0,0 +1,121 @@
#
# Verify that the wsrep XID gets updated in InnoDB rollback segment
# properly and can be recovered with --wsrep-recover
#
# The test runs the following scenarios:
#
# 1) The server is started but no SQL is run
# 2) DDL is executed
# 3) INSERT is executed
# 4) Two INSERTs are executed so that the first one in order will be
# blocked after certification and the second one before entering
# commit order critical section.
# 5) Two DMLs are executed so that the prepare step is run out of order.
# Both transactions are blocked before commit order critical section.
#
# After each scenario server is killed and the recovered position
# is validated.
#
--source include/have_wsrep.inc
--source include/have_innodb.inc
--source include/have_wsrep_provider.inc
--source include/have_debug_sync.inc
#
# Binlog option for recovery run. This must be set in the test because
# combinations file causes log-bin option to be set from command line,
# not via my.cnf.
#
--let $log_bin = `SELECT @@log_bin`
if ($log_bin) {
--let $wsrep_recover_binlog_opt = --log-bin
}
#
# Scenario 1
# The expected recovered seqno is 1 corresponding to initial cluster
# configuration change.
#
--source include/kill_mysqld.inc
--source wsrep-recover-step.inc
--echo Expect seqno 1
--echo $wsrep_recover_start_position_seqno
--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno
--source include/start_mysqld.inc
--source include/wait_wsrep_ready.inc
#
# Senario 2
# The expected recovered seqno is 3 corresponding to two configuration
# changes and CREATE TABLE
#
CREATE TABLE t1 (f1 INT PRIMARY KEY) ENGINE=InnoDB;
--source include/kill_mysqld.inc
--source wsrep-recover-step.inc
--echo Expect seqno 3
--echo $wsrep_recover_start_position_seqno
--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno
--source include/start_mysqld.inc
--source include/wait_wsrep_ready.inc
#
# Scenario 3
# The expected recovered seqno is 5 corresponding to three configuration
# changes, CREATE TABLE and INSERT.
#
# The expected wsrep_last_committed after the server is restarted is 6.
#
INSERT INTO t1 VALUES (5);
--source include/kill_mysqld.inc
--source wsrep-recover-step.inc
--echo Expect seqno 5
--echo $wsrep_recover_start_position_seqno
--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno
--source include/start_mysqld.inc
--source include/wait_wsrep_ready.inc
SELECT VARIABLE_VALUE `expect 6` FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed';
#
# Scenario 4
#
# The INSERT gets prepared but not committed.
#
# If binlog is off, the expected outcome is that the INSERT gets committed
# since it is already committed in the cluster. If binlog is on, the INSERT
# should be rolled back during recovery phase since it has not yet
# been logged into binlog.
#
--connect con1, localhost, root
SET DEBUG_SYNC = "ha_commit_trans_after_prepare SIGNAL after_prepare_reached WAIT_FOR continue";
--send INSERT INTO t1 VALUES (7)
--connection default
SET DEBUG_SYNC = "now WAIT_FOR after_prepare_reached";
--source include/kill_mysqld.inc
--source wsrep-recover-step.inc
if ($log_bin) {
--echo Expect seqno 6
}
if (!$log_bin) {
--echo Expect seqno 7
}
--echo $wsrep_recover_start_position_seqno
--let $restart_parameters = --wsrep-start-position=$wsrep_recover_start_position_uuid:$wsrep_recover_start_position_seqno
--source include/start_mysqld.inc
--source include/wait_wsrep_ready.inc
if ($log_bin) {
--echo Expect 5
}
if (!$log_bin) {
--echo Expect 5 7
}
SELECT * FROM t1;
DROP TABLE t1;