-
Notifications
You must be signed in to change notification settings - Fork 1.7k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
20 changed files
with
409 additions
and
164 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
36 changes: 36 additions & 0 deletions
36
mysql-test/suite/galera_3nodes/r/galera_load_data_ist.result
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,36 @@ | ||
connection node_1; | ||
connection node_2; | ||
connection node_3; | ||
connection node_1; | ||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; | ||
connection node_2; | ||
connection node_3; | ||
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1'; | ||
SET SESSION wsrep_on = OFF; | ||
SET SESSION wsrep_on = ON; | ||
SET SESSION wsrep_sync_wait = 0; | ||
connection node_2a; | ||
SET SESSION wsrep_sync_wait = 0; | ||
connection node_2; | ||
SET GLOBAL wsrep_load_data_splitting = TRUE; | ||
SET DEBUG_SYNC='intermediate_transaction_commit SIGNAL commited WAIT_FOR ist'; | ||
connection node_2a; | ||
SET DEBUG_SYNC='now WAIT_FOR commited'; | ||
connection node_3; | ||
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0'; | ||
connection node_2a; | ||
SET DEBUG_SYNC='now SIGNAL ist'; | ||
connection node_1; | ||
connection node_2; | ||
SET DEBUG_SYNC='RESET'; | ||
SELECT COUNT(*) = 95000 FROM t1; | ||
COUNT(*) = 95000 | ||
1 | ||
wsrep_last_committed_diff | ||
1 | ||
connection node_1; | ||
SET GLOBAL wsrep_load_data_splitting = 1;; | ||
DROP TABLE t1; | ||
disconnect node_3; | ||
disconnect node_2; | ||
disconnect node_1; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
!include ../galera_3nodes.cnf | ||
|
||
[mysqld] | ||
wsrep-causal-reads=OFF |
124 changes: 124 additions & 0 deletions
124
mysql-test/suite/galera_3nodes/t/galera_load_data_ist.test
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,124 @@ | ||
--source include/have_debug_sync.inc | ||
--source include/galera_cluster.inc | ||
--source include/have_innodb.inc | ||
--source include/big_test.inc | ||
|
||
# Establish connection to the third node: | ||
--let $galera_connection_name = node_3 | ||
--let $galera_server_number = 3 | ||
--source include/galera_connect.inc | ||
|
||
# Establish additional connection to the second node | ||
# (which is used in the test for synchronization control): | ||
--let $galera_connection_name = node_2a | ||
--let $galera_server_number = 2 | ||
--source include/galera_connect.inc | ||
|
||
# Save original auto_increment_offset values: | ||
--let $node_1=node_1 | ||
--let $node_2=node_2 | ||
--let $node_3=node_3 | ||
--source ../galera/include/auto_increment_offset_save.inc | ||
|
||
# Create a file for LOAD DATA with 95K entries | ||
--connection node_1 | ||
--perl | ||
open(FILE, ">", "$ENV{'MYSQLTEST_VARDIR'}/tmp/galera_var_load_data_splitting.csv") or die; | ||
foreach my $i (1..95000) { | ||
print FILE "$i\n"; | ||
} | ||
EOF | ||
|
||
CREATE TABLE t1 (f1 INTEGER PRIMARY KEY) ENGINE=InnoDB; | ||
|
||
# Let's wait for the completion of the formation of a cluster | ||
# of three nodes: | ||
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; | ||
--source include/wait_condition.inc | ||
--connection node_2 | ||
--source include/wait_until_ready.inc | ||
--connection node_3 | ||
--source include/wait_until_ready.inc | ||
|
||
# Disconnect the third node from the cluster: | ||
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 1'; | ||
SET SESSION wsrep_on = OFF; | ||
--let $wait_condition = SELECT VARIABLE_VALUE = 'non-Primary' FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_status'; | ||
--source include/wait_condition.inc | ||
SET SESSION wsrep_on = ON; | ||
SET SESSION wsrep_sync_wait = 0; | ||
|
||
# Disable sync wait for control connection: | ||
--connection node_2a | ||
SET SESSION wsrep_sync_wait = 0; | ||
|
||
# Let's wait until the other nodes stop seeing the third | ||
# node in the cluster: | ||
--let $wait_condition = SELECT VARIABLE_VALUE = 2 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; | ||
--source include/wait_condition.inc | ||
|
||
# Record wsrep_last_committed as it was before LOAD DATA: | ||
--connection node_2 | ||
--let $wsrep_last_committed_before = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` | ||
|
||
# Enable splitting for LOAD DATA: | ||
--let $wsrep_load_data_splitting_orig = `SELECT @@wsrep_load_data_splitting` | ||
SET GLOBAL wsrep_load_data_splitting = TRUE; | ||
|
||
# Stop after the first commit and wait for the IST signal: | ||
SET DEBUG_SYNC='intermediate_transaction_commit SIGNAL commited WAIT_FOR ist'; | ||
|
||
# Perform the LOAD DATA statement: | ||
--disable_query_log | ||
let v1='$MYSQLTEST_VARDIR/tmp/galera_var_load_data_splitting.csv'; | ||
--send_eval LOAD DATA INFILE $v1 INTO TABLE t1; | ||
--enable_query_log | ||
|
||
# Wait for the first commit: | ||
--connection node_2a | ||
SET DEBUG_SYNC='now WAIT_FOR commited'; | ||
|
||
# Initiate the IST: | ||
--connection node_3 | ||
SET GLOBAL wsrep_provider_options = 'gmcast.isolate = 0'; | ||
|
||
# Continue the execution of LOAD DATA: | ||
--connection node_2a | ||
SET DEBUG_SYNC='now SIGNAL ist'; | ||
|
||
# Let's wait for the recovery of the cluster | ||
# of three nodes: | ||
--connection node_1 | ||
--let $wait_condition = SELECT VARIABLE_VALUE = 3 FROM INFORMATION_SCHEMA.GLOBAL_STATUS WHERE VARIABLE_NAME = 'wsrep_cluster_size'; | ||
--source include/wait_condition.inc | ||
|
||
# Save the LOAD DATA results: | ||
--connection node_2 | ||
--reap | ||
|
||
# Reset all synchronization points and signals: | ||
SET DEBUG_SYNC='RESET'; | ||
|
||
# Read the wsrep_last_commited after LOAD DATA: | ||
--let $wsrep_last_committed_after = `SELECT VARIABLE_VALUE FROM INFORMATION_SCHEMA.SESSION_STATUS WHERE VARIABLE_NAME = 'wsrep_last_committed'` | ||
|
||
# Check the records: | ||
SELECT COUNT(*) = 95000 FROM t1; | ||
|
||
# LOAD-ing 95K rows should causes 10 commits to be registered: | ||
--disable_query_log | ||
--eval SELECT $wsrep_last_committed_after = $wsrep_last_committed_before + 10 AS wsrep_last_committed_diff; | ||
--enable_query_log | ||
|
||
# Restore the original splitting: | ||
--connection node_1 | ||
--eval SET GLOBAL wsrep_load_data_splitting = $wsrep_load_data_splitting_orig; | ||
|
||
# Drop test table: | ||
DROP TABLE t1; | ||
|
||
# Restore original auto_increment_offset values: | ||
--source ../galera/include/auto_increment_offset_restore.inc | ||
|
||
--let $galera_cluster_size=3 | ||
--source include/galera_end.inc |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.