summaryrefslogtreecommitdiff
path: root/ndb
diff options
context:
space:
mode:
authorjoreland@mysql.com <>2005-05-06 19:23:11 +0200
committerjoreland@mysql.com <>2005-05-06 19:23:11 +0200
commit05d21f4ec36ed204880e5f35dae34d84ada37d55 (patch)
tree0c00e456be9599e3c481560c438e0051bbbbe369 /ndb
parentc93efc34aea039109f83e4b5e16bff91faf99326 (diff)
parentff81ca1c05a120565a255540afcc1e079f43de7d (diff)
downloadmariadb-git-05d21f4ec36ed204880e5f35dae34d84ada37d55.tar.gz
Merge mysql.com:/home/jonas/src/mysql-5.0
into mysql.com:/home/jonas/src/mysql-5.0-ndb
Diffstat (limited to 'ndb')
-rw-r--r--ndb/src/cw/cpcd/APIService.cpp1
-rw-r--r--ndb/src/cw/cpcd/CPCD.hpp6
-rw-r--r--ndb/src/cw/cpcd/Process.cpp9
-rw-r--r--ndb/test/include/CpcClient.hpp1
-rw-r--r--ndb/test/run-test/conf-daily-basic-dl145a.txt2
-rw-r--r--ndb/test/run-test/conf-daily-basic-ndbmaster.txt2
-rw-r--r--ndb/test/run-test/conf-daily-devel-ndbmaster.txt2
-rw-r--r--ndb/test/run-test/conf-daily-sql-ndbmaster.txt4
-rw-r--r--ndb/test/run-test/main.cpp2
-rwxr-xr-xndb/test/run-test/ndb-autotest.sh12
-rw-r--r--ndb/test/src/CpcClient.cpp3
11 files changed, 35 insertions, 9 deletions
diff --git a/ndb/src/cw/cpcd/APIService.cpp b/ndb/src/cw/cpcd/APIService.cpp
index 63d0aaafe86..b009f0c0fc4 100644
--- a/ndb/src/cw/cpcd/APIService.cpp
+++ b/ndb/src/cw/cpcd/APIService.cpp
@@ -122,6 +122,7 @@ ParserRow<CPCDAPISession> commands[] =
CPCD_ARG("stderr", String, Optional, "Redirection of stderr"),
CPCD_ARG("stdin", String, Optional, "Redirection of stderr"),
CPCD_ARG("ulimit", String, Optional, "ulimit"),
+ CPCD_ARG("shutdown", String, Optional, "shutdown options"),
CPCD_CMD("undefine process", &CPCDAPISession::undefineProcess, ""),
CPCD_CMD_ALIAS("undef", "undefine process", 0),
diff --git a/ndb/src/cw/cpcd/CPCD.hpp b/ndb/src/cw/cpcd/CPCD.hpp
index a5c0bef1dac..aecc43150c4 100644
--- a/ndb/src/cw/cpcd/CPCD.hpp
+++ b/ndb/src/cw/cpcd/CPCD.hpp
@@ -243,6 +243,12 @@ public:
* @desc Format c:unlimited d:0 ...
*/
BaseString m_ulimit;
+
+ /**
+ * @brief shutdown options
+ */
+ BaseString m_shutdown_options;
+
private:
class CPCD *m_cpcd;
void do_exec();
diff --git a/ndb/src/cw/cpcd/Process.cpp b/ndb/src/cw/cpcd/Process.cpp
index 2509f34e882..fc5dc2d8839 100644
--- a/ndb/src/cw/cpcd/Process.cpp
+++ b/ndb/src/cw/cpcd/Process.cpp
@@ -44,6 +44,8 @@ CPCD::Process::print(FILE * f){
fprintf(f, "stdout: %s\n", m_stdout.c_str() ? m_stdout.c_str() : "");
fprintf(f, "stderr: %s\n", m_stderr.c_str() ? m_stderr.c_str() : "");
fprintf(f, "ulimit: %s\n", m_ulimit.c_str() ? m_ulimit.c_str() : "");
+ fprintf(f, "shutdown: %s\n", m_shutdown_options.c_str() ?
+ m_shutdown_options.c_str() : "");
}
CPCD::Process::Process(const Properties & props, class CPCD *cpcd) {
@@ -64,6 +66,7 @@ CPCD::Process::Process(const Properties & props, class CPCD *cpcd) {
props.get("stdout", m_stdout);
props.get("stderr", m_stderr);
props.get("ulimit", m_ulimit);
+ props.get("shutdown", m_shutdown_options);
m_status = STOPPED;
if(strcasecmp(m_type.c_str(), "temporary") == 0){
@@ -451,7 +454,11 @@ CPCD::Process::stop() {
m_status = STOPPING;
errno = 0;
- int ret = kill(-m_pid, SIGTERM);
+ int signo= SIGTERM;
+ if(m_shutdown_options == "SIGKILL")
+ signo= SIGKILL;
+
+ int ret = kill(-m_pid, signo);
switch(ret) {
case 0:
logger.debug("Sent SIGTERM to pid %d", (int)-m_pid);
diff --git a/ndb/test/include/CpcClient.hpp b/ndb/test/include/CpcClient.hpp
index 1655bc57b56..8d8e079d219 100644
--- a/ndb/test/include/CpcClient.hpp
+++ b/ndb/test/include/CpcClient.hpp
@@ -56,6 +56,7 @@ public:
BaseString m_stdout;
BaseString m_stderr;
BaseString m_ulimit;
+ BaseString m_shutdown_options;
};
private:
diff --git a/ndb/test/run-test/conf-daily-basic-dl145a.txt b/ndb/test/run-test/conf-daily-basic-dl145a.txt
index 63b7edf70f6..a7fc801498e 100644
--- a/ndb/test/run-test/conf-daily-basic-dl145a.txt
+++ b/ndb/test/run-test/conf-daily-basic-dl145a.txt
@@ -2,7 +2,7 @@ baseport: 16000
basedir: /space/autotest
mgm: CHOOSE_host1
ndb: CHOOSE_host2 CHOOSE_host3
-api: CHOOSE_host1 CHOOSE_host1 CHOOSE_hosts1
+api: CHOOSE_host1 CHOOSE_host1 CHOOSE_host1
-- cluster config
[DB DEFAULT]
NoOfReplicas: 2
diff --git a/ndb/test/run-test/conf-daily-basic-ndbmaster.txt b/ndb/test/run-test/conf-daily-basic-ndbmaster.txt
index 685ed7ddc64..695fe64c799 100644
--- a/ndb/test/run-test/conf-daily-basic-ndbmaster.txt
+++ b/ndb/test/run-test/conf-daily-basic-ndbmaster.txt
@@ -2,7 +2,7 @@ baseport: 16000
basedir: /space/autotest
mgm: CHOOSE_host1
ndb: CHOOSE_host2 CHOOSE_host3 CHOOSE_host2 CHOOSE_host3
-api: CHOOSE_host1 CHOOSE_host1 CHOOSE_hosts1
+api: CHOOSE_host1 CHOOSE_host1 CHOOSE_host1
-- cluster config
[DB DEFAULT]
NoOfReplicas: 2
diff --git a/ndb/test/run-test/conf-daily-devel-ndbmaster.txt b/ndb/test/run-test/conf-daily-devel-ndbmaster.txt
index 685ed7ddc64..695fe64c799 100644
--- a/ndb/test/run-test/conf-daily-devel-ndbmaster.txt
+++ b/ndb/test/run-test/conf-daily-devel-ndbmaster.txt
@@ -2,7 +2,7 @@ baseport: 16000
basedir: /space/autotest
mgm: CHOOSE_host1
ndb: CHOOSE_host2 CHOOSE_host3 CHOOSE_host2 CHOOSE_host3
-api: CHOOSE_host1 CHOOSE_host1 CHOOSE_hosts1
+api: CHOOSE_host1 CHOOSE_host1 CHOOSE_host1
-- cluster config
[DB DEFAULT]
NoOfReplicas: 2
diff --git a/ndb/test/run-test/conf-daily-sql-ndbmaster.txt b/ndb/test/run-test/conf-daily-sql-ndbmaster.txt
index f4913efea48..a5eadd9f361 100644
--- a/ndb/test/run-test/conf-daily-sql-ndbmaster.txt
+++ b/ndb/test/run-test/conf-daily-sql-ndbmaster.txt
@@ -2,8 +2,8 @@ baseport: 16000
basedir: /space/autotest
mgm: CHOOSE_host1
ndb: CHOOSE_host2 CHOOSE_host3
-mysqld: CHOOSE_host1 CHOOSE_hosts4
-mysql: CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_hosts4 CHOOSE_hosts4 CHOOSE_hosts4 CHOOSE_hosts4 CHOOSE_hosts4 CHOOSE_hosts4
+mysqld: CHOOSE_host1 CHOOSE_host4
+mysql: CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_host1 CHOOSE_host4 CHOOSE_host4 CHOOSE_host4 CHOOSE_host4 CHOOSE_host4 CHOOSE_host4
-- cluster config
[DB DEFAULT]
NoOfReplicas: 2
diff --git a/ndb/test/run-test/main.cpp b/ndb/test/run-test/main.cpp
index 842f658f5b6..0b0b7472a19 100644
--- a/ndb/test/run-test/main.cpp
+++ b/ndb/test/run-test/main.cpp
@@ -448,6 +448,7 @@ setup_config(atrt_config& config){
proc.m_proc.m_runas = proc.m_host->m_user;
proc.m_proc.m_ulimit = "c:unlimited";
proc.m_proc.m_env.assfmt("MYSQL_BASE_DIR=%s", dir.c_str());
+ proc.m_proc.m_shutdown_options = "";
proc.m_hostname = proc.m_host->m_hostname;
proc.m_ndb_mgm_port = g_default_base_port;
if(split1[0] == "mgm"){
@@ -470,6 +471,7 @@ setup_config(atrt_config& config){
proc.m_proc.m_path.assign(dir).append("/libexec/mysqld");
proc.m_proc.m_args = "--core-file --ndbcluster";
proc.m_proc.m_cwd.appfmt("%d.mysqld", index);
+ proc.m_proc.m_shutdown_options = "SIGKILL"; // not nice
} else if(split1[0] == "api"){
proc.m_type = atrt_process::NDB_API;
proc.m_proc.m_name.assfmt("%d-%s", index, "ndb_api");
diff --git a/ndb/test/run-test/ndb-autotest.sh b/ndb/test/run-test/ndb-autotest.sh
index 870ec9868cc..acee8c8e3d0 100755
--- a/ndb/test/run-test/ndb-autotest.sh
+++ b/ndb/test/run-test/ndb-autotest.sh
@@ -112,7 +112,7 @@ atrt=$test_dir/atrt
html=$test_dir/make-html-reports.sh
mkconfig=$run_dir/mysql-test/ndb/make-config.sh
-PATH=$test_dir:$PATH
+PATH=$run_dir/bin:$test_dir:$PATH
export PATH
filter(){
@@ -211,6 +211,12 @@ start(){
rm -f /tmp/res.$$.tgz
}
+count_hosts(){
+ grep "CHOOSE_host" $1 |
+ awk '{for(i=1; i<=NF;i++) if(match($i, "CHOOSE_host") > 0) print $i;}' |
+ wc -l
+}
+
p=`pwd`
for dir in $RUN
do
@@ -222,7 +228,8 @@ do
mkdir -p $run_dir $res_dir
rm -rf $res_dir/* $run_dir/*
- count=`grep -c "COMPUTER" $run_dir/1.ndb_mgmd/initconfig.template`
+ conf=`choose_conf $dir`
+ count=`count_hosts $conf`
avail_hosts=`filter /tmp/filter_hosts.$$ $hosts`
avail=`echo $avail_hosts | wc -w`
if [ $count -gt $avail ]
@@ -233,7 +240,6 @@ do
fi
run_hosts=`echo $avail_hosts| awk '{for(i=1;i<='$count';i++)print $i;}'`
- conf=`choose_conf $dir`
choose $conf $run_hosts > $run_dir/d.txt
(cd $run_dir; $mkconfig d.txt )
diff --git a/ndb/test/src/CpcClient.cpp b/ndb/test/src/CpcClient.cpp
index 1d1b4fcb977..4d06b4a7ff5 100644
--- a/ndb/test/src/CpcClient.cpp
+++ b/ndb/test/src/CpcClient.cpp
@@ -282,6 +282,7 @@ convert(const Properties & src, SimpleCpcClient::Process & dst){
b &= src.get("stdout", dst.m_stdout);
b &= src.get("stderr", dst.m_stderr);
b &= src.get("ulimit", dst.m_ulimit);
+ b &= src.get("shutdown", dst.m_shutdown_options);
return b;
}
@@ -305,6 +306,7 @@ convert(const SimpleCpcClient::Process & src, Properties & dst ){
b &= dst.put("stdout", src.m_stdout.c_str());
b &= dst.put("stderr", src.m_stderr.c_str());
b &= dst.put("ulimit", src.m_ulimit.c_str());
+ b &= dst.put("shutdown", src.m_shutdown_options.c_str());
return b;
}
@@ -372,6 +374,7 @@ SimpleCpcClient::list_processes(Vector<Process> &procs, Properties& reply) {
CPC_ARG("stdout",String, Mandatory, "Redirect stdout"),
CPC_ARG("stderr",String, Mandatory, "Redirect stderr"),
CPC_ARG("ulimit",String, Mandatory, "ulimit"),
+ CPC_ARG("shutdown",String, Mandatory, "shutdown"),
CPC_END()
};