# # Tests for invalid uses of --ndb-cluster-connection-pool-nodeids=nodeid[,nodeidN] # --source include/have_ndb.inc --source include/have_debug.inc --source include/not_asan.inc let MYSQLD_DATADIR= `select @@datadir`; # Setup path to server output log file let $error_log= $MYSQLTEST_VARDIR/log/my_restart.err; # Setup MYSQLD_CMD_11 with correct group suffix to first # mysqld in the cluster let $MYSQLD_CMD_11 = `select REPLACE("$MYSQLD_CMD", "defaults-group-suffix=.1", "defaults-group-suffix=.1.1")`; let $args= --loose-console > $error_log 2>&1; # Use innodb-read-only to avoid that innodb starts recovery # threads etc. since that will only cause mystery crashes # when the mysqld startup is aborted due to the invalid # option tests performed below. Would have been nice to # skip innodb for these tests but that is not an option in 5.7 let $args = --innodb-read-only $args; # Ignore the warning generated by ndbcluster's binlog thread # when mysqld is restarted --disable_query_log ONCE call mtr.add_suppression("mysqld startup An incident event has been written"); --echo # Stop the running server let $restart_file= $MYSQLTEST_VARDIR/tmp/mysqld.1.1.expect; --exec echo "wait" > $restart_file --shutdown_server --source include/wait_until_disconnected.inc --echo # - Empty nodeid last --error 1 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="1,2," $args; let SEARCH_PATTERN= Found empty nodeid; let SEARCH_FILE= $error_log; --source include/search_pattern.inc --remove_file $SEARCH_FILE --echo # - Empty nodeid in the middle --error 1 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="1,,3" $args; let SEARCH_PATTERN= Found empty nodeid; let SEARCH_FILE= $error_log; --source include/search_pattern.inc --remove_file $SEARCH_FILE --echo # - Specified nodeid is not a number --error 1 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="1,a,3" $args; let SEARCH_PATTERN= Could not parse; let SEARCH_FILE= $error_log; --source include/search_pattern.inc --remove_file $SEARCH_FILE --echo # - Check valid nodeid(> 0) --error 1 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="2,0,5" --ndb-nodeid=1 $args; let SEARCH_PATTERN= Invalid nodeid 0; let SEARCH_FILE= $error_log; --source include/search_pattern.inc --remove_file $SEARCH_FILE --echo # - Check valid nodeid(<= 255) --error 1 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="2,256,5" --ndb-nodeid=1 $args; let SEARCH_PATTERN= Invalid nodeid 256; let SEARCH_FILE= $error_log; --source include/search_pattern.inc --remove_file $SEARCH_FILE --echo # - Specified nodeid is unique --error 1 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="1,1,3" $args; let SEARCH_PATTERN= Found duplicate nodeid 1; let SEARCH_FILE= $error_log; --source include/search_pattern.inc --remove_file $SEARCH_FILE --echo # - Number of nodeids in list must match size of pool --echo # (config specifies --ndb-cluster-connection-pool=3) --error 1 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="1,3" $args; let SEARCH_PATTERN= The size of the cluster connection pool must be; let SEARCH_FILE= $error_log; --source include/search_pattern.inc --remove_file $SEARCH_FILE --echo # - First nodeid must be equal to --ndb-nodeid(if given) --error 1 --exec $MYSQLD_CMD_11 --ndb-cluster-connection-pool-nodeids="2,3,5" --ndb-nodeid=1 $args; let SEARCH_PATTERN= The nodeid specified by --ndb-nodeid must be equal; let SEARCH_FILE= $error_log; --source include/search_pattern.inc --remove_file $SEARCH_FILE --echo # Cleanup --enable_reconnect --exec echo "restart" > $restart_file --source include/wait_until_connected_again.inc