Commit 84a4db26 authored by Nirbhay Choubey's avatar Nirbhay Choubey

Merge branch '5.5-galera' into 10.0-galera

parents 555915fa d7445ea6
# On node_1
SET @binlog_checksum_saved= @@GLOBAL.BINLOG_CHECKSUM;
SET @@GLOBAL.BINLOG_CHECKSUM=CRC32;
# On node_2
SET @binlog_checksum_saved= @@GLOBAL.BINLOG_CHECKSUM;
SET @@GLOBAL.BINLOG_CHECKSUM=CRC32;
USE test;
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
SELECT * FROM t1;
c1
1
2
3
4
5
SELECT * FROM test.t1;
c1
1
2
3
4
5
# On node_2
SELECT * FROM test.t1;
c1
1
2
3
4
5
DROP TABLE t1;
SET @@GLOBAL.BINLOG_CHECKSUM = @binlog_checksum_saved;
SET @@GLOBAL.BINLOG_CHECKSUM = @binlog_checksum_saved;
# End of test
--source include/galera_cluster.inc
--source include/have_innodb.inc
--echo # On node_1
--connection node_1
SET @binlog_checksum_saved= @@GLOBAL.BINLOG_CHECKSUM;
SET @@GLOBAL.BINLOG_CHECKSUM=CRC32;
--echo # On node_2
--connection node_2
SET @binlog_checksum_saved= @@GLOBAL.BINLOG_CHECKSUM;
SET @@GLOBAL.BINLOG_CHECKSUM=CRC32;
USE test;
CREATE TABLE t1(c1 INT PRIMARY KEY) ENGINE=INNODB;
INSERT INTO t1 VALUES (1), (2), (3), (4), (5);
SELECT * FROM t1;
SELECT * FROM test.t1;
--echo
--echo # On node_2
--connection node_2
SELECT * FROM test.t1;
--let $galera_diff_statement = SELECT * FROM t1
--source include/galera_diff.inc
# Cleanup
DROP TABLE t1;
--connection node_1
SET @@GLOBAL.BINLOG_CHECKSUM = @binlog_checksum_saved;
--connection node_2
SET @@GLOBAL.BINLOG_CHECKSUM = @binlog_checksum_saved;
--source include/galera_end.inc
--echo # End of test
#
# MDEV-7798: mysql.server init script can't stop mysqld when WSREP is
# turned off
#
SELECT @@GLOBAL.WSREP_ON;
@@GLOBAL.WSREP_ON
1
SET GLOBAL WSREP_ON= 0;
Restart the node.
SELECT @@GLOBAL.WSREP_ON;
@@GLOBAL.WSREP_ON
1
# End of test.
--wsrep-provider=$WSREP_PROVIDER --wsrep-cluster-address=gcomm:// --wsrep-on=1 --wsrep_causal_reads=ON
--source include/have_wsrep_provider.inc
--source include/have_binlog_format_row.inc
--echo #
--echo # MDEV-7798: mysql.server init script can't stop mysqld when WSREP is
--echo # turned off
--echo #
SELECT @@GLOBAL.WSREP_ON;
SET GLOBAL WSREP_ON= 0;
--echo Restart the node.
--source include/restart_mysqld.inc
SELECT @@GLOBAL.WSREP_ON;
--echo # End of test.
......@@ -582,76 +582,6 @@ void thd_binlog_rollback_stmt(THD * thd)
if (cache_mngr) cache_mngr->trx_cache.set_prev_position(MY_OFF_T_UNDEF);
}
#ifdef REMOVED
/*
Write the contents of a cache to memory buffer.
This function quite the same as MYSQL_BIN_LOG::write_cache(),
with the exception that here we write in buffer instead of log file.
*/
int wsrep_write_cache(IO_CACHE *cache, uchar **buf, int *buf_len)
{
if (reinit_io_cache(cache, READ_CACHE, 0, 0, 0))
return ER_ERROR_ON_WRITE;
uint length= my_b_bytes_in_cache(cache);
long long total_length = 0;
uchar *buf_ptr = NULL;
do
{
/* bail out if buffer grows too large
This is a temporary fix to avoid flooding replication
TODO: remove this check for 0.7.4 release
*/
if (total_length > wsrep_max_ws_size)
{
WSREP_WARN("transaction size limit (%lld) exceeded: %lld",
wsrep_max_ws_size, total_length);
if (reinit_io_cache(cache, WRITE_CACHE, 0, 0, 0))
{
WSREP_WARN("failed to initialize io-cache");
}
if (buf_ptr) my_free(*buf);
*buf_len = 0;
return ER_ERROR_ON_WRITE;
}
if (total_length > 0)
{
*buf_len += length;
*buf = (uchar *)my_realloc(*buf, total_length+length,
MYF(MY_ALLOW_ZERO_PTR));
if (!*buf)
{
WSREP_ERROR("io cache write problem: %d %d", *buf_len, length);
return ER_ERROR_ON_WRITE;
}
buf_ptr = *buf+total_length;
}
else
{
if (buf_ptr != NULL)
{
WSREP_ERROR("io cache alloc error: %d %d", *buf_len, length);
my_free(*buf);
}
if (length > 0)
{
*buf = (uchar *) my_malloc(length, MYF(0));
buf_ptr = *buf;
*buf_len = length;
}
}
total_length += length;
memcpy(buf_ptr, cache->read_pos, length);
cache->read_pos=cache->read_end;
} while ((cache->file >= 0) && (length= my_b_fill(cache)));
return 0;
}
#endif /* REMOVED */
#endif
......
......@@ -12723,7 +12723,6 @@ void Incident_log_event::pack_info(THD *thd, Protocol *protocol)
}
#endif
#if WITH_WSREP && !defined(MYSQL_CLIENT)
Format_description_log_event *wsrep_format_desc; // TODO: free them at the end
/*
read the first event from (*buf). The size of the (*buf) is (*buf_len).
At the end (*buf) is shitfed to point to the following event or NULL and
......
......@@ -1954,7 +1954,8 @@ static void __cdecl kill_server(int sig_ptr)
}
#endif
#ifdef WITH_WSREP
if (WSREP_ON) wsrep_stop_replication(NULL);
/* Stop wsrep threads in case they are running. */
wsrep_stop_replication(NULL);
#endif
close_connections();
......
......@@ -1605,7 +1605,6 @@ void THD::init(void)
wsrep_trx_meta.depends_on= WSREP_SEQNO_UNDEFINED;
wsrep_converted_lock_session= false;
wsrep_retry_counter= 0;
wsrep_rli= NULL;
wsrep_rgi= NULL;
wsrep_PA_safe= true;
wsrep_consistency_check = NO_CONSISTENCY_CHECK;
......@@ -1820,7 +1819,6 @@ THD::~THD()
mysql_mutex_lock(&LOCK_wsrep_thd);
mysql_mutex_unlock(&LOCK_wsrep_thd);
mysql_mutex_destroy(&LOCK_wsrep_thd);
if (wsrep_rli) delete wsrep_rli;
if (wsrep_rgi) delete wsrep_rgi;
if (wsrep_status_vars) wsrep->stats_free(wsrep, wsrep_status_vars);
#endif
......
......@@ -2777,7 +2777,6 @@ class THD :public Statement,
// wsrep_seqno_t wsrep_trx_seqno;
wsrep_trx_meta_t wsrep_trx_meta;
uint32 wsrep_rand;
Relay_log_info* wsrep_rli;
rpl_group_info* wsrep_rgi;
bool wsrep_converted_lock_session;
wsrep_ws_handle_t wsrep_ws_handle;
......
......@@ -76,13 +76,10 @@ static inline Format_description_log_event*
wsrep_get_apply_format(THD* thd)
{
if (thd->wsrep_apply_format)
return (Format_description_log_event*) thd->wsrep_apply_format;
/* TODO: mariadb does not support rli->get_rli_description_event()
* => look for alternative way to remember last FDE in replication
*/
//return thd->wsrep_rli->get_rli_description_event();
thd->wsrep_apply_format = new Format_description_log_event(4);
return (Format_description_log_event*) thd->wsrep_apply_format;
{
return (Format_description_log_event*) thd->wsrep_apply_format;
}
return thd->wsrep_rgi->rli->relay_log.description_event_for_exec;
}
static wsrep_cb_status_t wsrep_apply_events(THD* thd,
......
......@@ -738,6 +738,7 @@ void wsrep_deinit(bool free_options)
provider_name[0]= '\0';
provider_version[0]= '\0';
provider_vendor[0]= '\0';
wsrep_inited= 0;
if (free_options)
......@@ -1134,6 +1135,11 @@ int wsrep_to_buf_helper(
return 1;
int ret(0);
Format_description_log_event *tmp_fd= new Format_description_log_event(4);
tmp_fd->checksum_alg= binlog_checksum_options;
tmp_fd->write(&tmp_io_cache);
delete tmp_fd;
#ifdef GTID_SUPPORT
if (thd->variables.gtid_next.type == GTID_GROUP)
{
......
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