Merge branch '2.2' into develop

This commit is contained in:
Johan Wikman
2018-06-28 10:34:41 +03:00
6 changed files with 19 additions and 28 deletions

View File

@ -703,7 +703,7 @@ Default is `0`.
With this configuration item it is specified in what circumstances MaxScale
should dump the last statements that a client sent. The allowed values are
`never, `on_error` and `on_close`. With `never` the statements are never
`never`, `on_error` and `on_close`. With `never` the statements are never
logged, with `on_error` they are logged if the client closes the connection
improperly, and with `on_close` they are always logged when a client session
is closed.

View File

@ -1,4 +1,4 @@
# MariaDB MaxScale 2.2.10 Release Notes -- 2018-06-
# MariaDB MaxScale 2.2.10 Release Notes -- 2018-06-28
Release 2.2.10 is a GA release.

View File

@ -8,16 +8,6 @@ servers= server1,server2,server3,server4
user=maxskysql
passwd= skysql
monitor_interval=1000
detect_standalone_master=true
failcount=1
allow_cluster_recovery=true
replication_user=repl
replication_password=repl
backend_connect_timeout=3
backend_read_timeout=3
backend_write_timeout=3
auto_failover=true
auto_rejoin=true
[RW Split Router]
type=service

View File

@ -7,33 +7,24 @@
int main(int argc, char** argv)
{
Mariadb_nodes::require_gtid(true);
TestConnections test(argc, argv);
// Check that master gets the slave status when set into read-only mode
test.tprintf("Set master into read-only mode");
test.repl->connect();
execute_query(test.repl->nodes[0], "SET GLOBAL read_only=ON");
sleep(10);
test.maxscales->wait_for_monitor();
test.tprintf("Check that the current master now has the slave label");
test.check_log_err(0, "[Master, Running] -> [Running]", false);
test.check_log_err(0, "[Master, Running] -> [Slave, Running]", true);
execute_query(test.repl->nodes[0], "SET GLOBAL read_only=OFF");
sleep(5);
test.maxscales->ssh_node_f(0, true, "truncate -s 0 /var/log/maxscale/maxscale.log");
// Check that the Master and Slave status aren't both set
test.tprintf("Block master and wait for monitor to detect it.");
test.repl->block_node(0);
sleep(10);
execute_query(test.repl->nodes[0], "SET GLOBAL read_only=OFF");
test.maxscales->wait_for_monitor();
test.tprintf("Check that the new master doesn't have both slave and master labels");
test.check_log_err(0, "[Slave, Running] -> [Master, Slave, Running]", false);
test.check_log_err(0, "[Slave, Running] -> [Master, Running]", true);
test.repl->unblock_node(0);
test.tprintf("Cleanup");
test.repl->execute_query_all_nodes( "STOP ALL SLAVES; RESET SLAVE ALL;");
test.repl->fix_replication();
return test.global_result;
}

View File

@ -97,7 +97,7 @@ bool Backend::execute_session_command()
case MXS_COM_STMT_CLOSE:
case MXS_COM_STMT_SEND_LONG_DATA:
/** These commands do not generate responses */
rval = Backend::write(buffer, NO_RESPONSE);
rval = write(buffer, NO_RESPONSE);
complete_session_command();
ss_dassert(!is_waiting_result());
break;
@ -113,7 +113,7 @@ bool Backend::execute_session_command()
// TODO: Remove use of GWBUF_TYPE_SESCMD
//Mark session command buffer, it triggers writing MySQL command to protocol
gwbuf_set_type(buffer, GWBUF_TYPE_SESCMD);
rval = Backend::write(buffer);
rval = write(buffer, EXPECT_RESPONSE);
ss_dassert(is_waiting_result());
break;
}
@ -221,6 +221,7 @@ bool Backend::write(GWBUF* buffer, response_type type)
bool Backend::auth(GWBUF* buffer)
{
ss_dassert(in_use());
bool rval = false;
if (m_dcb->func.auth(m_dcb, NULL, m_dcb->session, buffer) == 1)
@ -245,6 +246,7 @@ void Backend::store_command(GWBUF* buffer)
bool Backend::write_stored_command()
{
ss_dassert(in_use());
bool rval = false;
if (m_pending_cmd.length())

View File

@ -745,9 +745,16 @@ SRWBackend RWSplitSession::handle_slave_is_target(uint8_t cmd, uint32_t stmt_id)
ExecMap::iterator it = m_exec_map.find(stmt_id);
if (it != m_exec_map.end())
{
if (it->second->in_use())
{
target = it->second;
MXS_INFO("COM_STMT_FETCH on %s (%s)", target->name(), target->uri());
MXS_INFO("COM_STMT_FETCH on %s", target->uri());
}
else
{
MXS_INFO("Old target not in use, cannot proceed");
}
}
else
{
@ -763,6 +770,7 @@ SRWBackend RWSplitSession::handle_slave_is_target(uint8_t cmd, uint32_t stmt_id)
if (target)
{
atomic_add_uint64(&m_router->stats().n_slave, 1);
ss_dassert(target->in_use());
}
else
{