summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorunknown <anozdrin@mysql.com>2006-05-29 17:30:30 +0400
committerunknown <anozdrin@mysql.com>2006-05-29 17:30:30 +0400
commit976f31c51d4411f2fcf2544f9ae9b43ddc98e68f (patch)
treeebb2f3cda20a0a750f5226dc9122e7417ad9b968
parent9b7258e1a26a4d89f643902d4f6a761edeb6c782 (diff)
downloadmariadb-git-976f31c51d4411f2fcf2544f9ae9b43ddc98e68f.tar.gz
Fix for BUG#18023: IM: instance can be started several times;
monitor interval must be > 2sec. server-tools/instance-manager/guardian.cc: Start instance only if it is really crashed.
-rw-r--r--server-tools/instance-manager/guardian.cc22
1 files changed, 14 insertions, 8 deletions
diff --git a/server-tools/instance-manager/guardian.cc b/server-tools/instance-manager/guardian.cc
index 7a532263846..fa9d877fde6 100644
--- a/server-tools/instance-manager/guardian.cc
+++ b/server-tools/instance-manager/guardian.cc
@@ -139,9 +139,12 @@ void Guardian_thread::process_instance(Instance *instance,
case JUST_CRASHED:
if (current_time - current_node->crash_moment <= 2)
{
- instance->start();
- log_info("guardian: starting instance %s",
- instance->options.instance_name);
+ if (instance->is_crashed())
+ {
+ instance->start();
+ log_info("guardian: starting instance %s",
+ instance->options.instance_name);
+ }
}
else
current_node->state= CRASHED;
@@ -152,11 +155,14 @@ void Guardian_thread::process_instance(Instance *instance,
{
if ((current_node->restart_counter < restart_retry))
{
- instance->start();
- current_node->last_checked= current_time;
- current_node->restart_counter++;
- log_info("guardian: restarting instance %s",
- instance->options.instance_name);
+ if (instance->is_crashed())
+ {
+ instance->start();
+ current_node->last_checked= current_time;
+ current_node->restart_counter++;
+ log_info("guardian: restarting instance %s",
+ instance->options.instance_name);
+ }
}
else
current_node->state= CRASHED_AND_ABANDONED;