[SCM] CTDB repository - branch master updated -
68029894f80804c9f31fc90ed0c1b58f75812c3d
Ronnie Sahlberg
sahlberg at samba.org
Thu May 15 22:25:30 GMT 2008
The branch, master has been updated
via 68029894f80804c9f31fc90ed0c1b58f75812c3d (commit)
from 2c292039a0139dcf5bb2bd964eb6f8902d094c50 (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 68029894f80804c9f31fc90ed0c1b58f75812c3d
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Fri May 16 08:20:40 2008 +1000
dont disable/enable monitoring for each eventscript, instead
just disable the monitoring during the "startrecovery" event and enable it again once recovery has completed
-----------------------------------------------------------------------
Summary of changes:
server/ctdb_monitor.c | 2 +-
server/ctdb_recover.c | 4 ----
server/ctdb_takeover.c | 11 -----------
3 files changed, 1 insertions(+), 16 deletions(-)
Changeset truncated at 500 lines:
diff --git a/server/ctdb_monitor.c b/server/ctdb_monitor.c
index 05e6643..6526397 100644
--- a/server/ctdb_monitor.c
+++ b/server/ctdb_monitor.c
@@ -161,7 +161,7 @@ void ctdb_disable_monitoring(struct ctdb_context *ctdb)
void ctdb_enable_monitoring(struct ctdb_context *ctdb)
{
ctdb->monitor->monitoring_mode = CTDB_MONITORING_ACTIVE;
- ctdb->monitor->next_interval = 1;
+ ctdb->monitor->next_interval = 2;
DEBUG(DEBUG_INFO,("Monitoring has been enabled\n"));
}
diff --git a/server/ctdb_recover.c b/server/ctdb_recover.c
index 3da3b56..8ca3a8f 100644
--- a/server/ctdb_recover.c
+++ b/server/ctdb_recover.c
@@ -815,8 +815,6 @@ static void ctdb_start_recovery_callback(struct ctdb_context *ctdb, int status,
{
struct recovery_callback_state *state = talloc_get_type(p, struct recovery_callback_state);
- ctdb_enable_monitoring(ctdb);
-
if (status != 0) {
DEBUG(DEBUG_ERR,(__location__ " startrecovery event script failed (status %d)\n", status));
}
@@ -851,8 +849,6 @@ int32_t ctdb_control_start_recovery(struct ctdb_context *ctdb,
state, "startrecovery");
if (ret != 0) {
- ctdb_enable_monitoring(ctdb);
-
DEBUG(DEBUG_ERR,(__location__ " Failed to start recovery\n"));
talloc_free(state);
return -1;
diff --git a/server/ctdb_takeover.c b/server/ctdb_takeover.c
index e3f0a83..517970b 100644
--- a/server/ctdb_takeover.c
+++ b/server/ctdb_takeover.c
@@ -126,8 +126,6 @@ static void takeover_ip_callback(struct ctdb_context *ctdb, int status,
char *ip = inet_ntoa(state->sin->sin_addr);
struct ctdb_tcp_array *tcparray;
- ctdb_enable_monitoring(ctdb);
-
if (status != 0) {
DEBUG(DEBUG_ERR,(__location__ " Failed to takeover IP %s on interface %s\n",
ip, state->vnn->iface));
@@ -233,8 +231,6 @@ int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb,
inet_ntoa(pip->sin.sin_addr), vnn->public_netmask_bits,
vnn->iface));
- ctdb_disable_monitoring(ctdb);
-
ret = ctdb_event_script_callback(ctdb,
timeval_current_ofs(ctdb->tunable.script_timeout, 0),
state, takeover_ip_callback, state,
@@ -244,7 +240,6 @@ int32_t ctdb_control_takeover_ip(struct ctdb_context *ctdb,
vnn->public_netmask_bits);
if (ret != 0) {
- ctdb_enable_monitoring(ctdb);
DEBUG(DEBUG_ERR,(__location__ " Failed to takeover IP %s on interface %s\n",
inet_ntoa(pip->sin.sin_addr), vnn->iface));
talloc_free(state);
@@ -296,8 +291,6 @@ static void release_ip_callback(struct ctdb_context *ctdb, int status,
char *ip = inet_ntoa(state->sin->sin_addr);
TDB_DATA data;
- ctdb_enable_monitoring(ctdb);
-
/* send a message to all clients of this node telling them
that the cluster has been reconfigured and they should
release any sockets on this IP */
@@ -361,8 +354,6 @@ int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
state->vnn = vnn;
- ctdb_disable_monitoring(ctdb);
-
ret = ctdb_event_script_callback(ctdb,
timeval_current_ofs(ctdb->tunable.script_timeout, 0),
state, release_ip_callback, state,
@@ -371,8 +362,6 @@ int32_t ctdb_control_release_ip(struct ctdb_context *ctdb,
inet_ntoa(pip->sin.sin_addr),
vnn->public_netmask_bits);
if (ret != 0) {
- ctdb_enable_monitoring(ctdb);
-
DEBUG(DEBUG_ERR,(__location__ " Failed to release IP %s on interface %s\n",
inet_ntoa(pip->sin.sin_addr), vnn->iface));
talloc_free(state);
--
CTDB repository
More information about the samba-cvs
mailing list