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 | |
parent | 068fb8569f2300e4a5c08413a756417d923ecf5f (diff) | |
download | mariadb-git-542968cf0a68070d7b45859a3148a602e2089a35.tar.gz |
bzr merge -r4015..4026 codership/5.5
-rw-r--r-- | CMakeLists.txt | 3 | ||||
-rw-r--r-- | cmake/wsrep.cmake | 4 | ||||
-rw-r--r-- | mysql-test/include/mtr_warnings.sql | 23 | ||||
-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 |
8 files changed, 82 insertions, 27 deletions
diff --git a/CMakeLists.txt b/CMakeLists.txt index 56b0de885c7..8fd966d1728 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -154,6 +154,7 @@ INCLUDE(cpack_rpm) INCLUDE(cpack_deb) # Add macros +INCLUDE(wsrep) INCLUDE(character_sets) INCLUDE(zlib) INCLUDE(ssl) @@ -165,7 +166,6 @@ INCLUDE(ctest) INCLUDE(plugin) INCLUDE(install_macros) INCLUDE(mysql_add_executable) -INCLUDE(wsrep) # Handle options OPTION(DISABLE_SHARED @@ -286,6 +286,7 @@ MARK_AS_ADVANCED(WITH_FAST_MUTEXES) OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP}) IF (WITH_INNODB_DISALLOW_WRITES) + MESSAGE(STATUS "INNODB_DISALLOW_WRITES") SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_INNODB_DISALLOW_WRITES") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_INNODB_DISALLOW_WRITES") ENDIF() diff --git a/cmake/wsrep.cmake b/cmake/wsrep.cmake index 97eb47fc587..50698b7bb8f 100644 --- a/cmake/wsrep.cmake +++ b/cmake/wsrep.cmake @@ -18,12 +18,12 @@ # so WSREP_VERSION is produced regardless # Set the patch version -SET(WSREP_PATCH_VERSION "10") +SET(WSREP_PATCH_VERSION "11") # MariaDB addition: Revision number of the last revision merged from # codership branch visible in @@visible_comment. # Branch : codership-mysql/5.5 -SET(WSREP_PATCH_REVNO "4014") # Should be updated on every merge. +SET(WSREP_PATCH_REVNO "4026") # Should be updated on every merge. # MariaDB: Obtain patch revision number: # Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set. diff --git a/mysql-test/include/mtr_warnings.sql b/mysql-test/include/mtr_warnings.sql index ed60568077c..5ef85411e79 100644 --- a/mysql-test/include/mtr_warnings.sql +++ b/mysql-test/include/mtr_warnings.sql @@ -227,12 +227,25 @@ INSERT INTO global_suppressions VALUES ("Slave I/O: Notifying master by SET @master_binlog_checksum= @@global.binlog_checksum failed with error.*"), /* - Galera-related warnings. + Galera suppressions */ - ("WSREP: Could not open saved state file for reading: .*"), - ("WSREP: last inactive check more than .* skipping check"), - ("WSREP: Gap in state sequence. Need state transfer."), - ("WSREP: Failed to prepare for incremental state transfer: .*"), + ("WSREP:.*down context.*"), + ("WSREP: Failed to send state UUID:.*"), + ("WSREP: wsrep_sst_receive_address is set to '127.0.0.1"), + ("WSREP: option --wsrep-casual-reads is deprecated"), + ("WSREP: --wsrep-casual-reads=ON takes precedence over --wsrep-sync-wait=0"), + ("WSREP: Could not open saved state file for reading: "), + ("WSREP: access file\\(gvwstate\\.dat\\) failed\\(No such file or directory\\)"), + ("WSREP: Gap in state sequence\\. Need state transfer\\."), + ("WSREP: Failed to prepare for incremental state transfer: Local state UUID \\(00000000-0000-0000-0000-000000000000\\) does not match group state UUID"), + ("WSREP: No existing UUID has been found, so we assume that this is the first time that this server has been started\\. Generating a new UUID: "), + ("WSREP: last inactive check more than"), + ("WSREP: binlog cache not empty \\(0 bytes\\) at connection close"), + ("WSREP: Failed to guess base node address"), + ("WSREP: Guessing address for incoming client connections failed"), + ("WSREP: Failed to read output of: '/sbin/ifconfig"), + ("WSREP: SQL statement was ineffective"), + ("THE_LAST_SUPPRESSION")|| 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; } |