diff options
author | Nirbhay Choubey <nirbhay@mariadb.com> | 2014-10-09 18:28:14 -0400 |
---|---|---|
committer | Nirbhay Choubey <nirbhay@mariadb.com> | 2014-10-09 18:28:14 -0400 |
commit | 542968cf0a68070d7b45859a3148a602e2089a35 (patch) | |
tree | 889399fd2c19496137b61cb7e9131d371763ee09 /sql | |
parent | 068fb8569f2300e4a5c08413a756417d923ecf5f (diff) | |
download | mariadb-git-542968cf0a68070d7b45859a3148a602e2089a35.tar.gz |
bzr merge -r4015..4026 codership/5.5
Diffstat (limited to 'sql')
-rw-r--r-- | sql/mysqld.cc | 25 | ||||
-rw-r--r-- | sql/wsrep_applier.cc | 5 | ||||
-rw-r--r-- | sql/wsrep_mysqld.cc | 13 | ||||
-rw-r--r-- | sql/wsrep_mysqld.h | 2 | ||||
-rw-r--r-- | sql/wsrep_var.cc | 34 |
5 files changed, 60 insertions, 19 deletions
diff --git a/sql/mysqld.cc b/sql/mysqld.cc index 6437827a175..6304b903737 100644 --- a/sql/mysqld.cc +++ b/sql/mysqld.cc @@ -8745,6 +8745,31 @@ static int get_options(int *argc_ptr, char ***argv_ptr) else global_system_variables.option_bits&= ~OPTION_BIG_SELECTS; +#ifdef WITH_WSREP + if (global_system_variables.wsrep_causal_reads) { + WSREP_WARN("option --wsrep-casual-reads is deprecated"); + if (!(global_system_variables.wsrep_sync_wait & + WSREP_SYNC_WAIT_BEFORE_READ)) { + WSREP_WARN("--wsrep-casual-reads=ON takes precedence over --wsrep-sync-wait=%u. " + "WSREP_SYNC_WAIT_BEFORE_READ is on", + global_system_variables.wsrep_sync_wait); + global_system_variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ; + } else { + // they are both turned on. + } + } else { + if (global_system_variables.wsrep_sync_wait & + WSREP_SYNC_WAIT_BEFORE_READ) { + WSREP_WARN("--wsrep-sync-wait=%u takes precedence over --wsrep-causal-reads=OFF. " + "WSREP_SYNC_WAIT_BEFORE_READ is on", + global_system_variables.wsrep_sync_wait); + global_system_variables.wsrep_causal_reads = 1; + } else { + // they are both turned off. + } + } +#endif // WITH_WSREP + // Synchronize @@global.autocommit on --autocommit const ulonglong turn_bit_on= opt_autocommit ? OPTION_AUTOCOMMIT : OPTION_NOT_AUTOCOMMIT; diff --git a/sql/wsrep_applier.cc b/sql/wsrep_applier.cc index 6701d3fd28a..cb700448ee5 100644 --- a/sql/wsrep_applier.cc +++ b/sql/wsrep_applier.cc @@ -74,9 +74,10 @@ static wsrep_cb_status_t wsrep_apply_events(THD* thd, int rcode= 0; int event= 1; - DBUG_ENTER("wsrep_apply_rbr"); + DBUG_ENTER("wsrep_apply_events"); - if (thd->killed == KILL_CONNECTION) + if (thd->killed == KILL_CONNECTION && + thd->wsrep_conflict_state != REPLAYING) { WSREP_INFO("applier has been aborted, skipping apply_rbr: %lld", (long long) wsrep_thd_trx_seqno(thd)); diff --git a/sql/wsrep_mysqld.cc b/sql/wsrep_mysqld.cc index 60ced03a8b1..d93c5a3a02d 100644 --- a/sql/wsrep_mysqld.cc +++ b/sql/wsrep_mysqld.cc @@ -289,9 +289,16 @@ wsrep_view_handler_cb (void* app_ctx, wsrep_ready_set(FALSE); /* Close client connections to ensure that they don't interfere - * with SST */ - WSREP_DEBUG("[debug]: closing client connections for PRIM"); - wsrep_close_client_connections(TRUE); + * with SST. Necessary only if storage engines are initialized + * before SST. + * TODO: Just killing all ongoing transactions should be enough + * since wsrep_ready is OFF and no new transactions can start. + */ + if (!wsrep_before_SE()) + { + WSREP_DEBUG("[debug]: closing client connections for PRIM"); + wsrep_close_client_connections(TRUE); + } ssize_t const req_len= wsrep_sst_prepare (sst_req); diff --git a/sql/wsrep_mysqld.h b/sql/wsrep_mysqld.h index 28643af3718..dd47d4dc1a4 100644 --- a/sql/wsrep_mysqld.h +++ b/sql/wsrep_mysqld.h @@ -194,7 +194,7 @@ extern wsrep_seqno_t wsrep_locked_seqno; (global_system_variables.wsrep_on) #define WSREP(thd) \ - (WSREP_ON && (thd && thd->variables.wsrep_on)) + (WSREP_ON && wsrep && (thd && thd->variables.wsrep_on)) #define WSREP_CLIENT(thd) \ (WSREP(thd) && thd->wsrep_client_thread) diff --git a/sql/wsrep_var.cc b/sql/wsrep_var.cc index 3aa2ac66073..687c9e1fd31 100644 --- a/sql/wsrep_var.cc +++ b/sql/wsrep_var.cc @@ -62,26 +62,34 @@ bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type) bool wsrep_causal_reads_update (sys_var *self, THD* thd, enum_var_type var_type) { - // global setting should not affect session setting. - // if (var_type == OPT_GLOBAL) { - // thd->variables.wsrep_causal_reads = global_system_variables.wsrep_causal_reads; - // } - if (thd->variables.wsrep_causal_reads) { - thd->variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ; + // wsrep_sync_wait should also be updated. + if (var_type == OPT_GLOBAL) { + if (global_system_variables.wsrep_causal_reads) { + global_system_variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ; + } else { + global_system_variables.wsrep_sync_wait &= ~WSREP_SYNC_WAIT_BEFORE_READ; + } } else { - thd->variables.wsrep_sync_wait &= ~WSREP_SYNC_WAIT_BEFORE_READ; + if (thd->variables.wsrep_causal_reads) { + thd->variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ; + } else { + thd->variables.wsrep_sync_wait &= ~WSREP_SYNC_WAIT_BEFORE_READ; + } } + return false; } bool wsrep_sync_wait_update (sys_var* self, THD* thd, enum_var_type var_type) { - // global setting should not affect session setting. - // if (var_type == OPT_GLOBAL) { - // thd->variables.wsrep_sync_wait = global_system_variables.wsrep_sync_wait; - // } - thd->variables.wsrep_causal_reads = thd->variables.wsrep_sync_wait & - WSREP_SYNC_WAIT_BEFORE_READ; + // wsrep_causal_reads should also be updated. + if (var_type == OPT_GLOBAL) { + global_system_variables.wsrep_causal_reads= + global_system_variables.wsrep_sync_wait & WSREP_SYNC_WAIT_BEFORE_READ; + } else { + thd->variables.wsrep_causal_reads= + thd->variables.wsrep_sync_wait & WSREP_SYNC_WAIT_BEFORE_READ; + } return false; } |