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:
Markus Mäkelä 2018-11-02 17:20:36 +02:00
parent 8c9ecf2756
commit df003a3e7c
No known key found for this signature in database
GPG Key ID: 72D48FCE664F7B19
3 changed files with 15 additions and 24 deletions

View File

@ -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)
# 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
add_test_executable(session_limits.cpp session_limits session_limits LABELS readwritesplit REPL_BACKEND)

View File

@ -1,15 +1,12 @@
[maxscale]
threads=###threads###
log_warning=1
[Galera Monitor]
[Mariadb Monitor]
type=monitor
module=galeramon
module=mariadbmon
servers=server1,server2,server3,server4
user=maxskysql
password=skysql
use_priority=true
root_node_as_master=false
[RW Split Router]
type=service
@ -24,7 +21,7 @@ password=skysql
[Read Connection Router]
type=service
router=readconnroute
router_options=synced
router_options=running
servers=server1,server2,server3,server4
weightby=serversize
user=maxskysql
@ -35,14 +32,12 @@ type=listener
service=RW Split Router
protocol=MySQLClient
port=4006
#socket=/tmp/rwsplit.sock
[Read Connection Listener]
type=listener
service=Read Connection Router
protocol=MySQLClient
port=4008
#socket=/tmp/readconn.sock
[CLI]
type=service
@ -56,33 +51,32 @@ socket=default
[server1]
type=server
address=###galera_server_IP_1###
port=###galera_server_port_1###
address=###node_server_IP_1###
port=###node_server_port_1###
protocol=MySQLBackend
serversize=1
serversize_rws=1
priority=1
[server2]
type=server
address=###galera_server_IP_2###
port=###galera_server_port_2###
address=###node_server_IP_2###
port=###node_server_port_2###
protocol=MySQLBackend
serversize=2
serversize_rws=30000
[server3]
type=server
address=###galera_server_IP_3###
port=###galera_server_port_3###
address=###node_server_IP_3###
port=###node_server_port_3###
protocol=MySQLBackend
serversize=3
serversize_rws=20000
[server4]
type=server
address=###galera_server_IP_4###
port=###galera_server_port_4###
address=###node_server_IP_4###
port=###node_server_port_4###
protocol=MySQLBackend
serversize=0
serversize_rws=10000

View File

@ -14,7 +14,7 @@ void check_conn_num(TestConnections& test, int* Nc)
{
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->hostname[0],
(char*) "test");
@ -35,7 +35,7 @@ int main(int argc, char* argv[])
test.set_timeout(30);
int i;
test.galera->connect();
test.repl->connect();
test.tprintf("Connecting to ReadConnMaster on %s\n", test.maxscales->IP[0]);
for (i = 0; i < maxscale_conn_num; i++)
@ -77,9 +77,6 @@ int main(int argc, char* argv[])
test.tprintf("Sleeping 15 seconds\n");
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[2] = maxscale_conn_num / 3;
Nc[3] = maxscale_conn_num / 6;
@ -93,7 +90,7 @@ int main(int argc, char* argv[])
{
mysql_close(conn_rwsplit[0][i]);
}
test.galera->close_connections();
test.repl->close_connections();
return test.global_result;
}