Commit 44b107da authored by Monty's avatar Monty

Fixed a bug in galera + some failing galera tests

- Added missning setting of table->rpl_write_set in record_gtid(), required by galera
- Removed output of WSREP_PATCH_VERSION from galera_defaults, as this can change over time
- Limit galera_many_tables_pk and galera_many_tables_nopk to 900, as
  on many systems the default open table limit is 1024
parent 33f0cf71
...@@ -12,7 +12,8 @@ AND VARIABLE_NAME NOT IN ( ...@@ -12,7 +12,8 @@ AND VARIABLE_NAME NOT IN (
'WSREP_PROVIDER', 'WSREP_PROVIDER',
'WSREP_DATA_HOME_DIR', 'WSREP_DATA_HOME_DIR',
'WSREP_NODE_INCOMING_ADDRESS', 'WSREP_NODE_INCOMING_ADDRESS',
'WSREP_START_POSITION' 'WSREP_START_POSITION',
'WSREP_PATCH_VERSION'
) )
ORDER BY VARIABLE_NAME; ORDER BY VARIABLE_NAME;
VARIABLE_NAME VARIABLE_VALUE VARIABLE_NAME VARIABLE_VALUE
...@@ -37,7 +38,6 @@ WSREP_MYSQL_REPLICATION_BUNDLE 0 ...@@ -37,7 +38,6 @@ WSREP_MYSQL_REPLICATION_BUNDLE 0
WSREP_NOTIFY_CMD WSREP_NOTIFY_CMD
WSREP_ON ON WSREP_ON ON
WSREP_OSU_METHOD TOI WSREP_OSU_METHOD TOI
WSREP_PATCH_VERSION wsrep_25.10
WSREP_RECOVER OFF WSREP_RECOVER OFF
WSREP_REPLICATE_MYISAM OFF WSREP_REPLICATE_MYISAM OFF
WSREP_RESTART_SLAVE OFF WSREP_RESTART_SLAVE OFF
......
...@@ -2,14 +2,14 @@ SET AUTOCOMMIT=OFF; ...@@ -2,14 +2,14 @@ SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
COMMIT; COMMIT;
CREATE TABLE sum_table (f1 INTEGER); CREATE TABLE sum_table (f1 INTEGER);
SELECT SUM(f1) = 1000 FROM sum_table; SELECT SUM(f1) = 900 FROM sum_table;
SUM(f1) = 1000 SUM(f1) = 900
1 1
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
UPDATE t1000 SET f1 = 3; UPDATE t900 SET f1 = 3;
COMMIT; COMMIT;
COMMIT; COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
......
SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%'; SELECT COUNT(*) = 900 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
COUNT(*) = 1000 COUNT(*) = 900
1 1
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
COMMIT; COMMIT;
CREATE TABLE sum_table (f1 INTEGER); CREATE TABLE sum_table (f1 INTEGER);
SELECT SUM(f1) = 1000 FROM sum_table; SELECT SUM(f1) = 900 FROM sum_table;
SUM(f1) = 1000 SUM(f1) = 900
1 1
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
UPDATE t1000 SET f1 = 3; UPDATE t900 SET f1 = 3;
COMMIT; COMMIT;
COMMIT; COMMIT;
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
......
...@@ -32,7 +32,8 @@ AND VARIABLE_NAME NOT IN ( ...@@ -32,7 +32,8 @@ AND VARIABLE_NAME NOT IN (
'WSREP_PROVIDER', 'WSREP_PROVIDER',
'WSREP_DATA_HOME_DIR', 'WSREP_DATA_HOME_DIR',
'WSREP_NODE_INCOMING_ADDRESS', 'WSREP_NODE_INCOMING_ADDRESS',
'WSREP_START_POSITION' 'WSREP_START_POSITION',
'WSREP_PATCH_VERSION'
) )
ORDER BY VARIABLE_NAME; ORDER BY VARIABLE_NAME;
......
...@@ -2,17 +2,23 @@ ...@@ -2,17 +2,23 @@
--source include/galera_cluster.inc --source include/galera_cluster.inc
--source include/have_innodb.inc --source include/have_innodb.inc
if (!`SELECT @@open_files_limit >= 1024`){
skip Need at least an open file limit of 1000;
}
# #
# This test forces 1K tables without a PK to participate in a single transaction # This test forces 900 tables without a PK to participate in a single
# transaction. The reason for 900 is that some linux system has by default
# a limit of 1024 open files / process
# #
# #
# First, create 1K tables # First, create 900 tables
# #
--connection node_1 --connection node_1
--let $count = 1000 --let $count = 900
while ($count) while ($count)
{ {
--disable_query_log --disable_query_log
...@@ -22,7 +28,7 @@ while ($count) ...@@ -22,7 +28,7 @@ while ($count)
--dec $count --dec $count
} }
--let $count = 1000 --let $count = 900
while ($count) while ($count)
{ {
--disable_query_log --disable_query_log
...@@ -33,13 +39,13 @@ while ($count) ...@@ -33,13 +39,13 @@ while ($count)
} }
# #
# Second, perform 1K updates # Second, perform 900 updates
# #
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
--let $count = 1000 --let $count = 900
while ($count) while ($count)
{ {
--disable_query_log --disable_query_log
...@@ -57,7 +63,7 @@ COMMIT; ...@@ -57,7 +63,7 @@ COMMIT;
--connection node_2 --connection node_2
CREATE TABLE sum_table (f1 INTEGER); CREATE TABLE sum_table (f1 INTEGER);
--let $count = 1000 --let $count = 900
while ($count) while ($count)
{ {
--disable_query_log --disable_query_log
...@@ -67,7 +73,7 @@ while ($count) ...@@ -67,7 +73,7 @@ while ($count)
--dec $count --dec $count
} }
SELECT SUM(f1) = 1000 FROM sum_table; SELECT SUM(f1) = 900 FROM sum_table;
# #
# Fourth, create a deadlock # Fourth, create a deadlock
...@@ -77,7 +83,7 @@ SELECT SUM(f1) = 1000 FROM sum_table; ...@@ -77,7 +83,7 @@ SELECT SUM(f1) = 1000 FROM sum_table;
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
--let $count = 1000 --let $count = 900
while ($count) while ($count)
{ {
--disable_query_log --disable_query_log
...@@ -90,7 +96,7 @@ while ($count) ...@@ -90,7 +96,7 @@ while ($count)
--connection node_2 --connection node_2
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
UPDATE t1000 SET f1 = 3; UPDATE t900 SET f1 = 3;
--connection node_1 --connection node_1
COMMIT; COMMIT;
......
...@@ -2,17 +2,23 @@ ...@@ -2,17 +2,23 @@
--source include/galera_cluster.inc --source include/galera_cluster.inc
--source include/have_innodb.inc --source include/have_innodb.inc
if (!`SELECT @@open_files_limit >= 1024`){
skip Need at least an open file limit of 1024;
}
# #
# This test forces 1K tables with a PK to participate in a single transaction # This test forces 900 tables with a PK to participate in a single
# transaction. The reason for 900 is that some linux system has by default
# a limit of 1024 open files / process
# #
# #
# First, create 1K tables and make sure the DDLs are all propagated # First, create 900 tables and make sure the DDLs are all propagated
# #
--connection node_1 --connection node_1
--let $count = 1000 --let $count = 900
while ($count) while ($count)
{ {
--disable_query_log --disable_query_log
...@@ -23,7 +29,7 @@ while ($count) ...@@ -23,7 +29,7 @@ while ($count)
} }
--connection node_2 --connection node_2
SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%'; SELECT COUNT(*) = 900 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test' AND TABLE_NAME LIKE 't%';
# #
# Second, create a transaction that uses all those tables # Second, create a transaction that uses all those tables
...@@ -33,7 +39,7 @@ SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test ...@@ -33,7 +39,7 @@ SELECT COUNT(*) = 1000 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_SCHEMA = 'test
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
--let $count = 1000 --let $count = 900
while ($count) while ($count)
{ {
--disable_query_log --disable_query_log
...@@ -52,7 +58,7 @@ COMMIT; ...@@ -52,7 +58,7 @@ COMMIT;
--connection node_2 --connection node_2
CREATE TABLE sum_table (f1 INTEGER); CREATE TABLE sum_table (f1 INTEGER);
--let $count = 1000 --let $count = 900
while ($count) while ($count)
{ {
--disable_query_log --disable_query_log
...@@ -62,7 +68,7 @@ while ($count) ...@@ -62,7 +68,7 @@ while ($count)
--dec $count --dec $count
} }
SELECT SUM(f1) = 1000 FROM sum_table; SELECT SUM(f1) = 900 FROM sum_table;
# #
# Fourth, create a deadlock # Fourth, create a deadlock
...@@ -72,7 +78,7 @@ SELECT SUM(f1) = 1000 FROM sum_table; ...@@ -72,7 +78,7 @@ SELECT SUM(f1) = 1000 FROM sum_table;
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
--let $count = 1000 --let $count = 900
while ($count) while ($count)
{ {
--disable_query_log --disable_query_log
...@@ -85,7 +91,7 @@ while ($count) ...@@ -85,7 +91,7 @@ while ($count)
--connection node_2 --connection node_2
SET AUTOCOMMIT=OFF; SET AUTOCOMMIT=OFF;
START TRANSACTION; START TRANSACTION;
UPDATE t1000 SET f1 = 3; UPDATE t900 SET f1 = 3;
--connection node_1 --connection node_1
COMMIT; COMMIT;
......
...@@ -587,6 +587,7 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id, ...@@ -587,6 +587,7 @@ rpl_slave_state::record_gtid(THD *thd, const rpl_gtid *gtid, uint64 sub_id,
thd->variables.option_bits&= ~(ulonglong)OPTION_BIN_LOG; thd->variables.option_bits&= ~(ulonglong)OPTION_BIN_LOG;
bitmap_set_all(table->write_set); bitmap_set_all(table->write_set);
table->rpl_write_set= table->write_set;
table->field[0]->store((ulonglong)gtid->domain_id, true); table->field[0]->store((ulonglong)gtid->domain_id, true);
table->field[1]->store(sub_id, true); table->field[1]->store(sub_id, true);
......
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