[SCM] CTDB repository - branch master updated - ctdb-1.0.96-13-g02862c0
Ronnie Sahlberg
sahlberg at samba.org
Mon Oct 19 22:43:05 MDT 2009
The branch, master has been updated
via 02862c086d045497f49f3c060700419815d607e7 (commit)
via 54f9c314a0354f1039208fe6ac7dc159b6db8750 (commit)
via 2e9fc6f0609833c6d8146196011ef780669d615d (commit)
from 27d152a918680a59c7412aec7e1772f25b72d469 (commit)
http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master
- Log -----------------------------------------------------------------
commit 02862c086d045497f49f3c060700419815d607e7
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue Oct 20 15:36:35 2009 +1100
version 1.0.98
commit 54f9c314a0354f1039208fe6ac7dc159b6db8750
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue Oct 20 13:01:15 2009 +1100
From Wolfgang Mueller
make sure to always create the vactun database and get rid of some annoying log messages
commit 2e9fc6f0609833c6d8146196011ef780669d615d
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date: Tue Oct 20 12:59:48 2009 +1100
From wolfgang Mueller
Add a tuneable so that when scripts starts to hang/timeout, we can make the node unhealthy instead of banned
-----------------------------------------------------------------------
Summary of changes:
include/ctdb_private.h | 1 +
packaging/RPM/ctdb.spec | 11 ++++++++++-
server/ctdb_tunables.c | 1 +
server/ctdb_vacuum.c | 14 ++++++--------
server/eventscript.c | 13 +++++++++----
5 files changed, 27 insertions(+), 13 deletions(-)
Changeset truncated at 500 lines:
diff --git a/include/ctdb_private.h b/include/ctdb_private.h
index af77556..35430fc 100644
--- a/include/ctdb_private.h
+++ b/include/ctdb_private.h
@@ -99,6 +99,7 @@ struct ctdb_tunable {
uint32_t tickle_update_interval;
uint32_t script_timeout;
uint32_t script_ban_count; /* ban after this many consec timeouts*/
+ uint32_t script_unhealthy_on_timeout; /* don't ban on timeout; set node unhealthy */
uint32_t recovery_grace_period;
uint32_t recovery_ban_period;
uint32_t database_hash_size;
diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index 01a5751..85864eb 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -4,7 +4,7 @@ Summary: Clustered TDB
Vendor: Samba Team
Packager: Samba Team <samba at samba.org>
Name: ctdb
-Version: 1.0.97
+Version: 1.0.98
Release: 1
Epoch: 0
License: GNU GPL version 3
@@ -132,6 +132,15 @@ fi
%{_libdir}/pkgconfig/ctdb.pc
%changelog
+* Tue Oct 20 2009 : Version 1.0.98
+ - Fix for the vacuuming database from Wolfgang M
+ - Create a directory where the test framework can put temporary overrides
+ to variables and functions.
+ - Wait a lot longer before shutting down the node when the reclock file
+ is incorrectly configured, and log where it is configured.
+ - Try to avoid running the "monitor" event when databases are frozen.
+ - Add logging for every time we create a filedescriptor so we can trap
+ fd leaks.
* Thu Oct 14 2009 : Version 1.0.97
- From martins : update onnode.
Update onnode to allow specifying an alternative nodes file from
diff --git a/server/ctdb_tunables.c b/server/ctdb_tunables.c
index 519a7b7..90918c8 100644
--- a/server/ctdb_tunables.c
+++ b/server/ctdb_tunables.c
@@ -39,6 +39,7 @@ static const struct {
{ "TickleUpdateInterval",20, offsetof(struct ctdb_tunable, tickle_update_interval) },
{ "EventScriptTimeout", 60, offsetof(struct ctdb_tunable, script_timeout) },
{ "EventScriptBanCount", 5, offsetof(struct ctdb_tunable, script_ban_count) },
+ { "EventScriptUnhealthyOnTimeout", 0, offsetof(struct ctdb_tunable, script_unhealthy_on_timeout) },
{ "RecoveryGracePeriod", 120, offsetof(struct ctdb_tunable, recovery_grace_period) },
{ "RecoveryBanPeriod", 300, offsetof(struct ctdb_tunable, recovery_ban_period) },
{ "DatabaseHashSize", 10000, offsetof(struct ctdb_tunable, database_hash_size) },
diff --git a/server/ctdb_vacuum.c b/server/ctdb_vacuum.c
index b1927ba..6612d0b 100644
--- a/server/ctdb_vacuum.c
+++ b/server/ctdb_vacuum.c
@@ -514,7 +514,7 @@ static int update_tuning_db(struct ctdb_db_context *ctdb_db, struct vacuum_data
return -1;
}
- tune_tdb = tdb_open(vac_dbname, 0, 0, O_RDWR|O_CREAT, 0600);
+ tune_tdb = tdb_open(vac_dbname, 0, 0, O_RDWR|O_CREAT, 0644);
if (tune_tdb == NULL) {
DEBUG(DEBUG_ERR,(__location__ " Failed to create/open %s\n", TUNINGDBNAME));
talloc_free(tmp_ctx);
@@ -675,9 +675,9 @@ static int get_vacuum_interval(struct ctdb_db_context *ctdb_db)
return interval;
}
- tdb = tdb_open(vac_dbname, 0, 0, O_RDONLY, 0600);
+ tdb = tdb_open(vac_dbname, 0, 0, O_RDWR|O_CREAT, 0644);
if (!tdb) {
- DEBUG(DEBUG_ERR,("Unable to open database %s using default interval\n", vac_dbname));
+ DEBUG(DEBUG_ERR,("Unable to open/create database %s using default interval\n", vac_dbname));
talloc_free(tmp_ctx);
return interval;
}
@@ -701,8 +701,6 @@ static int get_vacuum_interval(struct ctdb_db_context *ctdb_db)
}
}
free(value.dptr);
-
- DEBUG(DEBUG_NOTICE,("Using new interval %u for database %s\n", interval, ctdb_db->db_name));
}
tdb_close(tdb);
@@ -756,7 +754,7 @@ static void vacuum_child_handler(struct event_context *ev, struct fd_event *fde,
char c = 0;
int ret;
- DEBUG(DEBUG_NOTICE,("Vacuuming child finished for db %s\n", child_ctx->vacuum_handle->ctdb_db->db_name));
+ DEBUG(DEBUG_NOTICE,("Vacuuming child process %d finished for db %s\n", child_ctx->child_pid, child_ctx->vacuum_handle->ctdb_db->db_name));
child_ctx->child_pid = -1;
ret = read(child_ctx->fd[0], &c, 1);
@@ -789,8 +787,6 @@ ctdb_vacuum_event(struct event_context *ev, struct timed_event *te,
return;
}
- DEBUG(DEBUG_NOTICE,("Start a vacuuming child process for db %s\n", ctdb_db->db_name));
-
child_ctx = talloc(vacuum_handle, struct ctdb_vacuum_child_context);
if (child_ctx == NULL) {
DEBUG(DEBUG_CRIT, (__location__ " Failed to allocate child context for vacuuming of %s\n", ctdb_db->db_name));
@@ -821,6 +817,8 @@ ctdb_vacuum_event(struct event_context *ev, struct timed_event *te,
char cc = 0;
close(child_ctx->fd[0]);
+ DEBUG(DEBUG_NOTICE,("Vacuuming child process %d for db %s started\n", getpid(), ctdb_db->db_name));
+
if (switch_from_server_to_client(ctdb) != 0) {
DEBUG(DEBUG_CRIT, (__location__ "ERROR: failed to switch vacuum daemon into client mode. Shutting down.\n"));
_exit(1);
diff --git a/server/eventscript.c b/server/eventscript.c
index 3d139c0..f4c3626 100644
--- a/server/eventscript.c
+++ b/server/eventscript.c
@@ -705,10 +705,15 @@ static void ctdb_event_script_timeout(struct event_context *ev, struct timed_eve
ctdb->event_script_timeouts++;
if (ctdb->event_script_timeouts > ctdb->tunable.script_ban_count) {
- ctdb->event_script_timeouts = 0;
- DEBUG(DEBUG_ERR, ("Maximum timeout count %u reached for eventscript. Banning self for %d seconds\n", ctdb->tunable.script_ban_count, ctdb->tunable.recovery_ban_period));
- ctdb_ban_self(ctdb, ctdb->tunable.recovery_ban_period);
- callback(ctdb, -1, private_data);
+ if (ctdb->tunable.script_unhealthy_on_timeout != 0) {
+ DEBUG(DEBUG_ERR, ("Maximum timeout count %u reached for eventscript. Making node unhealthy\n", ctdb->tunable.script_ban_count));
+ callback(ctdb, -ETIME, private_data);
+ } else {
+ ctdb->event_script_timeouts = 0;
+ DEBUG(DEBUG_ERR, ("Maximum timeout count %u reached for eventscript. Banning self for %d seconds\n", ctdb->tunable.script_ban_count, ctdb->tunable.recovery_ban_period));
+ ctdb_ban_self(ctdb, ctdb->tunable.recovery_ban_period);
+ callback(ctdb, -1, private_data);
+ }
} else {
callback(ctdb, 0, private_data);
}
--
CTDB repository
More information about the samba-cvs
mailing list