Merge branch '2.3' into develop
This commit is contained in:
@ -139,7 +139,7 @@ git clone https://github.com/alanxz/rabbitmq-c.git
|
|||||||
if [ $? != 0 ]
|
if [ $? != 0 ]
|
||||||
then
|
then
|
||||||
echo "Error cloning rabbitmq-c"
|
echo "Error cloning rabbitmq-c"
|
||||||
rm -rf $tmpdir
|
sudo rm -rf $tmpdir
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -157,7 +157,7 @@ wget -q --no-check-certificate http://prdownloads.sourceforge.net/tcl/tcl8.6.5-s
|
|||||||
if [ $? != 0 ]
|
if [ $? != 0 ]
|
||||||
then
|
then
|
||||||
echo "Error getting tcl"
|
echo "Error getting tcl"
|
||||||
rm -rf $tmpdir
|
sudo rm -rf $tmpdir
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -173,7 +173,7 @@ git clone https://github.com/akheron/jansson.git
|
|||||||
if [ $? != 0 ]
|
if [ $? != 0 ]
|
||||||
then
|
then
|
||||||
echo "Error cloning jansson"
|
echo "Error cloning jansson"
|
||||||
rm -rf $tmpdir
|
sudo rm -rf $tmpdir
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
|
|
||||||
@ -191,7 +191,7 @@ wget -q -r -l1 -nH --cut-dirs=2 --no-parent -A.tar.gz --no-directories http://mi
|
|||||||
if [ $? != 0 ]
|
if [ $? != 0 ]
|
||||||
then
|
then
|
||||||
echo "Error getting avro-c"
|
echo "Error getting avro-c"
|
||||||
rm -rf $tmpdir
|
sudo rm -rf $tmpdir
|
||||||
exit 1
|
exit 1
|
||||||
fi
|
fi
|
||||||
avro_filename=`ls -1 avro*.tar.gz`
|
avro_filename=`ls -1 avro*.tar.gz`
|
||||||
@ -209,4 +209,4 @@ wget --quiet https://nodejs.org/dist/v6.11.2/node-v6.11.2-linux-x64.tar.xz
|
|||||||
tar -axf node-v6.11.2-linux-x64.tar.xz
|
tar -axf node-v6.11.2-linux-x64.tar.xz
|
||||||
sudo cp -t /usr -r node-v6.11.2-linux-x64/*
|
sudo cp -t /usr -r node-v6.11.2-linux-x64/*
|
||||||
|
|
||||||
rm -rf $tmpdir
|
sudo rm -rf $tmpdir
|
||||||
|
@ -198,7 +198,7 @@ add_test_executable(different_size_rwsplit.cpp different_size_rwsplit replicatio
|
|||||||
add_test_executable(encrypted_passwords.cpp encrypted_passwords replication LABELS maxscale LIGHT REPL_BACKEND)
|
add_test_executable(encrypted_passwords.cpp encrypted_passwords replication LABELS maxscale LIGHT REPL_BACKEND)
|
||||||
|
|
||||||
# Basic MaxCtrl test
|
# Basic MaxCtrl test
|
||||||
add_test_executable(maxctrl_basic.cpp maxctrl_basic replication LABELS maxctrl REPL_BACKEND)
|
add_test_executable(maxctrl_basic.cpp maxctrl_basic maxctrl_basic LABELS maxctrl REPL_BACKEND)
|
||||||
|
|
||||||
# MXS-2167: Monitors should be able to use extra_port
|
# MXS-2167: Monitors should be able to use extra_port
|
||||||
add_test_executable(mxs2167_extra_port.cpp mxs2167_extra_port mxs2167_extra_port LABELS REPL_BACKEND)
|
add_test_executable(mxs2167_extra_port.cpp mxs2167_extra_port mxs2167_extra_port LABELS REPL_BACKEND)
|
||||||
|
95
maxscale-system-test/cnf/maxscale.cnf.template.maxctrl_basic
Normal file
95
maxscale-system-test/cnf/maxscale.cnf.template.maxctrl_basic
Normal file
@ -0,0 +1,95 @@
|
|||||||
|
[maxscale]
|
||||||
|
threads=###threads###
|
||||||
|
|
||||||
|
[MySQL Monitor]
|
||||||
|
type=monitor
|
||||||
|
module=mysqlmon
|
||||||
|
servers=server1,server2,server3,server4
|
||||||
|
user=maxskysql
|
||||||
|
password=skysql
|
||||||
|
monitor_interval=1000
|
||||||
|
detect_stale_master=false
|
||||||
|
detect_standalone_master=false
|
||||||
|
|
||||||
|
[RW Split Router]
|
||||||
|
type=service
|
||||||
|
router=readwritesplit
|
||||||
|
servers=server1,server2,server3,server4
|
||||||
|
user=maxskysql
|
||||||
|
password=skysql
|
||||||
|
slave_selection_criteria=LEAST_GLOBAL_CONNECTIONS
|
||||||
|
max_slave_connections=1
|
||||||
|
|
||||||
|
[Read Connection Router Slave]
|
||||||
|
type=service
|
||||||
|
router=readconnroute
|
||||||
|
router_options=slave
|
||||||
|
servers=server1,server2,server3,server4
|
||||||
|
user=maxskysql
|
||||||
|
password=skysql
|
||||||
|
|
||||||
|
[Read Connection Router Master]
|
||||||
|
type=service
|
||||||
|
router=readconnroute
|
||||||
|
router_options=master
|
||||||
|
servers=server1,server2,server3,server4
|
||||||
|
user=maxskysql
|
||||||
|
password=skysql
|
||||||
|
filters=qla
|
||||||
|
|
||||||
|
[RW Split Listener]
|
||||||
|
type=listener
|
||||||
|
service=RW Split Router
|
||||||
|
protocol=MySQLClient
|
||||||
|
port=4006
|
||||||
|
|
||||||
|
[Read Connection Listener Slave]
|
||||||
|
type=listener
|
||||||
|
service=Read Connection Router Slave
|
||||||
|
protocol=MySQLClient
|
||||||
|
port=4009
|
||||||
|
|
||||||
|
[Read Connection Listener Master]
|
||||||
|
type=listener
|
||||||
|
service=Read Connection Router Master
|
||||||
|
protocol=MySQLClient
|
||||||
|
port=4008
|
||||||
|
|
||||||
|
[qla]
|
||||||
|
type=filter
|
||||||
|
module=qlafilter
|
||||||
|
filebase=/tmp/QueryLog
|
||||||
|
|
||||||
|
[CLI]
|
||||||
|
type=service
|
||||||
|
router=cli
|
||||||
|
|
||||||
|
[CLI Listener]
|
||||||
|
type=listener
|
||||||
|
service=CLI
|
||||||
|
protocol=maxscaled
|
||||||
|
socket=default
|
||||||
|
|
||||||
|
[server1]
|
||||||
|
type=server
|
||||||
|
address=###node_server_IP_1###
|
||||||
|
port=###node_server_port_1###
|
||||||
|
protocol=MySQLBackend
|
||||||
|
|
||||||
|
[server2]
|
||||||
|
type=server
|
||||||
|
address=###node_server_IP_2###
|
||||||
|
port=###node_server_port_2###
|
||||||
|
protocol=MySQLBackend
|
||||||
|
|
||||||
|
[server3]
|
||||||
|
type=server
|
||||||
|
address=###node_server_IP_3###
|
||||||
|
port=###node_server_port_3###
|
||||||
|
protocol=MySQLBackend
|
||||||
|
|
||||||
|
[server4]
|
||||||
|
type=server
|
||||||
|
address=###node_server_IP_4###
|
||||||
|
port=###node_server_port_4###
|
||||||
|
protocol=MySQLBackend
|
@ -26,6 +26,76 @@ int main(int argc, char** argv)
|
|||||||
rc = test.maxscales->ssh_node_f(0, false, "maxctrl --tsv list servers|grep 'Maintenance'");
|
rc = test.maxscales->ssh_node_f(0, false, "maxctrl --tsv list servers|grep 'Maintenance'");
|
||||||
test.expect(rc != 0, "`list servers` should have no rows with: Maintanance");
|
test.expect(rc != 0, "`list servers` should have no rows with: Maintanance");
|
||||||
|
|
||||||
|
test.tprintf("Execute all available commands");
|
||||||
|
test.maxscales->ssh_node_f(0, false,
|
||||||
|
"maxctrl list servers;"
|
||||||
|
"maxctrl list services;"
|
||||||
|
"maxctrl list listeners RW-Split-Router;"
|
||||||
|
"maxctrl list monitors;"
|
||||||
|
"maxctrl list sessions;"
|
||||||
|
"maxctrl list filters;"
|
||||||
|
"maxctrl list modules;"
|
||||||
|
"maxctrl list threads;"
|
||||||
|
"maxctrl list users;"
|
||||||
|
"maxctrl list commands;"
|
||||||
|
"maxctrl show server server1;"
|
||||||
|
"maxctrl show servers;"
|
||||||
|
"maxctrl show service RW-Split-Router;"
|
||||||
|
"maxctrl show services;"
|
||||||
|
"maxctrl show monitor MySQL-Monitor;"
|
||||||
|
"maxctrl show monitors;"
|
||||||
|
"maxctrl show session 1;"
|
||||||
|
"maxctrl show sessions;"
|
||||||
|
"maxctrl show filter qla;"
|
||||||
|
"maxctrl show filters;"
|
||||||
|
"maxctrl show module readwritesplit;"
|
||||||
|
"maxctrl show modules;"
|
||||||
|
"maxctrl show maxscale;"
|
||||||
|
"maxctrl show thread 1;"
|
||||||
|
"maxctrl show threads;"
|
||||||
|
"maxctrl show logging;"
|
||||||
|
"maxctrl show commands mariadbmon;"
|
||||||
|
"maxctrl drain server server1;"
|
||||||
|
"maxctrl clear server server1 maintenance;"
|
||||||
|
"maxctrl enable log-priority info;"
|
||||||
|
"maxctrl enable account vagrant;"
|
||||||
|
"maxctrl disable log-priority info;"
|
||||||
|
"maxctrl disable account vagrant;"
|
||||||
|
"maxctrl create server server5 127.0.0.1 3306;"
|
||||||
|
"maxctrl create monitor mon1 mariadbmon user=skysql password=skysql;"
|
||||||
|
"maxctrl create service svc1 readwritesplit user=skysql password=skysql;"
|
||||||
|
"maxctrl create filter qla2 qlafilter filebase=/tmp/qla2.log;"
|
||||||
|
"maxctrl create listener svc1 listener1 9999;"
|
||||||
|
"maxctrl create user maxuser maxpwd;"
|
||||||
|
"maxctrl link service svc1 server5;"
|
||||||
|
"maxctrl link monitor mon1 server5;"
|
||||||
|
"maxctrl alter service-filters svc1 qla2"
|
||||||
|
"maxctrl unlink service svc1 server5;"
|
||||||
|
"maxctrl unlink monitor mon1 server5;"
|
||||||
|
"maxctrl alter service-filters svc1"
|
||||||
|
"maxctrl destroy server server5;"
|
||||||
|
"maxctrl destroy listener svc1 listener1;"
|
||||||
|
"maxctrl destroy monitor mon1;"
|
||||||
|
"maxctrl destroy filter qla2;"
|
||||||
|
"maxctrl destroy service svc1;"
|
||||||
|
"maxctrl destroy user maxuser;"
|
||||||
|
"maxctrl stop service RW-Split-Router;"
|
||||||
|
"maxctrl stop monitor MySQL-Monitor;"
|
||||||
|
"maxctrl stop maxscale;"
|
||||||
|
"maxctrl start service RW-Split-Router;"
|
||||||
|
"maxctrl start monitor MySQL-Monitor;"
|
||||||
|
"maxctrl start maxscale;"
|
||||||
|
"maxctrl alter server server1 port 3307;"
|
||||||
|
"maxctrl alter server server1 port 3306;"
|
||||||
|
"maxctrl alter monitor MySQL-Monitor auto_failover true;"
|
||||||
|
"maxctrl alter service RW-Split-Router max_slave_connections=3;"
|
||||||
|
"maxctrl alter logging highprecision true;"
|
||||||
|
"maxctrl alter maxscale passive true;"
|
||||||
|
"maxctrl rotate logs;"
|
||||||
|
"maxctrl call command mariadbmon reset-replication MySQL-Monitor;"
|
||||||
|
"maxctrl api get servers;"
|
||||||
|
"maxctrl classify 'select 1';");
|
||||||
|
|
||||||
test.check_maxscale_alive();
|
test.check_maxscale_alive();
|
||||||
return test.global_result;
|
return test.global_result;
|
||||||
}
|
}
|
||||||
|
@ -256,10 +256,10 @@ void dprintAllFilters(DCB* dcb)
|
|||||||
* Designed to be called within a debug CLI in order
|
* Designed to be called within a debug CLI in order
|
||||||
* to display all active filters in MaxScale
|
* to display all active filters in MaxScale
|
||||||
*/
|
*/
|
||||||
void dprintFilter(DCB* dcb, const SFilterDef& filter)
|
void dprintFilter(DCB* dcb, const FilterDef* filter)
|
||||||
{
|
{
|
||||||
mxb_assert(filter);
|
mxb_assert(filter);
|
||||||
dcb_printf(dcb, "FilterDef %p (%s)\n", filter.get(), filter->name.c_str());
|
dcb_printf(dcb, "FilterDef %p (%s)\n", filter, filter->name.c_str());
|
||||||
dcb_printf(dcb, "\tModule: %s\n", filter->module.c_str());
|
dcb_printf(dcb, "\tModule: %s\n", filter->module.c_str());
|
||||||
if (filter->obj && filter->filter)
|
if (filter->obj && filter->filter)
|
||||||
{
|
{
|
||||||
|
@ -93,7 +93,7 @@ void filter_destroy_instances();
|
|||||||
bool filter_serialize(const SFilterDef& filter);
|
bool filter_serialize(const SFilterDef& filter);
|
||||||
|
|
||||||
void dprintAllFilters(DCB*);
|
void dprintAllFilters(DCB*);
|
||||||
void dprintFilter(DCB*, const SFilterDef&);
|
void dprintFilter(DCB*, const FilterDef*);
|
||||||
void dListFilters(DCB*);
|
void dListFilters(DCB*);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -26,6 +26,8 @@
|
|||||||
#include <maxscale/modutil.hh>
|
#include <maxscale/modutil.hh>
|
||||||
#include <maxscale/pcre2.h>
|
#include <maxscale/pcre2.h>
|
||||||
#include <maxscale/utils.h>
|
#include <maxscale/utils.h>
|
||||||
|
#include <maxscale/jansson.hh>
|
||||||
|
#include <maxscale/buffer.hh>
|
||||||
|
|
||||||
#include "internal/config_runtime.h"
|
#include "internal/config_runtime.h"
|
||||||
#include "internal/modules.h"
|
#include "internal/modules.h"
|
||||||
|
@ -353,15 +353,17 @@ bool AvroConverter::open_table(const STableMapEvent& map, const STableCreateEven
|
|||||||
return rval;
|
return rval;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool AvroConverter::prepare_table(std::string database, std::string table)
|
bool AvroConverter::prepare_table(const STableMapEvent& map, const STableCreateEvent& create)
|
||||||
{
|
{
|
||||||
bool rval = false;
|
bool rval = false;
|
||||||
auto it = m_open_tables.find(database + "." + table);
|
auto it = m_open_tables.find(map->database + "." + map->table);
|
||||||
|
|
||||||
if (it != m_open_tables.end())
|
if (it != m_open_tables.end())
|
||||||
{
|
{
|
||||||
m_writer_iface = it->second->avro_writer_iface;
|
m_writer_iface = it->second->avro_writer_iface;
|
||||||
m_avro_file = &it->second->avro_file;
|
m_avro_file = &it->second->avro_file;
|
||||||
|
m_map = map;
|
||||||
|
m_create = create;
|
||||||
rval = true;
|
rval = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -49,7 +49,7 @@ public:
|
|||||||
|
|
||||||
AvroConverter(std::string avrodir, uint64_t block_size, mxs_avro_codec_type codec);
|
AvroConverter(std::string avrodir, uint64_t block_size, mxs_avro_codec_type codec);
|
||||||
bool open_table(const STableMapEvent& map, const STableCreateEvent& create);
|
bool open_table(const STableMapEvent& map, const STableCreateEvent& create);
|
||||||
bool prepare_table(std::string database, std::string table);
|
bool prepare_table(const STableMapEvent& map, const STableCreateEvent& create);
|
||||||
void flush_tables();
|
void flush_tables();
|
||||||
void prepare_row(const gtid_pos_t& gtid, const REP_HEADER& hdr, int event_type);
|
void prepare_row(const gtid_pos_t& gtid, const REP_HEADER& hdr, int event_type);
|
||||||
bool commit(const gtid_pos_t& gtid);
|
bool commit(const gtid_pos_t& gtid);
|
||||||
|
@ -243,6 +243,7 @@ uint8_t* process_row_event_data(STableMapEvent map,
|
|||||||
uint8_t* columns_present,
|
uint8_t* columns_present,
|
||||||
uint8_t* end)
|
uint8_t* end)
|
||||||
{
|
{
|
||||||
|
mxb_assert(create->database == map->database && create->table == map->table);
|
||||||
int npresent = 0;
|
int npresent = 0;
|
||||||
long ncolumns = map->columns();
|
long ncolumns = map->columns();
|
||||||
uint8_t* metadata = &map->column_metadata[0];
|
uint8_t* metadata = &map->column_metadata[0];
|
||||||
@ -624,11 +625,17 @@ bool Rpl::handle_row_event(REP_HEADER* hdr, uint8_t* ptr)
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
bool ok = m_handler->prepare_table(map->database, map->table);
|
|
||||||
auto create = m_created_tables.find(table_ident);
|
auto create = m_created_tables.find(table_ident);
|
||||||
|
bool ok = false;
|
||||||
|
|
||||||
if (ok && create != m_created_tables.end()
|
if (create != m_created_tables.end() && ncolumns == map->columns()
|
||||||
&& ncolumns == map->columns() && create->second->columns.size() == map->columns())
|
&& create->second->columns.size() == map->columns()
|
||||||
|
&& m_handler->prepare_table(map, create->second))
|
||||||
|
{
|
||||||
|
ok = true;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (ok)
|
||||||
{
|
{
|
||||||
/** Each event has one or more rows in it. The number of rows is not known
|
/** Each event has one or more rows in it. The number of rows is not known
|
||||||
* beforehand so we must continue processing them until we reach the end
|
* beforehand so we must continue processing them until we reach the end
|
||||||
|
@ -183,8 +183,8 @@ public:
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
// Prepare a new row for processing
|
// Prepare a table for row processing
|
||||||
virtual bool prepare_table(std::string database, std::string table)
|
virtual bool prepare_table(const STableMapEvent& map, const STableCreateEvent& create)
|
||||||
{
|
{
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -807,7 +807,7 @@ static MXS_ROUTER* createInstance(SERVICE* service, MXS_CONFIG_PARAMETER* params
|
|||||||
{
|
{
|
||||||
{"address", "_none_"},
|
{"address", "_none_"},
|
||||||
{"port", "3306"},
|
{"port", "3306"},
|
||||||
{"protocol", "MySQLBackend"},
|
{"protocol", "mariadbbackend"},
|
||||||
{"authenticator", "MySQLBackendAuth"}
|
{"authenticator", "MySQLBackendAuth"}
|
||||||
}, config_server_params);
|
}, config_server_params);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user