Commit a2d5a543 authored by Nirbhay Choubey's avatar Nirbhay Choubey

Added a basic test for wsrep_sync_wait system variable.

Also made some coding style related changes.
parent 5add5855
...@@ -862,8 +862,8 @@ The following options may be given as the first argument: ...@@ -862,8 +862,8 @@ The following options may be given as the first argument:
variables variables
(Defaults to on; use --skip-wsrep-auto-increment-control to disable.) (Defaults to on; use --skip-wsrep-auto-increment-control to disable.)
--wsrep-causal-reads --wsrep-causal-reads
Enable "strictly synchronous" semantics for read (DEPRECATED) Setting this variable is equivalent to
operations setting wsrep_sync_wait READ flag
--wsrep-certify-nonPK --wsrep-certify-nonPK
Certify tables with no primary key Certify tables with no primary key
(Defaults to on; use --skip-wsrep-certify-nonPK to disable.) (Defaults to on; use --skip-wsrep-certify-nonPK to disable.)
...@@ -937,6 +937,11 @@ The following options may be given as the first argument: ...@@ -937,6 +937,11 @@ The following options may be given as the first argument:
Address where node is waiting for SST contact Address where node is waiting for SST contact
--wsrep-start-position=name --wsrep-start-position=name
global transaction position to start from global transaction position to start from
--wsrep-sync-wait[=#]
Ensure "synchronous" read view before executing an
operation of the type specified by bitmask: 1 -
READ(includes SELECT, SHOW and BEGIN/START TRANSACTION);
2 - UPDATE and DELETE; 4 - INSERT and REPLACE
Variables (--variable-name=value) Variables (--variable-name=value)
allow-suspicious-udfs FALSE allow-suspicious-udfs FALSE
...@@ -1223,6 +1228,7 @@ wsrep-sst-donor-rejects-queries FALSE ...@@ -1223,6 +1228,7 @@ wsrep-sst-donor-rejects-queries FALSE
wsrep-sst-method rsync wsrep-sst-method rsync
wsrep-sst-receive-address AUTO wsrep-sst-receive-address AUTO
wsrep-start-position 00000000-0000-0000-0000-000000000000:-1 wsrep-start-position 00000000-0000-0000-0000-000000000000:-1
wsrep-sync-wait 0
To see what values a running MySQL server is using, type To see what values a running MySQL server is using, type
'mysqladmin variables' instead of 'mysqld --verbose --help'. 'mysqladmin variables' instead of 'mysqld --verbose --help'.
#
# wsrep_sync_wait
#
# save the initial values
SET @wsrep_sync_wait_global_saved = @@global.wsrep_sync_wait;
SET @wsrep_sync_wait_session_saved = @@session.wsrep_sync_wait;
# default
SELECT @@global.wsrep_sync_wait;
@@global.wsrep_sync_wait
0
SELECT @@session.wsrep_sync_wait;
@@session.wsrep_sync_wait
0
# scope and valid values
SET @@global.wsrep_sync_wait=0;
SELECT @@global.wsrep_sync_wait;
@@global.wsrep_sync_wait
0
SET @@global.wsrep_sync_wait=7;
SELECT @@global.wsrep_sync_wait;
@@global.wsrep_sync_wait
7
SET @@session.wsrep_sync_wait=0;
SELECT @@session.wsrep_sync_wait;
@@session.wsrep_sync_wait
0
SET @@session.wsrep_sync_wait=7;
SELECT @@session.wsrep_sync_wait;
@@session.wsrep_sync_wait
7
SET @@session.wsrep_sync_wait=default;
SELECT @@session.wsrep_sync_wait;
@@session.wsrep_sync_wait
7
SET @@session.wsrep_sync_wait=8;
Warnings:
Warning 1292 Truncated incorrect wsrep_sync_wait value: '8'
SELECT @@session.wsrep_sync_wait;
@@session.wsrep_sync_wait
7
# invalid values
SET @@global.wsrep_sync_wait=NULL;
ERROR 42000: Incorrect argument type to variable 'wsrep_sync_wait'
SET @@global.wsrep_sync_wait='junk';
ERROR 42000: Incorrect argument type to variable 'wsrep_sync_wait'
SET @@session.wsrep_sync_wait=NULL;
ERROR 42000: Incorrect argument type to variable 'wsrep_sync_wait'
SET @@session.wsrep_sync_wait='junk';
ERROR 42000: Incorrect argument type to variable 'wsrep_sync_wait'
# restore the initial values
SET @@global.wsrep_sync_wait = @wsrep_sync_wait_global_saved;
SET @@session.wsrep_sync_wait = @wsrep_sync_wait_session_saved;
# End of test
--source include/have_wsrep.inc
--echo #
--echo # wsrep_sync_wait
--echo #
--echo # save the initial values
SET @wsrep_sync_wait_global_saved = @@global.wsrep_sync_wait;
SET @wsrep_sync_wait_session_saved = @@session.wsrep_sync_wait;
--echo # default
SELECT @@global.wsrep_sync_wait;
SELECT @@session.wsrep_sync_wait;
--echo
--echo # scope and valid values
SET @@global.wsrep_sync_wait=0;
SELECT @@global.wsrep_sync_wait;
SET @@global.wsrep_sync_wait=7;
SELECT @@global.wsrep_sync_wait;
SET @@session.wsrep_sync_wait=0;
SELECT @@session.wsrep_sync_wait;
SET @@session.wsrep_sync_wait=7;
SELECT @@session.wsrep_sync_wait;
SET @@session.wsrep_sync_wait=default;
SELECT @@session.wsrep_sync_wait;
SET @@session.wsrep_sync_wait=8;
SELECT @@session.wsrep_sync_wait;
--echo
--echo # invalid values
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_sync_wait=NULL;
--error ER_WRONG_TYPE_FOR_VAR
SET @@global.wsrep_sync_wait='junk';
--error ER_WRONG_TYPE_FOR_VAR
SET @@session.wsrep_sync_wait=NULL;
--error ER_WRONG_TYPE_FOR_VAR
SET @@session.wsrep_sync_wait='junk';
--echo
--echo # restore the initial values
SET @@global.wsrep_sync_wait = @wsrep_sync_wait_global_saved;
SET @@session.wsrep_sync_wait = @wsrep_sync_wait_session_saved;
--echo # End of test
...@@ -3865,19 +3865,20 @@ static Sys_var_mybool Sys_wsrep_certify_nonPK( ...@@ -3865,19 +3865,20 @@ static Sys_var_mybool Sys_wsrep_certify_nonPK(
CMD_LINE(OPT_ARG), DEFAULT(TRUE)); CMD_LINE(OPT_ARG), DEFAULT(TRUE));
static Sys_var_mybool Sys_wsrep_causal_reads( static Sys_var_mybool Sys_wsrep_causal_reads(
"wsrep_causal_reads", "(DEPRECATED) setting this variable is equivalent to setting wsrep_sync_wait READ flag", "wsrep_causal_reads", "(DEPRECATED) Setting this variable is equivalent "
SESSION_VAR(wsrep_causal_reads), "to setting wsrep_sync_wait READ flag",
CMD_LINE(OPT_ARG), DEFAULT(FALSE), SESSION_VAR(wsrep_causal_reads), CMD_LINE(OPT_ARG), DEFAULT(FALSE),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
ON_UPDATE(wsrep_causal_reads_update)); ON_UPDATE(wsrep_causal_reads_update));
static Sys_var_uint Sys_wsrep_sync_wait( static Sys_var_uint Sys_wsrep_sync_wait(
"wsrep_sync_wait", "Ensure \"synchronous\" read view before executing an operation of the type specified by bitmask: 1 - READ(includes SELECT, SHOW and BEGIN/START TRANSACTION); 2 - UPDATE and DELETE; 4 - INSERT and REPLACE", "wsrep_sync_wait", "Ensure \"synchronous\" read view before executing "
SESSION_VAR(wsrep_sync_wait), "an operation of the type specified by bitmask: 1 - READ(includes "
CMD_LINE(OPT_ARG), "SELECT, SHOW and BEGIN/START TRANSACTION); 2 - UPDATE and DELETE; 4 - "
"INSERT and REPLACE",
SESSION_VAR(wsrep_sync_wait), CMD_LINE(OPT_ARG),
VALID_RANGE(WSREP_SYNC_WAIT_NONE, WSREP_SYNC_WAIT_MAX), VALID_RANGE(WSREP_SYNC_WAIT_NONE, WSREP_SYNC_WAIT_MAX),
DEFAULT(WSREP_SYNC_WAIT_NONE), DEFAULT(WSREP_SYNC_WAIT_NONE), BLOCK_SIZE(1),
BLOCK_SIZE(1),
NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0), NO_MUTEX_GUARD, NOT_IN_BINLOG, ON_CHECK(0),
ON_UPDATE(wsrep_sync_wait_update)); ON_UPDATE(wsrep_sync_wait_update));
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment