Below is the list of changes that have just been committed into a local
5.1 repository of tomas. When tomas does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html
ChangeSet
1.1871 05/04/14 03:26:41 tomas@stripped +3 -0
ndb_config_1_node.ini:
new file
ndbcluster.sh:
added option to run cluster with different number of nodes (for replicaiton slave it
is convenients to just run with one node)
mysql-test-run.sh:
(partly) added options for running slave with ndbcluster
mysql-test/ndb/ndb_config_1_node.ini
1.1 05/04/14 03:26:01 tomas@stripped +25 -0
mysql-test/ndb/ndb_config_1_node.ini
1.0 05/04/14 03:26:01 tomas@stripped +0 -0
BitKeeper file /home/tomas/mysql-5.1-wl2325/mysql-test/ndb/ndb_config_1_node.ini
mysql-test/ndb/ndbcluster.sh
1.42 05/04/14 03:25:30 tomas@stripped +26 -22
added option to run cluster with different number of nodes (for replicaiton slave it
is convenients to just run with one node)
mysql-test/mysql-test-run.sh
1.256 05/04/14 03:25:30 tomas@stripped +38 -2
(partly) added options for running slave with ndbcluster
# This is a BitKeeper patch. What follows are the unified diffs for the
# set of deltas contained in the patch. The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User: tomas
# Host: poseidon.ndb.mysql.com
# Root: /home/tomas/mysql-5.1-wl2325
--- 1.255/mysql-test/mysql-test-run.sh 2005-03-22 12:30:42 +01:00
+++ 1.256/mysql-test/mysql-test-run.sh 2005-04-14 03:25:30 +02:00
@@ -212,6 +212,7 @@
SLAVE_MYPORT=9308 # leave room for 2 masters for cluster tests
MYSQL_MANAGER_PORT=9305 # needs to be out of the way of slaves
NDBCLUSTER_PORT=9350
+SLAVE_NDBCLUSTER_PORT=9358
MYSQL_MANAGER_PW_FILE=$MYSQL_TEST_DIR/var/tmp/manager.pwd
MYSQL_MANAGER_LOG=$MYSQL_TEST_DIR/var/log/manager.log
MYSQL_MANAGER_USER=root
@@ -225,6 +226,7 @@
EXTRA_MYSQLBINLOG_OPT=""
USE_RUNNING_SERVER=0
USE_NDBCLUSTER=@USE_NDBCLUSTER@
+USE_NDBCLUSTER_SLAVE=@USE_NDBCLUSTER@
USE_RUNNING_NDBCLUSTER=""
USE_PURIFY=""
PURIFY_LOGS=""
@@ -278,9 +280,11 @@
--local) USE_RUNNING_SERVER=0 ;;
--extern) USE_RUNNING_SERVER=1 ;;
--with-ndbcluster)
- USE_NDBCLUSTER="--ndbcluster" ;;
+ USE_NDBCLUSTER="--ndbcluster" ;
+ USE_NDBCLUSTER_SLAVE="--ndbcluster" ;;
--ndb-connectstring=*)
USE_NDBCLUSTER="--ndbcluster" ;
+ USE_NDBCLUSTER_SLAVE="--ndbcluster" ;
USE_RUNNING_NDBCLUSTER=`$ECHO "$1" | $SED -e "s;--ndb-connectstring=;;"` ;;
--ndb_mgm-extra-opts=*)
NDB_MGM_EXTRA_OPTS=`$ECHO "$1" | $SED -e "s;--ndb_mgm-extra-opts=;;"` ;;
@@ -432,8 +436,11 @@
TMP=`$ECHO "$1" | $SED -e "s;--valgrind-options=;;"`
VALGRIND="$VALGRIND $TMP"
;;
+ --skip-ndbcluster-slave | --skip-ndb-slave)
+ USE_NDBCLUSTER_SLAVE="" ;;
--skip-ndbcluster | --skip-ndb)
USE_NDBCLUSTER=""
+ USE_NDBCLUSTER_SLAVE=""
EXTRA_MASTER_MYSQLD_OPT="$EXTRA_MASTER_MYSQLD_OPT --skip-ndbcluster"
EXTRA_SLAVE_MYSQLD_OPT="$EXTRA_SLAVE_MYSQLD_OPT --skip-ndbcluster"
;;
@@ -503,6 +510,9 @@
export MASTER_MYPORT SLAVE_MYPORT MYSQL_TCP_PORT MASTER_MYSOCK MASTER_MYSOCK1
NDBCLUSTER_OPTS="--port=$NDBCLUSTER_PORT --data-dir=$MYSQL_TEST_DIR/var
--ndb_mgm-extra-opts=$NDB_MGM_EXTRA_OPTS --ndb_mgmd-extra-opts=$NDB_MGMD_EXTRA_OPTS
--ndbd-extra-opts=$NDBD_EXTRA_OPTS"
+if [ -n USE_NDBCLUSTER_SLAVE ] ; then
+ USE_NDBCLUSTER="$NDBCLUSTER --ndb-connectstring=localhost:$SLAVE_NDBCLUSTER_PORT"
+fi
NDB_BACKUP_DIR=$MYSQL_TEST_DIR/var/ndbcluster-$NDBCLUSTER_PORT
NDB_TOOLS_OUTPUT=$MYSQL_TEST_DIR/var/log/ndb_tools.log
@@ -709,6 +719,8 @@
export PURIFYOPTIONS
NDB_STATUS_OK=1
export NDB_STATUS_OK
+NDB_SLAVE_STATUS_OK=1
+export NDB_SLAVE_STATUS_OK
MYSQL_TEST_ARGS="--no-defaults --socket=$MASTER_MYSOCK --database=$DB \
--user=$DBUSER --password=$DBPASSWD --silent -v --skip-safemalloc \
@@ -1263,6 +1275,7 @@
[ x$SKIP_SLAVE = x1 ] && return
eval "this_slave_running=\$SLAVE$1_RUNNING"
[ x$this_slave_running = 1 ] && return
+
# When testing fail-safe replication, we will have more than one slave
# in this case, we start secondary slaves with an argument
slave_ident="slave$1"
@@ -1286,6 +1299,25 @@
slave_pid=$SLAVE_MYPID
slave_sock="$SLAVE_MYSOCK"
fi
+
+ #
+ if [ -n $USE_NDBCLUSTER_SLAVE ] ; then
+ if [ $slave_server_id -eq 2 ] ; then
+ savedir=`pwd`
+ cd $MYSQL_TEST_DIR
+ ndb/ndbcluster --port=$SLAVE_NDBCLUSTER_PORT \
+ --initial --small --diskless --ndbd-nodes=1 \
+ || NDB_SLAVE_STATUS_OK=0
+ cd $savedir
+ if [ x$NDB_SLAVE_STATUS_OK != x1 ] ; then
+ if [ x$FORCE != x1 ] ; then
+ exit 1
+ fi
+ USE_NDBCLUSTER_SLAVE=
+ fi
+ fi
+ fi
+
# Remove stale binary logs and old master.info files
# except for too tests which need them
if [ "$tname" != "rpl_crash_binlog_ib_1b" ] && [ "$tname" !=
"rpl_crash_binlog_ib_2b" ] && [ "$tname" != "rpl_crash_binlog_ib_3b" ]
@@ -1335,7 +1367,8 @@
--master-retry-count=10 \
-O slave_net_timeout=10 \
$SMALL_SERVER \
- $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT"
+ $EXTRA_SLAVE_OPT $EXTRA_SLAVE_MYSQLD_OPT \
+ $USE_NDBCLUSTER_SLAVE"
CUR_MYERR=$slave_err
CUR_MYSOCK=$slave_sock
@@ -1417,6 +1450,9 @@
sleep $SLEEP_TIME_AFTER_RESTART
fi
eval "SLAVE$1_RUNNING=0"
+ if [ -n $USE_NDBCLUSTER_SLAVE ] ; then
+ ./ndb/ndbcluster --port=SLAVE_NDB_PORT --stop
+ fi
fi
}
--- 1.41/mysql-test/ndb/ndbcluster.sh 2005-02-09 19:29:20 +01:00
+++ 1.42/mysql-test/ndb/ndbcluster.sh 2005-04-14 03:25:30 +02:00
@@ -51,6 +51,7 @@
initial_ndb=
status_ndb=
ndb_diskless=0
+ndbd_nodes=2
ndb_no_ord=512
ndb_con_op=105000
@@ -76,6 +77,9 @@
--debug*)
flags_ndb="$flags_ndb $1"
;;
+ --ndbd-nodes=*)
+ ndbd_nodes=`echo "$1" | sed -e "s;--ndbd-nodes=;;"`
+ ;;
--status)
status_ndb=1
;;
@@ -114,9 +118,10 @@
done
fs_ndb="$fsdir/ndbcluster-$port"
+config_ini=ndb/ndb_config_${ndbd_nodes}_node.ini
NDB_HOME=
-if [ ! -x "$fsdir" ]; then
+if [ ! -d "$fsdir" ]; then
echo "$fsdir missing"
exit 1
fi
@@ -132,6 +137,10 @@
echo "$exec_waiter missing"
exit 1
fi
+if [ ! -f "$config_ini" ]; then
+ echo "$config_ini missing, unsupported number of nodes"
+ exit 1
+fi
exec_mgmtclient="$exec_mgmtclient --no-defaults $NDB_MGM_EXTRA_OPTS"
exec_mgmtsrvr="$exec_mgmtsrvr --no-defaults $NDB_MGMD_EXTRA_OPTS"
@@ -179,6 +188,7 @@
# Start management server as deamon
+
# Edit file system path and ports in config file
if [ $initial_ndb ] ; then
rm -f $fs_ndb/ndb_* 2>&1 | cat > /dev/null
@@ -191,7 +201,7 @@
-e s,"CHOOSE_HOSTNAME_".*,"$ndb_host",g \
-e s,"CHOOSE_FILESYSTEM","$fs_ndb",g \
-e s,"CHOOSE_PORT_MGM","$ndb_mgmd_port",g \
- < ndb/ndb_config_2_node.ini \
+ < "$config_ini" \
> "$fs_ndb/config.ini"
fi
@@ -202,7 +212,7 @@
echo "Unable to start $exec_mgmtsrvr from `pwd`"
exit 1
fi
-if sleep_until_file_created $fs_ndb/ndb_3.pid 120
+if sleep_until_file_created $fs_ndb/ndb_`expr $ndbd_nodes + 1`.pid 120
then :; else
exit 1
fi
@@ -210,25 +220,19 @@
# Start database node
-echo "Starting ndbd"
-( cd "$fs_ndb" ; $exec_ndb $flags_ndb & )
-if sleep_until_file_created $fs_ndb/ndb_1.pid 120
-then :; else
- stop_default_ndbcluster
- exit 1
-fi
-cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
-
-# Start database node
-
-echo "Starting ndbd"
-( cd "$fs_ndb" ; $exec_ndb $flags_ndb & )
-if sleep_until_file_created $fs_ndb/ndb_2.pid 120
-then :; else
- stop_default_ndbcluster
- exit 1
-fi
-cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
+id=1
+while [ $id -le $ndbd_nodes ]
+do
+ echo "Starting ndbd $id($ndbd_nodes)"
+ ( cd "$fs_ndb" ; $exec_ndb $flags_ndb & )
+ if sleep_until_file_created $fs_ndb/ndb_${id}.pid 120
+ then :; else
+ stop_default_ndbcluster
+ exit 1
+ fi
+ cat `find "$fs_ndb" -name 'ndb_*.pid'` > "$fs_ndb/$pidfile"
+ id=`expr $id + 1`
+done
# test if Ndb Cluster starts properly
--- New file ---
+++ mysql-test/ndb/ndb_config_1_node.ini 05/04/14 03:26:01
[ndbd default]
NoOfReplicas= 1
MaxNoOfConcurrentOperations= CHOOSE_MaxNoOfConcurrentOperations
DataMemory= CHOOSE_DataMemory
IndexMemory= CHOOSE_IndexMemory
Diskless= CHOOSE_Diskless
TimeBetweenWatchDogCheck= 30000
DataDir= CHOOSE_FILESYSTEM
MaxNoOfOrderedIndexes= CHOOSE_MaxNoOfOrderedIndexes
[ndbd]
HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
[ndb_mgmd]
HostName= CHOOSE_HOSTNAME_1 # hostname is a valid network adress
DataDir= CHOOSE_FILESYSTEM #
PortNumber= CHOOSE_PORT_MGM
[mysqld]
[mysqld]
[mysqld]
[mysqld]
| Thread |
|---|
| • bk commit into 5.1 tree (tomas:1.1871) | tomas | 14 Apr |