Use normal config for server_weight
The backends used for the test don't have to be Galera servers as the functionality is generic.
This commit is contained in:
@ -769,7 +769,7 @@ add_test_executable(sequence.cpp sequence replication LABELS LIGHT)
|
|||||||
add_test_executable(compound_statement.cpp compound_statement replication LABELS readwritesplit LIGHT)
|
add_test_executable(compound_statement.cpp compound_statement replication LABELS readwritesplit LIGHT)
|
||||||
|
|
||||||
# Check if 'weightby' parameter works
|
# Check if 'weightby' parameter works
|
||||||
add_test_executable(server_weight.cpp server_weight galera.weight LABELS readwritesplit readconnroute LIGHT GALERA_BACKEND)
|
add_test_executable(server_weight.cpp server_weight server_weight LABELS readwritesplit readconnroute LIGHT REPL_BACKEND)
|
||||||
|
|
||||||
# test for 'max_sescmd_history' and 'connection_timeout' parameters
|
# test for 'max_sescmd_history' and 'connection_timeout' parameters
|
||||||
add_test_executable(session_limits.cpp session_limits session_limits LABELS readwritesplit REPL_BACKEND)
|
add_test_executable(session_limits.cpp session_limits session_limits LABELS readwritesplit REPL_BACKEND)
|
||||||
|
28
maxscale-system-test/cnf/maxscale.cnf.template.galera.weight → maxscale-system-test/cnf/maxscale.cnf.template.server_weight
Executable file → Normal file
28
maxscale-system-test/cnf/maxscale.cnf.template.galera.weight → maxscale-system-test/cnf/maxscale.cnf.template.server_weight
Executable file → Normal file
@ -1,15 +1,12 @@
|
|||||||
[maxscale]
|
[maxscale]
|
||||||
threads=###threads###
|
threads=###threads###
|
||||||
log_warning=1
|
|
||||||
|
|
||||||
[Galera Monitor]
|
[Mariadb Monitor]
|
||||||
type=monitor
|
type=monitor
|
||||||
module=galeramon
|
module=mariadbmon
|
||||||
servers=server1,server2,server3,server4
|
servers=server1,server2,server3,server4
|
||||||
user=maxskysql
|
user=maxskysql
|
||||||
password=skysql
|
password=skysql
|
||||||
use_priority=true
|
|
||||||
root_node_as_master=false
|
|
||||||
|
|
||||||
[RW Split Router]
|
[RW Split Router]
|
||||||
type=service
|
type=service
|
||||||
@ -24,7 +21,7 @@ password=skysql
|
|||||||
[Read Connection Router]
|
[Read Connection Router]
|
||||||
type=service
|
type=service
|
||||||
router=readconnroute
|
router=readconnroute
|
||||||
router_options=synced
|
router_options=running
|
||||||
servers=server1,server2,server3,server4
|
servers=server1,server2,server3,server4
|
||||||
weightby=serversize
|
weightby=serversize
|
||||||
user=maxskysql
|
user=maxskysql
|
||||||
@ -35,14 +32,12 @@ type=listener
|
|||||||
service=RW Split Router
|
service=RW Split Router
|
||||||
protocol=MySQLClient
|
protocol=MySQLClient
|
||||||
port=4006
|
port=4006
|
||||||
#socket=/tmp/rwsplit.sock
|
|
||||||
|
|
||||||
[Read Connection Listener]
|
[Read Connection Listener]
|
||||||
type=listener
|
type=listener
|
||||||
service=Read Connection Router
|
service=Read Connection Router
|
||||||
protocol=MySQLClient
|
protocol=MySQLClient
|
||||||
port=4008
|
port=4008
|
||||||
#socket=/tmp/readconn.sock
|
|
||||||
|
|
||||||
[CLI]
|
[CLI]
|
||||||
type=service
|
type=service
|
||||||
@ -56,33 +51,32 @@ socket=default
|
|||||||
|
|
||||||
[server1]
|
[server1]
|
||||||
type=server
|
type=server
|
||||||
address=###galera_server_IP_1###
|
address=###node_server_IP_1###
|
||||||
port=###galera_server_port_1###
|
port=###node_server_port_1###
|
||||||
protocol=MySQLBackend
|
protocol=MySQLBackend
|
||||||
serversize=1
|
serversize=1
|
||||||
serversize_rws=1
|
serversize_rws=1
|
||||||
priority=1
|
|
||||||
|
|
||||||
[server2]
|
[server2]
|
||||||
type=server
|
type=server
|
||||||
address=###galera_server_IP_2###
|
address=###node_server_IP_2###
|
||||||
port=###galera_server_port_2###
|
port=###node_server_port_2###
|
||||||
protocol=MySQLBackend
|
protocol=MySQLBackend
|
||||||
serversize=2
|
serversize=2
|
||||||
serversize_rws=30000
|
serversize_rws=30000
|
||||||
|
|
||||||
[server3]
|
[server3]
|
||||||
type=server
|
type=server
|
||||||
address=###galera_server_IP_3###
|
address=###node_server_IP_3###
|
||||||
port=###galera_server_port_3###
|
port=###node_server_port_3###
|
||||||
protocol=MySQLBackend
|
protocol=MySQLBackend
|
||||||
serversize=3
|
serversize=3
|
||||||
serversize_rws=20000
|
serversize_rws=20000
|
||||||
|
|
||||||
[server4]
|
[server4]
|
||||||
type=server
|
type=server
|
||||||
address=###galera_server_IP_4###
|
address=###node_server_IP_4###
|
||||||
port=###galera_server_port_4###
|
port=###node_server_port_4###
|
||||||
protocol=MySQLBackend
|
protocol=MySQLBackend
|
||||||
serversize=0
|
serversize=0
|
||||||
serversize_rws=10000
|
serversize_rws=10000
|
@ -14,7 +14,7 @@ void check_conn_num(TestConnections& test, int* Nc)
|
|||||||
{
|
{
|
||||||
for (int i = 0; i < 4; i++)
|
for (int i = 0; i < 4; i++)
|
||||||
{
|
{
|
||||||
int conn_num = get_conn_num(test.galera->nodes[i],
|
int conn_num = get_conn_num(test.repl->nodes[i],
|
||||||
test.maxscales->IP[0],
|
test.maxscales->IP[0],
|
||||||
test.maxscales->hostname[0],
|
test.maxscales->hostname[0],
|
||||||
(char*) "test");
|
(char*) "test");
|
||||||
@ -35,7 +35,7 @@ int main(int argc, char* argv[])
|
|||||||
test.set_timeout(30);
|
test.set_timeout(30);
|
||||||
int i;
|
int i;
|
||||||
|
|
||||||
test.galera->connect();
|
test.repl->connect();
|
||||||
|
|
||||||
test.tprintf("Connecting to ReadConnMaster on %s\n", test.maxscales->IP[0]);
|
test.tprintf("Connecting to ReadConnMaster on %s\n", test.maxscales->IP[0]);
|
||||||
for (i = 0; i < maxscale_conn_num; i++)
|
for (i = 0; i < maxscale_conn_num; i++)
|
||||||
@ -77,9 +77,6 @@ int main(int argc, char* argv[])
|
|||||||
test.tprintf("Sleeping 15 seconds\n");
|
test.tprintf("Sleeping 15 seconds\n");
|
||||||
sleep(15);
|
sleep(15);
|
||||||
|
|
||||||
/** Readwritesplit should always create a connection to the master. For
|
|
||||||
* this test we use the priority mechanism to force the first node as
|
|
||||||
* the master since Galera clusters don't have a deterministic master node. */
|
|
||||||
Nc[1] = maxscale_conn_num / 2;
|
Nc[1] = maxscale_conn_num / 2;
|
||||||
Nc[2] = maxscale_conn_num / 3;
|
Nc[2] = maxscale_conn_num / 3;
|
||||||
Nc[3] = maxscale_conn_num / 6;
|
Nc[3] = maxscale_conn_num / 6;
|
||||||
@ -93,7 +90,7 @@ int main(int argc, char* argv[])
|
|||||||
{
|
{
|
||||||
mysql_close(conn_rwsplit[0][i]);
|
mysql_close(conn_rwsplit[0][i]);
|
||||||
}
|
}
|
||||||
test.galera->close_connections();
|
test.repl->close_connections();
|
||||||
|
|
||||||
return test.global_result;
|
return test.global_result;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user