forked from mariadb-corporation/MaxScale
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathbug676.cc
52 lines (42 loc) · 1.36 KB
/
bug676.cc
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
/*
* Copyright (c) 2016 MariaDB Corporation Ab
* Copyright (c) 2023 MariaDB plc, Finnish Branch
*
* Use of this software is governed by the Business Source License included
* in the LICENSE.TXT file and at www.mariadb.com/bsl11.
*
* Change Date: 2027-04-10
*
* On the date above, in accordance with the Business Source License, use
* of this software will be governed by version 2 or later of the General
* Public License.
*/
/**
* @file bug676.cpp reproducing attempt for bug676
* - connect to RWSplit
* - stop node0
* - sleep 20 seconds
* - reconnect
* - check if 'USE test' is ok
* - check MaxScale is alive
*/
#include <maxtest/testconnections.hh>
#include <maxtest/galera_cluster.hh>
int main(int argc, char* argv[])
{
TestConnections test(argc, argv);
test.reset_timeout();
test.maxscale->connect_maxscale();
test.tprintf("Stopping node 0");
test.galera->block_node(0);
test.maxscale->close_maxscale_connections();
test.tprintf("Waiting until the monitor picks a new master");
test.maxscale->wait_for_monitor();
test.reset_timeout();
test.maxscale->connect_maxscale();
test.try_query(test.maxscale->conn_rwsplit, "USE test");
test.try_query(test.maxscale->conn_rwsplit, "show processlist;");
test.maxscale->close_maxscale_connections();
test.galera->unblock_node(0);
return test.global_result;
}