MDEV-11016 wsrep_node_is_ready() check is too strict

Problem:-
  The condition that checks for node readiness is too strict as it does
  not allow SELECTs even if these selects do not access any tables.
    For example,if we run
       SELECT 1;
    OR
       SELECT @@max_allowed_packet;
Solution:-
  We need not to report this error when all_tables(lex->query_tables)
  is NULL:
This commit is contained in:
Sachin Setiya 2017-01-03 10:10:58 +05:30
commit d9a1a201aa
5 changed files with 25 additions and 1 deletions

View file

@ -2,12 +2,14 @@ CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
SET GLOBAL wsrep_provider_options='gmcast.isolate=1';
SET SESSION wsrep_on = OFF;
SET SESSION wsrep_on = ON;
SET global wsrep_sync_wait=0;
START SLAVE;
include/wait_for_slave_param.inc [Slave_IO_Running]
SET GLOBAL wsrep_provider_options='gmcast.isolate=0';
include/wait_for_slave_to_start.inc
INSERT INTO t1 VALUES (1);
DROP TABLE t1;
SET global wsrep_sync_wait=7;
STOP SLAVE;
RESET SLAVE ALL;
CALL mtr.add_suppression('failed registering on master');

View file

@ -18,6 +18,15 @@ Variable_name Value
wsrep_cluster_status non-Primary
SELECT * FROM t1;
ERROR 08S01: WSREP has not yet prepared node for application use
SELECT @@wsrep_dirty_reads;
@@wsrep_dirty_reads
0
SELECT 2;
2
2
SELECT 2+2 FROM DUAL;
2+2
4
SET @@session.wsrep_dirty_reads=ON;
SELECT * FROM t1;
i

View file

@ -11,12 +11,16 @@
--enable_query_log
--connection node_1
--let $wsrep_sync_wait_state= `SELECT @@global.wsrep_sync_wait;`
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
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;
#wsrep_sync_wait is set to zero because when slave tries to connect it it ask for queries like SELECT UNIX_TIMESTAMP() on node 1 which will fail, causing
#a warning in slave error log.
SET global wsrep_sync_wait=0;
--connection node_3
START SLAVE;
@ -47,6 +51,7 @@ INSERT INTO t1 VALUES (1);
--connection node_1
DROP TABLE t1;
--eval SET global wsrep_sync_wait=$wsrep_sync_wait_state
--connection node_3
--let $wait_condition = SELECT COUNT(*) = 0 FROM INFORMATION_SCHEMA.TABLES WHERE TABLE_NAME = 't1'
--source include/wait_condition.inc

View file

@ -37,6 +37,11 @@ SHOW STATUS LIKE 'wsrep_cluster_status';
--error ER_UNKNOWN_COM_ERROR
SELECT * FROM t1;
#Select query which does not access table should be allowed MDEV-11016
SELECT @@wsrep_dirty_reads;
SELECT 2;
SELECT 2+2 FROM DUAL;
SET @@session.wsrep_dirty_reads=ON;
SELECT * FROM t1;