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)
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()
......
......@@ -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.
......
......@@ -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")||
......
......@@ -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;
......
......@@ -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));
......
......@@ -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);
......
......@@ -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)
......
......@@ -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;
}
......
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