Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
MariaDB
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
nexedi
MariaDB
Commits
7d2138d4
Commit
7d2138d4
authored
Feb 18, 2019
by
Daniele Sciascia
Committed by
Jan Lindström
Feb 18, 2019
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
MTR tests for galera sync wait up to
parent
3f154943
Changes
5
Show whitespace changes
Inline
Side-by-side
Showing
5 changed files
with
265 additions
and
0 deletions
+265
-0
mysql-test/suite/galera/r/galera_last_committed_id.result
mysql-test/suite/galera/r/galera_last_committed_id.result
+38
-0
mysql-test/suite/galera/r/galera_sync_wait_upto.result
mysql-test/suite/galera/r/galera_sync_wait_upto.result
+43
-0
mysql-test/suite/galera/t/galera_last_committed_id.test
mysql-test/suite/galera/t/galera_last_committed_id.test
+68
-0
mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt
mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt
+1
-0
mysql-test/suite/galera/t/galera_sync_wait_upto.test
mysql-test/suite/galera/t/galera_sync_wait_upto.test
+115
-0
No files found.
mysql-test/suite/galera/r/galera_last_committed_id.result
0 → 100644
View file @
7d2138d4
connection node_2;
connection node_1;
SELECT WSREP_LAST_WRITTEN_GTID() = '00000000-0000-0000-0000-000000000000:-1';
WSREP_LAST_WRITTEN_GTID() = '00000000-0000-0000-0000-000000000000:-1'
1
wsrep_last_committed_id_match
1
connect node_1a, 127.0.0.1, root, , test, $NODE_MYPORT_1;
connection node_1a;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
connection node_1;
SELECT WSREP_LAST_WRITTEN_GTID() = '00000000-0000-0000-0000-000000000000:-1';
WSREP_LAST_WRITTEN_GTID() = '00000000-0000-0000-0000-000000000000:-1'
1
connection node_1a;
INSERT INTO t1 VALUES (1);
connection node_1;
wsrep_last_committed_id_match
1
SET AUTOCOMMIT=OFF;
START TRANSACTION;
SELECT WSREP_LAST_WRITTEN_GTID() = '00000000-0000-0000-0000-000000000000:-1';
WSREP_LAST_WRITTEN_GTID() = '00000000-0000-0000-0000-000000000000:-1'
1
INSERT INTO t1 VALUES (1);
SELECT WSREP_LAST_WRITTEN_GTID() = '00000000-0000-0000-0000-000000000000:-1';
WSREP_LAST_WRITTEN_GTID() = '00000000-0000-0000-0000-000000000000:-1'
1
wsrep_last_committed_id_match
1
COMMIT;
wsrep_last_committed_id_advanced
1
wsrep_last_committed_id_advanced
1
SET AUTOCOMMIT=ON;
DROP TABLE t1;
mysql-test/suite/galera/r/galera_sync_wait_upto.result
0 → 100644
View file @
7d2138d4
connection node_2;
connection node_1;
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
INSERT INTO t1 VALUES (1);
SELECT WSREP_SYNC_WAIT_UPTO_GTID(NULL);
ERROR HY000: Incorrect arguments to wsrep_sync_wait_upto_gtid
SELECT WSREP_SYNC_WAIT_UPTO_GTID('a');
ERROR HY000: Incorrect arguments to wsrep_sync_wait_upto_gtid
SELECT WSREP_SYNC_WAIT_UPTO_GTID(2);
ERROR HY000: Incorrect arguments to wsrep_sync_wait_upto_gtid
WSREP_SYNC_WAIT_UPTO
1
WSREP_SYNC_WAIT_UPTO
1
WSREP_SYNC_WAIT_UPTO
1
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connection node_2;
SET GLOBAL DEBUG_DBUG = "d,sync.wsrep_apply_cb";
connection node_1;
INSERT INTO t1 VALUES (2);
INSERT INTO t1 VALUES (3);
connection node_2;
SET SESSION wsrep_sync_wait = 0;
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
connection node_2a;
SET SESSION wsrep_sync_wait = 0;
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
connection node_2;
WSREP_SYNC_WAIT_UPTO
1
gtid_current = gtid_first
1
SET GLOBAL DEBUG_DBUG = "";
SET DEBUG_SYNC = "now SIGNAL signal.wsrep_apply_cb";
WSREP_SYNC_WAIT_UPTO
1
seqno_current = seqno_second
1
SET DEBUG_SYNC = "RESET";
connection node_1;
DROP TABLE t1;
mysql-test/suite/galera/t/galera_last_committed_id.test
0 → 100644
View file @
7d2138d4
#
# Tests functions WSREP_LAST_WRITTEN_GTID and WSREP_LAST_SEEN_GTID
#
--
source
include
/
galera_cluster
.
inc
# Returns -1 if no transactions have been run
SELECT
WSREP_LAST_WRITTEN_GTID
()
=
'00000000-0000-0000-0000-000000000000:-1'
;
--
disable_query_log
--
let
$seqno
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--
let
$state
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_uuid'`
--
eval
SELECT
WSREP_LAST_SEEN_GTID
()
=
'$state:$seqno'
AS
wsrep_last_committed_id_match
;
--
enable_query_log
# WSREP_LAST_WRITTEN_GTID() should not be influenced by transactions committed
# on other connections
--
connect
node_1a
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_1
--
connection
node_1a
CREATE
TABLE
t1
(
f1
INTEGER
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
1
);
--
connection
node_1
SELECT
WSREP_LAST_WRITTEN_GTID
()
=
'00000000-0000-0000-0000-000000000000:-1'
;
# WSREP_LAST_SEEN_GTID() should be influenced by transactions committed
# on other connections
--
connection
node_1a
INSERT
INTO
t1
VALUES
(
1
);
--
disable_query_log
--
let
$wsrep_last_committed_id_conn_1a
=
`SELECT WSREP_LAST_SEEN_GTID()`
--
enable_query_log
--
connection
node_1
--
disable_query_log
--
eval
SELECT
WSREP_LAST_SEEN_GTID
()
=
'$wsrep_last_committed_id_conn_1a'
AS
wsrep_last_committed_id_match
;
--
enable_query_log
# Should not advance while a transaction is in progress
SET
AUTOCOMMIT
=
OFF
;
START
TRANSACTION
;
SELECT
WSREP_LAST_WRITTEN_GTID
()
=
'00000000-0000-0000-0000-000000000000:-1'
;
--
disable_query_log
--
let
$wsrep_last_committed_id_before
=
`SELECT WSREP_LAST_SEEN_GTID()`
--
enable_query_log
INSERT
INTO
t1
VALUES
(
1
);
SELECT
WSREP_LAST_WRITTEN_GTID
()
=
'00000000-0000-0000-0000-000000000000:-1'
;
--
disable_query_log
--
eval
SELECT
WSREP_LAST_SEEN_GTID
()
=
'$wsrep_last_committed_id_before'
AS
wsrep_last_committed_id_match
;
--
enable_query_log
# Should only advance after the transaction has been committed
COMMIT
;
--
disable_query_log
--
let
$seqno
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--
let
$state
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_uuid'`
--
eval
SELECT
WSREP_LAST_WRITTEN_GTID
()
=
'$state:$seqno'
AS
wsrep_last_committed_id_advanced
;
--
eval
SELECT
WSREP_LAST_SEEN_GTID
()
=
'$state:$seqno'
AS
wsrep_last_committed_id_advanced
;
--
enable_query_log
SET
AUTOCOMMIT
=
ON
;
DROP
TABLE
t1
;
mysql-test/suite/galera/t/galera_sync_wait_upto-master.opt
0 → 100644
View file @
7d2138d4
--wsrep-sync-wait=0 --wsrep-causal-reads=OFF
\ No newline at end of file
mysql-test/suite/galera/t/galera_sync_wait_upto.test
0 → 100644
View file @
7d2138d4
#
# Tests the wsrep_sync_wait_upto variable.
#
--
source
include
/
galera_cluster
.
inc
--
source
include
/
have_debug_sync
.
inc
CREATE
TABLE
t1
(
f1
INTEGER
)
ENGINE
=
InnoDB
;
INSERT
INTO
t1
VALUES
(
1
);
# Test with invalid values
--
error
ER_WRONG_ARGUMENTS
SELECT
WSREP_SYNC_WAIT_UPTO_GTID
(
NULL
);
--
error
ER_WRONG_ARGUMENTS
SELECT
WSREP_SYNC_WAIT_UPTO_GTID
(
'a'
);
--
error
ER_WRONG_ARGUMENTS
SELECT
WSREP_SYNC_WAIT_UPTO_GTID
(
2
);
# If set to low value, expect no waiting
--
disable_query_log
--
let
$seqno
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'`
--
let
$state
=
`SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_local_state_uuid'`
--
enable_query_log
--
disable_query_log
--
eval
SELECT
WSREP_SYNC_WAIT_UPTO_GTID
(
'00000000-0000-0000-0000-000000000000:-1'
)
AS
WSREP_SYNC_WAIT_UPTO
;
--
enable_query_log
--
disable_query_log
--
eval
SELECT
WSREP_SYNC_WAIT_UPTO_GTID
(
'$state:0'
)
AS
WSREP_SYNC_WAIT_UPTO
;
--
enable_query_log
# If set to current last_committed value
--
disable_query_log
--
eval
SELECT
WSREP_SYNC_WAIT_UPTO_GTID
(
'$state:$seqno'
)
AS
WSREP_SYNC_WAIT_UPTO
;
--
enable_query_log
# If set to very high value, will wait
--
disable_query_log
--
error
ER_LOCK_WAIT_TIMEOUT
--
eval
SELECT
WSREP_SYNC_WAIT_UPTO_GTID
(
'$state:9223372036854775807'
,
1
)
AS
WSREP_SYNC_WAIT_UPTO
;
--
enable_query_log
# If applier is blocked, will wait
--
connection
node_2
SET
GLOBAL
DEBUG_DBUG
=
"d,sync.wsrep_apply_cb"
;
--
connection
node_1
# Perform two inserts and record the IDs of each
INSERT
INTO
t1
VALUES
(
2
);
--
let
$gtid_first
=
`SELECT WSREP_LAST_WRITTEN_GTID()`
INSERT
INTO
t1
VALUES
(
3
);
--
let
$gtid_second
=
`SELECT WSREP_LAST_WRITTEN_GTID()`
--
connection
node_2
SET
SESSION
wsrep_sync_wait
=
0
;
--
disable_query_log
--
error
ER_LOCK_WAIT_TIMEOUT
--
eval
SELECT
WSREP_SYNC_WAIT_UPTO_GTID
(
'$gtid_first'
,
1
)
AS
WSREP_SYNC_WAIT_UPTO
;
--
enable_query_log
--
disable_query_log
--
send_eval
SELECT
WSREP_SYNC_WAIT_UPTO_GTID
(
'$gtid_first'
)
AS
WSREP_SYNC_WAIT_UPTO
;
--
enable_query_log
# Unblock applier
--
connect
node_2a
,
127.0
.
0.1
,
root
,
,
test
,
$NODE_MYPORT_2
--
connection
node_2a
SET
SESSION
wsrep_sync_wait
=
0
;
--
let
$wait_condition
=
SELECT
COUNT
(
*
)
=
1
FROM
INFORMATION_SCHEMA
.
PROCESSLIST
WHERE
INFO
LIKE
'SELECT WSREP_SYNC_WAIT%'
;
--
source
include
/
wait_condition
.
inc
SET
DEBUG_SYNC
=
"now SIGNAL signal.wsrep_apply_cb"
;
--
connection
node_2
--
reap
# Confirm that we were allowed to proceed when the applier reached $seqno_first
--
let
$gtid_current
=
`SELECT WSREP_LAST_SEEN_GTID()`
--
disable_query_log
--
eval
SELECT
'$gtid_current'
=
'$gtid_first'
AS
`gtid_current = gtid_first`
--
enable_query_log
SET
GLOBAL
DEBUG_DBUG
=
""
;
SET
DEBUG_SYNC
=
"now SIGNAL signal.wsrep_apply_cb"
;
# Move forward some more, to $seqno_second;
--
disable_query_log
--
eval
SELECT
WSREP_SYNC_WAIT_UPTO_GTID
(
'$gtid_second'
)
AS
WSREP_SYNC_WAIT_UPTO
;
--
enable_query_log
--
let
$gtid_current
=
`SELECT WSREP_LAST_SEEN_GTID()`
--
disable_query_log
--
eval
SELECT
'$gtid_current'
=
'$gtid_second'
AS
`seqno_current = seqno_second`
--
enable_query_log
SET
DEBUG_SYNC
=
"RESET"
;
--
connection
node_1
DROP
TABLE
t1
;
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment