Commit fba683c0 authored by Jan Lindström's avatar Jan Lindström

MDEV-17062: Test failure on galera.MW-336

MDEV-17058: Test failure on wsrep.variables
MDEV-17060: Test failure on galera.galera_var_slave_threads

Fix incorrect calculation of increased applier (slave) threads.
Note that increase change takes effect "immediately" but we should
use proper wait condition to wait it. Reducing the number of
slave threads is not immediate as thread will only exit after a
replication event.
parent 653038cc
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t1 values(0);
SET GLOBAL wsrep_slave_threads = 10; SET GLOBAL wsrep_slave_threads = 10;
SET GLOBAL wsrep_slave_threads = 1; SET GLOBAL wsrep_slave_threads = 1;
INSERT INTO t1 VALUES (1); # Wait 10 slave threads to start 1
# Generate 12 replication events
SELECT COUNT(*) FROM t1;
COUNT(*)
13
# Wait 9 slave threads to exit 1
SET GLOBAL wsrep_slave_threads = 10; SET GLOBAL wsrep_slave_threads = 10;
# Wait 10 slave threads to start 2
SET GLOBAL wsrep_slave_threads = 20; SET GLOBAL wsrep_slave_threads = 20;
# Wait 20 slave threads to start 3
SET GLOBAL wsrep_slave_threads = 1; SET GLOBAL wsrep_slave_threads = 1;
INSERT INTO t1 VALUES (1); # Generate 40 replication events
INSERT INTO t1 VALUES (2); SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES (3); COUNT(*)
INSERT INTO t1 VALUES (4); 53
INSERT INTO t1 VALUES (5); # Wait 10 slave threads to exit 3
INSERT INTO t1 VALUES (6);
INSERT INTO t1 VALUES (7);
INSERT INTO t1 VALUES (8);
INSERT INTO t1 VALUES (9);
SET GLOBAL wsrep_slave_threads = 10; SET GLOBAL wsrep_slave_threads = 10;
SET GLOBAL wsrep_slave_threads = 0; SET GLOBAL wsrep_slave_threads = 0;
Warnings: Warnings:
Warning 1292 Truncated incorrect wsrep_slave_threads value: '0' Warning 1292 Truncated incorrect wsrep_slave_threads value: '0'
INSERT INTO t1 VALUES (10); # Wait 10 slave threads to start 3
INSERT INTO t1 VALUES (11); # Generate 12 replication events
INSERT INTO t1 VALUES (12); SELECT COUNT(*) FROM t1;
INSERT INTO t1 VALUES (13); COUNT(*)
INSERT INTO t1 VALUES (14); 65
INSERT INTO t1 VALUES (15); # Wait 10 slave threads to exit 4
INSERT INTO t1 VALUES (16);
INSERT INTO t1 VALUES (17);
INSERT INTO t1 VALUES (18);
INSERT INTO t1 VALUES (19);
INSERT INTO t1 VALUES (20);
SET GLOBAL wsrep_slave_threads = 1;
DROP TABLE t1; DROP TABLE t1;
...@@ -53,71 +53,3 @@ WSREP_SST_DONOR_REJECTS_QUERIES OFF ...@@ -53,71 +53,3 @@ WSREP_SST_DONOR_REJECTS_QUERIES OFF
WSREP_SST_METHOD rsync WSREP_SST_METHOD rsync
WSREP_SYNC_WAIT 15 WSREP_SYNC_WAIT 15
<BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.recover = no; gcache.size = 10M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; <REPL_PROTO_MAX>;socket.checksum = 2; socket.recv_buf_size = 212992; <BASE_DIR>; <BASE_HOST>; <BASE_PORT>; cert.log_conflicts = no; debug = no; evs.auto_evict = 0; evs.causal_keepalive_period = PT1S; evs.debug_log_mask = 0x1; evs.delay_margin = PT1S; evs.delayed_keep_period = PT30S; evs.inactive_check_period = PT0.5S; evs.inactive_timeout = PT30S; evs.info_log_mask = 0; evs.install_timeout = PT15S; evs.join_retrans_period = PT1S; evs.keepalive_period = PT1S; evs.max_install_timeouts = 3; evs.send_window = 4; evs.stats_report_period = PT1M; evs.suspect_timeout = PT10S; evs.use_aggregate = true; evs.user_send_window = 2; evs.version = 0; evs.view_forget_timeout = P1D; <GCACHE_DIR>; gcache.keep_pages_size = 0; gcache.mem_size = 0; <GCACHE_NAME>; gcache.page_size = 128M; gcache.recover = no; gcache.size = 10M; gcomm.thread_prio = ; gcs.fc_debug = 0; gcs.fc_factor = 1.0; gcs.fc_limit = 16; gcs.fc_master_slave = no; gcs.max_packet_size = 64500; gcs.max_throttle = 0.25; <GCS_RECV_Q_HARD_LIMIT>; gcs.recv_q_soft_limit = 0.25; gcs.sync_donor = no; <GMCAST_LISTEN_ADDR>; gmcast.mcast_addr = ; gmcast.mcast_ttl = 1; gmcast.peer_timeout = PT3S; gmcast.segment = 0; gmcast.time_wait = PT5S; gmcast.version = 0; <IST_RECV_ADDR>; pc.announce_timeout = PT3S; pc.checksum = false; pc.ignore_quorum = false; pc.ignore_sb = false; pc.linger = PT20S; pc.npvo = false; pc.recovery = true; pc.version = 0; pc.wait_prim = true; pc.wait_prim_timeout = PT30S; pc.weight = 1; protonet.backend = asio; protonet.version = 0; repl.causal_read_timeout = PT90S; repl.commit_order = 3; repl.key_format = FLAT8; repl.max_ws_size = 2147483647; <REPL_PROTO_MAX>;socket.checksum = 2; socket.recv_buf_size = 212992;
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME LIKE 'wsrep_%'
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
COUNT(*)
58
SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME LIKE 'wsrep_%'
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'
ORDER BY VARIABLE_NAME;
VARIABLE_NAME
WSREP_APPLY_OOOE
WSREP_APPLY_OOOL
WSREP_APPLY_WINDOW
WSREP_CAUSAL_READS
WSREP_CERT_DEPS_DISTANCE
WSREP_CERT_INDEX_SIZE
WSREP_CERT_INTERVAL
WSREP_CLUSTER_CONF_ID
WSREP_CLUSTER_SIZE
WSREP_CLUSTER_STATE_UUID
WSREP_CLUSTER_STATUS
WSREP_COMMIT_OOOE
WSREP_COMMIT_OOOL
WSREP_COMMIT_WINDOW
WSREP_CONNECTED
WSREP_DESYNC_COUNT
WSREP_EVS_DELAYED
WSREP_EVS_EVICT_LIST
WSREP_EVS_REPL_LATENCY
WSREP_EVS_STATE
WSREP_FLOW_CONTROL_PAUSED
WSREP_FLOW_CONTROL_PAUSED_NS
WSREP_FLOW_CONTROL_RECV
WSREP_FLOW_CONTROL_SENT
WSREP_GCOMM_UUID
WSREP_INCOMING_ADDRESSES
WSREP_LAST_COMMITTED
WSREP_LOCAL_BF_ABORTS
WSREP_LOCAL_CACHED_DOWNTO
WSREP_LOCAL_CERT_FAILURES
WSREP_LOCAL_COMMITS
WSREP_LOCAL_INDEX
WSREP_LOCAL_RECV_QUEUE
WSREP_LOCAL_RECV_QUEUE_AVG
WSREP_LOCAL_RECV_QUEUE_MAX
WSREP_LOCAL_RECV_QUEUE_MIN
WSREP_LOCAL_REPLAYS
WSREP_LOCAL_SEND_QUEUE
WSREP_LOCAL_SEND_QUEUE_AVG
WSREP_LOCAL_SEND_QUEUE_MAX
WSREP_LOCAL_SEND_QUEUE_MIN
WSREP_LOCAL_STATE
WSREP_LOCAL_STATE_COMMENT
WSREP_LOCAL_STATE_UUID
WSREP_PROTOCOL_VERSION
WSREP_PROVIDER_NAME
WSREP_PROVIDER_VENDOR
WSREP_PROVIDER_VERSION
WSREP_READY
WSREP_RECEIVED
WSREP_RECEIVED_BYTES
WSREP_REPLICATED
WSREP_REPLICATED_BYTES
WSREP_REPL_DATA_BYTES
WSREP_REPL_KEYS
WSREP_REPL_KEYS_BYTES
WSREP_REPL_OTHER_BYTES
WSREP_THREAD_COUNT
...@@ -26,70 +26,6 @@ SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system use ...@@ -26,70 +26,6 @@ SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system use
COUNT(*) = 1 COUNT(*) = 1
1 1
SET GLOBAL wsrep_slave_threads = 1; SET GLOBAL wsrep_slave_threads = 1;
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
INSERT INTO t2 VALUES (DEFAULT);
SELECT COUNT(*) = 64 FROM t2; SELECT COUNT(*) = 64 FROM t2;
COUNT(*) = 64 COUNT(*) = 64
1 1
......
...@@ -6,62 +6,118 @@ ...@@ -6,62 +6,118 @@
--source include/have_innodb.inc --source include/have_innodb.inc
CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB; CREATE TABLE t1 (f1 INTEGER) Engine=InnoDB;
INSERT INTO t1 values(0);
--connection node_1 --connection node_1
SET GLOBAL wsrep_slave_threads = 10; SET GLOBAL wsrep_slave_threads = 10;
SET GLOBAL wsrep_slave_threads = 1; SET GLOBAL wsrep_slave_threads = 1;
--let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
--echo # Wait 10 slave threads to start 1
--let $wait_timeout=600
--let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
--source include/wait_condition.inc --source include/wait_condition.inc
--connection node_2 --connection node_2
INSERT INTO t1 VALUES (1); # Wait until inserts are replicated
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
--echo # Generate 12 replication events
--disable_query_log
--disable_result_log
--let $count = 12
while ($count)
{
INSERT INTO t1 VALUES (1);
--dec $count
}
--enable_result_log
--enable_query_log
--connection node_1 --connection node_1
# Wait until inserts are replicated
--let $wait_condition = SELECT COUNT(*) = 13 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) FROM t1;
--echo # Wait 9 slave threads to exit 1
# Wait until appliers exit
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
--source include/wait_condition.inc
SET GLOBAL wsrep_slave_threads = 10; SET GLOBAL wsrep_slave_threads = 10;
--echo # Wait 10 slave threads to start 2
--let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; --let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
--source include/wait_condition.inc --source include/wait_condition.inc
SET GLOBAL wsrep_slave_threads = 20; SET GLOBAL wsrep_slave_threads = 20;
--echo # Wait 20 slave threads to start 3
--let $wait_condition = SELECT COUNT(*) = 21 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; --let $wait_condition = SELECT COUNT(*) = 21 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
--source include/wait_condition.inc --source include/wait_condition.inc
SET GLOBAL wsrep_slave_threads = 1; SET GLOBAL wsrep_slave_threads = 1;
--connection node_2 --connection node_2
INSERT INTO t1 VALUES (1); --echo # Generate 40 replication events
INSERT INTO t1 VALUES (2); --disable_query_log
INSERT INTO t1 VALUES (3); --disable_result_log
INSERT INTO t1 VALUES (4); --let $count = 40
INSERT INTO t1 VALUES (5); while ($count)
INSERT INTO t1 VALUES (6); {
INSERT INTO t1 VALUES (7); INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (8); --dec $count
INSERT INTO t1 VALUES (9); }
--enable_query_log
--enable_result_log
--connection node_1 --connection node_1
--let $wait_condition = SELECT COUNT(*) = 12 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
# Wait until inserts are replicated
--let $wait_condition = SELECT COUNT(*) = 53 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) FROM t1;
--echo # Wait 10 slave threads to exit 3
# Wait until appliers exit
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
--source include/wait_condition.inc --source include/wait_condition.inc
SET GLOBAL wsrep_slave_threads = 10; SET GLOBAL wsrep_slave_threads = 10;
SET GLOBAL wsrep_slave_threads = 0; SET GLOBAL wsrep_slave_threads = 0;
--echo # Wait 10 slave threads to start 3
--let $wait_timeout=600
--let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
--source include/wait_condition.inc
--connection node_2 --connection node_2
INSERT INTO t1 VALUES (10); --echo # Generate 12 replication events
INSERT INTO t1 VALUES (11); --disable_query_log
INSERT INTO t1 VALUES (12); --disable_result_log
INSERT INTO t1 VALUES (13); --let $count = 12
INSERT INTO t1 VALUES (14); while ($count)
INSERT INTO t1 VALUES (15); {
INSERT INTO t1 VALUES (16); INSERT INTO t1 VALUES (1);
INSERT INTO t1 VALUES (17); --dec $count
INSERT INTO t1 VALUES (18); }
INSERT INTO t1 VALUES (19); --enable_result_log
INSERT INTO t1 VALUES (20); --enable_query_log
--connection node_1 --connection node_1
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; # Wait until inserts are replicated
--let $wait_condition = SELECT COUNT(*) = 65 FROM t1;
--source include/wait_condition.inc --source include/wait_condition.inc
SET GLOBAL wsrep_slave_threads = 1; SELECT COUNT(*) FROM t1;
--echo # Wait 10 slave threads to exit 4
# Wait until appliers exit
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
--source include/wait_condition.inc
--connection node_1
DROP TABLE t1; DROP TABLE t1;
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
# Make sure that the test is operating on the right version of galera library. # Make sure that the test is operating on the right version of galera library.
--disable_query_log --disable_query_log
--let $galera_version=3.20 --let $galera_version=25.3.20
source ../wsrep/include/check_galera_version.inc; source ../wsrep/include/check_galera_version.inc;
--enable_query_log --enable_query_log
...@@ -59,14 +59,3 @@ ORDER BY VARIABLE_NAME; ...@@ -59,14 +59,3 @@ ORDER BY VARIABLE_NAME;
$wsrep_provider_options =~ s/repl.proto_max = .*?;\s*/<REPL_PROTO_MAX>;/sgio; $wsrep_provider_options =~ s/repl.proto_max = .*?;\s*/<REPL_PROTO_MAX>;/sgio;
print $wsrep_provider_options."\n"; print $wsrep_provider_options."\n";
EOF EOF
# Global Status
SELECT COUNT(*) FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME LIKE 'wsrep_%'
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters';
SELECT VARIABLE_NAME FROM INFORMATION_SCHEMA.GLOBAL_STATUS
WHERE VARIABLE_NAME LIKE 'wsrep_%'
AND VARIABLE_NAME != 'wsrep_debug_sync_waiters'
ORDER BY VARIABLE_NAME;
...@@ -34,7 +34,12 @@ SET GLOBAL wsrep_slave_threads = 64; ...@@ -34,7 +34,12 @@ SET GLOBAL wsrep_slave_threads = 64;
INSERT INTO t1 VALUES (1); INSERT INTO t1 VALUES (1);
--connection node_2 --connection node_2
--let $wait_timeout=600
--let $wait_condition = SELECT COUNT(*) = 1 FROM t1;
--source include/wait_condition.inc
SELECT COUNT(*) = 1 FROM t1; SELECT COUNT(*) = 1 FROM t1;
--let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; --let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
--source include/wait_condition.inc --source include/wait_condition.inc
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
...@@ -47,6 +52,8 @@ SET GLOBAL wsrep_slave_threads = 1; ...@@ -47,6 +52,8 @@ SET GLOBAL wsrep_slave_threads = 1;
--connection node_1 --connection node_1
--disable_result_log
--disable_query_log
# Generate 64 replication events # Generate 64 replication events
--let $count = 64 --let $count = 64
while ($count) while ($count)
...@@ -54,9 +61,15 @@ while ($count) ...@@ -54,9 +61,15 @@ while ($count)
INSERT INTO t2 VALUES (DEFAULT); INSERT INTO t2 VALUES (DEFAULT);
--dec $count --dec $count
} }
--enable_query_log
--enable_result_log
--connection node_2 --connection node_2
--let $wait_condition = SELECT COUNT(*) = 64 FROM t2;
--source include/wait_condition.inc
SELECT COUNT(*) = 64 FROM t2; SELECT COUNT(*) = 64 FROM t2;
--let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user'; --let $wait_condition = SELECT COUNT(*) = @@wsrep_slave_threads + 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user';
--source include/wait_condition.inc --source include/wait_condition.inc
SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%'; SELECT COUNT(*) = 1 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND STATE LIKE '%wsrep aborter%';
......
...@@ -17,23 +17,27 @@ ...@@ -17,23 +17,27 @@
eval SET @GALERA_VERSION='$galera_version'; eval SET @GALERA_VERSION='$galera_version';
SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @GALERA_MAJOR_VERSION; SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @GALERA_MAJOR_VERSION;
SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @GALERA_MINOR_VERSION; SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @GALERA_MINOR_VERSION;
SELECT CAST(REGEXP_REPLACE(@GALERA_VERSION,'^(\\d+)\\.(\\d+)\\.(\\d+).*','\\3') AS UNSIGNED) INTO @GALERA_RELEASE_VERSION;
# Actual # Actual
SELECT VARIABLE_VALUE INTO @ACTUAL_GALERA_VERSION FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_provider_version'; SELECT VARIABLE_VALUE INTO @ACTUAL_GALERA_VERSION FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME LIKE 'wsrep_provider_version';
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_MINOR_VERSION;
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\1') AS UNSIGNED) INTO @ACTUAL_GALERA_MAJOR_VERSION; SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @ACTUAL_GALERA_RELEASE_VERSION;
SELECT CAST(REGEXP_REPLACE(@ACTUAL_GALERA_VERSION,'^(\\d+)\\.(\\d+).*','\\2') AS UNSIGNED) INTO @ACTUAL_GALERA_MINOR_VERSION;
# For testing # For testing
#SELECT @GALERA_MAJOR_VERSION, @GALERA_MINOR_VERSION; #SELECT @GALERA_MAJOR_VERSION;
#SELECT @GALERA_MINOR_VERSION;
#SELECT @GALERA_RELEASE_VERSION;
#SELECT @ACTUAL_GALERA_VERSION; #SELECT @ACTUAL_GALERA_VERSION;
#SELECT @ACTUAL_GALERA_MAJOR_VERSION, @ACTUAL_GALERA_MINOR_VERSION; #SELECT @ACTUAL_GALERA_MINOR_VERSION;
#SELECT @ACTUAL_GALERA_RELEASE_VERSION;
if (!`SELECT (@ACTUAL_GALERA_MAJOR_VERSION > @GALERA_MAJOR_VERSION) OR if (!`SELECT (@ACTUAL_GALERA_MINOR_VERSION > @GALERA_MINOR_VERSION) OR
(@ACTUAL_GALERA_MAJOR_VERSION = @GALERA_MAJOR_VERSION AND @ACTUAL_GALERA_MINOR_VERSION >= @GALERA_MINOR_VERSION) (@ACTUAL_GALERA_MINOR_VERSION = @GALERA_MINOR_VERSION AND
@ACTUAL_GALERA_RELEASE_VERSION >= @GALERA_RELEASE_VERSION)
`) `)
{ {
skip Test requires Galera library version $galera_version; skip Test requires Galera library version >= $galera_version;
} }
--enable_query_log --enable_query_log
...@@ -59,6 +59,8 @@ wsrep_local_send_queue_min # ...@@ -59,6 +59,8 @@ wsrep_local_send_queue_min #
wsrep_local_state # wsrep_local_state #
wsrep_local_state_comment # wsrep_local_state_comment #
wsrep_local_state_uuid # wsrep_local_state_uuid #
wsrep_open_connections #
wsrep_open_transactions #
wsrep_protocol_version # wsrep_protocol_version #
wsrep_provider_name # wsrep_provider_name #
wsrep_provider_vendor # wsrep_provider_vendor #
...@@ -114,6 +116,8 @@ wsrep_local_send_queue_min # ...@@ -114,6 +116,8 @@ wsrep_local_send_queue_min #
wsrep_local_state # wsrep_local_state #
wsrep_local_state_comment # wsrep_local_state_comment #
wsrep_local_state_uuid # wsrep_local_state_uuid #
wsrep_open_connections #
wsrep_open_transactions #
wsrep_protocol_version # wsrep_protocol_version #
wsrep_provider_name # wsrep_provider_name #
wsrep_provider_vendor # wsrep_provider_vendor #
......
...@@ -27,10 +27,12 @@ SET GLOBAL wsrep_provider=none; ...@@ -27,10 +27,12 @@ SET GLOBAL wsrep_provider=none;
CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*"); CALL mtr.add_suppression("WSREP: Could not open saved state file for reading.*");
--disable_result_log
--disable_query_log --disable_query_log
eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER'; eval SET GLOBAL wsrep_provider= '$WSREP_PROVIDER';
--let $galera_version=25.3.17 --let $galera_version=25.3.17
source include/check_galera_version.inc; source include/check_galera_version.inc;
--enable_result_log
--enable_query_log --enable_query_log
--replace_column 2 # --replace_column 2 #
...@@ -101,8 +103,11 @@ SHOW STATUS LIKE 'wsrep_thread_count'; ...@@ -101,8 +103,11 @@ SHOW STATUS LIKE 'wsrep_thread_count';
--echo # Setting wsrep_cluster_address triggers the creation of --echo # Setting wsrep_cluster_address triggers the creation of
--echo # applier/rollbacker threads. --echo # applier/rollbacker threads.
SET GLOBAL wsrep_cluster_address= 'gcomm://'; SET GLOBAL wsrep_cluster_address= 'gcomm://';
--echo # Wait for applier threads to get created. --echo # Wait for applier threads to get created.
sleep 3; --let $wait_timeout=600
--let $wait_condition = SELECT COUNT(*) = 2 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
--source include/wait_condition.inc
--replace_regex /.*libgalera_smm.*/libgalera_smm.so/ --replace_regex /.*libgalera_smm.*/libgalera_smm.so/
SELECT @@global.wsrep_provider; SELECT @@global.wsrep_provider;
...@@ -113,8 +118,11 @@ SHOW STATUS LIKE 'wsrep_thread_count'; ...@@ -113,8 +118,11 @@ SHOW STATUS LIKE 'wsrep_thread_count';
SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads; SET @wsrep_slave_threads_saved= @@global.wsrep_slave_threads;
SET GLOBAL wsrep_slave_threads= 10; SET GLOBAL wsrep_slave_threads= 10;
--echo # Wait for applier threads to get created. --echo # Wait for applier threads to get created.
sleep 3; --let $wait_condition = SELECT COUNT(*) = 11 FROM INFORMATION_SCHEMA.PROCESSLIST WHERE USER = 'system user' AND (STATE IS NULL OR STATE NOT LIKE 'InnoDB%');
--source include/wait_condition.inc
SHOW STATUS LIKE 'threads_connected'; SHOW STATUS LIKE 'threads_connected';
SHOW STATUS LIKE 'wsrep_thread_count'; SHOW STATUS LIKE 'wsrep_thread_count';
......
...@@ -564,7 +564,9 @@ void wsrep_node_address_init (const char* value) ...@@ -564,7 +564,9 @@ void wsrep_node_address_init (const char* value)
static void wsrep_slave_count_change_update () static void wsrep_slave_count_change_update ()
{ {
wsrep_slave_count_change += (wsrep_slave_threads - wsrep_prev_slave_threads); wsrep_slave_count_change = (wsrep_slave_threads - wsrep_prev_slave_threads);
WSREP_DEBUG("Change on slave threads: New %lu old %lu difference %lu",
wsrep_slave_threads, wsrep_prev_slave_threads, wsrep_slave_count_change);
wsrep_prev_slave_threads = wsrep_slave_threads; wsrep_prev_slave_threads = wsrep_slave_threads;
} }
......
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