Commit 542968cf authored by Nirbhay Choubey's avatar Nirbhay Choubey

bzr merge -r4015..4026 codership/5.5

parent 068fb856
...@@ -154,6 +154,7 @@ INCLUDE(cpack_rpm) ...@@ -154,6 +154,7 @@ INCLUDE(cpack_rpm)
INCLUDE(cpack_deb) INCLUDE(cpack_deb)
# Add macros # Add macros
INCLUDE(wsrep)
INCLUDE(character_sets) INCLUDE(character_sets)
INCLUDE(zlib) INCLUDE(zlib)
INCLUDE(ssl) INCLUDE(ssl)
...@@ -165,7 +166,6 @@ INCLUDE(ctest) ...@@ -165,7 +166,6 @@ INCLUDE(ctest)
INCLUDE(plugin) INCLUDE(plugin)
INCLUDE(install_macros) INCLUDE(install_macros)
INCLUDE(mysql_add_executable) INCLUDE(mysql_add_executable)
INCLUDE(wsrep)
# Handle options # Handle options
OPTION(DISABLE_SHARED OPTION(DISABLE_SHARED
...@@ -286,6 +286,7 @@ MARK_AS_ADVANCED(WITH_FAST_MUTEXES) ...@@ -286,6 +286,7 @@ MARK_AS_ADVANCED(WITH_FAST_MUTEXES)
OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP}) OPTION(WITH_INNODB_DISALLOW_WRITES "InnoDB freeze writes patch from Google" ${WITH_WSREP})
IF (WITH_INNODB_DISALLOW_WRITES) IF (WITH_INNODB_DISALLOW_WRITES)
MESSAGE(STATUS "INNODB_DISALLOW_WRITES")
SET(CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DWITH_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") SET(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -DWITH_INNODB_DISALLOW_WRITES")
ENDIF() ENDIF()
......
...@@ -18,12 +18,12 @@ ...@@ -18,12 +18,12 @@
# so WSREP_VERSION is produced regardless # so WSREP_VERSION is produced regardless
# Set the patch version # Set the patch version
SET(WSREP_PATCH_VERSION "10") SET(WSREP_PATCH_VERSION "11")
# MariaDB addition: Revision number of the last revision merged from # MariaDB addition: Revision number of the last revision merged from
# codership branch visible in @@visible_comment. # codership branch visible in @@visible_comment.
# Branch : codership-mysql/5.5 # 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: # MariaDB: Obtain patch revision number:
# Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set. # Update WSREP_PATCH_REVNO if WSREP_REV environment variable is set.
......
...@@ -227,12 +227,25 @@ INSERT INTO global_suppressions VALUES ...@@ -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.*"), ("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:.*down context.*"),
("WSREP: last inactive check more than .* skipping check"), ("WSREP: Failed to send state UUID:.*"),
("WSREP: Gap in state sequence. Need state transfer."), ("WSREP: wsrep_sst_receive_address is set to '127.0.0.1"),
("WSREP: Failed to prepare for incremental state transfer: .*"), ("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")|| ("THE_LAST_SUPPRESSION")||
......
...@@ -8745,6 +8745,31 @@ static int get_options(int *argc_ptr, char ***argv_ptr) ...@@ -8745,6 +8745,31 @@ static int get_options(int *argc_ptr, char ***argv_ptr)
else else
global_system_variables.option_bits&= ~OPTION_BIG_SELECTS; 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 // Synchronize @@global.autocommit on --autocommit
const ulonglong turn_bit_on= opt_autocommit ? const ulonglong turn_bit_on= opt_autocommit ?
OPTION_AUTOCOMMIT : OPTION_NOT_AUTOCOMMIT; OPTION_AUTOCOMMIT : OPTION_NOT_AUTOCOMMIT;
......
...@@ -74,9 +74,10 @@ static wsrep_cb_status_t wsrep_apply_events(THD* thd, ...@@ -74,9 +74,10 @@ static wsrep_cb_status_t wsrep_apply_events(THD* thd,
int rcode= 0; int rcode= 0;
int event= 1; 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", WSREP_INFO("applier has been aborted, skipping apply_rbr: %lld",
(long long) wsrep_thd_trx_seqno(thd)); (long long) wsrep_thd_trx_seqno(thd));
......
...@@ -289,9 +289,16 @@ wsrep_view_handler_cb (void* app_ctx, ...@@ -289,9 +289,16 @@ wsrep_view_handler_cb (void* app_ctx,
wsrep_ready_set(FALSE); wsrep_ready_set(FALSE);
/* Close client connections to ensure that they don't interfere /* Close client connections to ensure that they don't interfere
* with SST */ * with SST. Necessary only if storage engines are initialized
WSREP_DEBUG("[debug]: closing client connections for PRIM"); * before SST.
wsrep_close_client_connections(TRUE); * 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); ssize_t const req_len= wsrep_sst_prepare (sst_req);
......
...@@ -194,7 +194,7 @@ extern wsrep_seqno_t wsrep_locked_seqno; ...@@ -194,7 +194,7 @@ extern wsrep_seqno_t wsrep_locked_seqno;
(global_system_variables.wsrep_on) (global_system_variables.wsrep_on)
#define WSREP(thd) \ #define WSREP(thd) \
(WSREP_ON && (thd && thd->variables.wsrep_on)) (WSREP_ON && wsrep && (thd && thd->variables.wsrep_on))
#define WSREP_CLIENT(thd) \ #define WSREP_CLIENT(thd) \
(WSREP(thd) && thd->wsrep_client_thread) (WSREP(thd) && thd->wsrep_client_thread)
......
...@@ -62,26 +62,34 @@ bool wsrep_on_update (sys_var *self, THD* thd, enum_var_type var_type) ...@@ -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) bool wsrep_causal_reads_update (sys_var *self, THD* thd, enum_var_type var_type)
{ {
// global setting should not affect session setting. // wsrep_sync_wait should also be updated.
// if (var_type == OPT_GLOBAL) { if (var_type == OPT_GLOBAL) {
// thd->variables.wsrep_causal_reads = global_system_variables.wsrep_causal_reads; if (global_system_variables.wsrep_causal_reads) {
// } global_system_variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ;
if (thd->variables.wsrep_causal_reads) { } else {
thd->variables.wsrep_sync_wait |= WSREP_SYNC_WAIT_BEFORE_READ; global_system_variables.wsrep_sync_wait &= ~WSREP_SYNC_WAIT_BEFORE_READ;
}
} else { } 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; return false;
} }
bool wsrep_sync_wait_update (sys_var* self, THD* thd, enum_var_type var_type) bool wsrep_sync_wait_update (sys_var* self, THD* thd, enum_var_type var_type)
{ {
// global setting should not affect session setting. // wsrep_causal_reads should also be updated.
// if (var_type == OPT_GLOBAL) { if (var_type == OPT_GLOBAL) {
// thd->variables.wsrep_sync_wait = global_system_variables.wsrep_sync_wait; global_system_variables.wsrep_causal_reads=
// } global_system_variables.wsrep_sync_wait & WSREP_SYNC_WAIT_BEFORE_READ;
thd->variables.wsrep_causal_reads = thd->variables.wsrep_sync_wait & } else {
WSREP_SYNC_WAIT_BEFORE_READ; thd->variables.wsrep_causal_reads=
thd->variables.wsrep_sync_wait & WSREP_SYNC_WAIT_BEFORE_READ;
}
return false; return false;
} }
......
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