diff options
author | unknown <anozdrin@mysql.com> | 2006-05-30 13:22:49 +0400 |
---|---|---|
committer | unknown <anozdrin@mysql.com> | 2006-05-30 13:22:49 +0400 |
commit | 24240329d4b84947da0e8fe3fc75d372c85b62c4 (patch) | |
tree | 8d9f79b4f88a0db2901e0c2ca27282441e46941e | |
parent | 128c3942a8219015bcc2edf69ff0ee5dcde35be1 (diff) | |
parent | 976f31c51d4411f2fcf2544f9ae9b43ddc98e68f (diff) | |
download | mariadb-git-24240329d4b84947da0e8fe3fc75d372c85b62c4.tar.gz |
Merge mysql.com:/home/alik/MySQL/devel/5.0-rt
into mysql.com:/home/alik/MySQL/devel/5.0-tree
-rw-r--r-- | mysql-test/t/rpl_insert_id.test | 2 | ||||
-rw-r--r-- | server-tools/instance-manager/guardian.cc | 22 | ||||
-rw-r--r-- | server-tools/instance-manager/manager.cc | 46 |
3 files changed, 40 insertions, 30 deletions
diff --git a/mysql-test/t/rpl_insert_id.test b/mysql-test/t/rpl_insert_id.test index ccd80dce388..e038829760d 100644 --- a/mysql-test/t/rpl_insert_id.test +++ b/mysql-test/t/rpl_insert_id.test @@ -148,3 +148,5 @@ drop function bug15728_insert; drop table t1, t2; # End of 5.0 tests + +sync_slave_with_master; 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; diff --git a/server-tools/instance-manager/manager.cc b/server-tools/instance-manager/manager.cc index 90d9d04cd36..00ef50a84e1 100644 --- a/server-tools/instance-manager/manager.cc +++ b/server-tools/instance-manager/manager.cc @@ -147,28 +147,6 @@ void manager(const Options &options) if (create_pid_file(options.pid_file_name, manager_pid)) return; - sigset_t mask; - set_signals(&mask); - - /* create the listener */ - { - pthread_t listener_thd_id; - pthread_attr_t listener_thd_attr; - int rc; - - pthread_attr_init(&listener_thd_attr); - pthread_attr_setdetachstate(&listener_thd_attr, PTHREAD_CREATE_DETACHED); - rc= set_stacksize_n_create_thread(&listener_thd_id, &listener_thd_attr, - listener, &listener_args); - pthread_attr_destroy(&listener_thd_attr); - if (rc) - { - log_error("manager(): set_stacksize_n_create_thread(listener) failed"); - goto err; - } - - } - /* create guardian thread */ { pthread_t guardian_thd_id; @@ -211,6 +189,30 @@ void manager(const Options &options) return; } + /* Initialize signals and alarm-infrastructure. */ + + sigset_t mask; + set_signals(&mask); + + /* create the listener */ + { + pthread_t listener_thd_id; + pthread_attr_t listener_thd_attr; + int rc; + + pthread_attr_init(&listener_thd_attr); + pthread_attr_setdetachstate(&listener_thd_attr, PTHREAD_CREATE_DETACHED); + rc= set_stacksize_n_create_thread(&listener_thd_id, &listener_thd_attr, + listener, &listener_args); + pthread_attr_destroy(&listener_thd_attr); + if (rc) + { + log_error("manager(): set_stacksize_n_create_thread(listener) failed"); + goto err; + } + + } + /* After the list of guarded instances have been initialized, Guardian should start them. |