MDEV-11479 Improved wsrep_dirty_reads

Tasks:-
         Changes in wsrep_dirty_reads variable
         1.) Global + Session scope (Current: session-only)
         2.) Can be set using command line.
         3.) Allow all commands that do not change data (besides SELECT)
         4.) Allow prepared Statements that do not change data
         5.) Works with wsrep_sync_wait enabled
This commit is contained in:
Sachin Setiya 2016-12-14 09:30:43 +05:30
commit 0c79de2419
8 changed files with 188 additions and 9 deletions

View file

@ -2649,13 +2649,16 @@ mysql_execute_command(THD *thd)
}
/*
Bail out if DB snapshot has not been installed. We however, allow SET,
SHOW and SELECT queries (only if wsrep_dirty_reads is set).
Bail out if DB snapshot has not been installed. SET and SHOW commands,
however, are always allowed.
We additionally allow all other commands that do not change data in
case wsrep_dirty_reads is enabled.
*/
if (lex->sql_command != SQLCOM_SET_OPTION &&
!wsrep_is_show_query(lex->sql_command) &&
!(thd->variables.wsrep_dirty_reads &&
lex->sql_command == SQLCOM_SELECT) &&
!is_update_query(lex->sql_command)) &&
!wsrep_node_is_ready(thd))
goto error;
}