Debian Codegraph @

mysql-test/suite/ndb/t/ndb_connection_pool_nodeids.test

raw
1 #
2 # Tests for invalid uses of --ndb-cluster-connection-pool-nodeids=nodeid[,nodeidN]
3 #
4 --source include/have_ndb.inc
5 --source include/have_debug.inc
6
7
8 let MYSQLD_DATADIR= `select @@datadir`;
9 # Setup path to server output log file
10 let $error_log= $MYSQLTEST_VARDIR/tmp/my_restart.err;
11
12 # Setup MYSQLD_CMD_11 with correct group suffix to first
13 # mysqld in the cluster
14 let $MYSQLD_CMD_11 = `select REPLACE("$MYSQLD_CMD",
15 "defaults-group-suffix=.1",
16 "defaults-group-suffix=.1.1")`;
17 let $args= --loose-console > $error_log 2>&1;
18
19 # Use innodb-read-only to avoid that innodb starts recovery
20 # threads etc. since that will only cause mystery crashes
21 # when the mysqld startup is aborted due to the invalid
22 # option tests performed below. Would have been nice to
23 # skip innodb for these tests but that is not an option in 5.7
24 let $args = --innodb-read-only $args;
25
26 # Ignore the warning generated by ndbcluster's binlog thread
27 # when mysqld is restarted
28 --disable_query_log ONCE
29 call mtr.add_suppression("mysqld startup An incident event has been written");
30
31 --echo # Stop the running server
32 let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.1.expect;
33 --exec echo "wait" > $restart_file
34 --shutdown_server
35 --source include/wait_until_disconnected.inc
36
37 --echo # - Empty nodeid last
38 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="1,2," $args
39 let SEARCH_PATTERN= Found empty nodeid;
40 let SEARCH_FILE= $error_log;
41 --source include/search_pattern.inc
42 --remove_file $SEARCH_FILE
43
44 --echo # - Empty nodeid in the middle
45 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="1,,3" $args
46 let SEARCH_PATTERN= Found empty nodeid;
47 let SEARCH_FILE= $error_log;
48 --source include/search_pattern.inc
49 --remove_file $SEARCH_FILE
50
51 --echo # - Specified nodeid is not a number
52 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="1,a,3" $args
53 let SEARCH_PATTERN= Could not parse;
54 let SEARCH_FILE= $error_log;
55 --source include/search_pattern.inc
56 --remove_file $SEARCH_FILE
57
58 --echo # - Check valid nodeid(> 0)
59 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="2,0,5" --ndb-nodeid=1 $args
60 let SEARCH_PATTERN= Invalid nodeid 0;
61 let SEARCH_FILE= $error_log;
62 --source include/search_pattern.inc
63 --remove_file $SEARCH_FILE
64
65 --echo # - Check valid nodeid(<= 255)
66 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="2,256,5" --ndb-nodeid=1 $args
67 let SEARCH_PATTERN= Invalid nodeid 256;
68 let SEARCH_FILE= $error_log;
69 --source include/search_pattern.inc
70 --remove_file $SEARCH_FILE
71
72 --echo # - Specified nodeid is unique
73 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="1,1,3" $args
74 let SEARCH_PATTERN= Found duplicate nodeid 1;
75 let SEARCH_FILE= $error_log;
76 --source include/search_pattern.inc
77 --remove_file $SEARCH_FILE
78
79 --echo # - Number of nodeids in list must match size of pool
80 --echo # (config specifies --ndb-cluster-connection-pool=3)
81 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="1,3" $args
82 let SEARCH_PATTERN= The size of the cluster connection pool must be;
83 let SEARCH_FILE= $error_log;
84 --source include/search_pattern.inc
85 --remove_file $SEARCH_FILE
86
87 --echo # - First nodeid must be equal to --ndb-nodeid(if given)
88 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="2,3,5" --ndb-nodeid=1 $args
89 let SEARCH_PATTERN= The nodeid specified by --ndb-nodeid must be equal;
90 let SEARCH_FILE= $error_log;
91 --source include/search_pattern.inc
92 --remove_file $SEARCH_FILE
93
94 --echo # Cleanup
95 --enable_reconnect
96 --exec echo "restart" > $restart_file
97 --source include/wait_until_connected_again.inc