[SCM] CTDB repository - branch master updated - ctdb-1.0.60-9-g49431e7

Ronnie Sahlberg sahlberg at samba.org
Thu Oct 16 07:00:53 GMT 2008


The branch, master has been updated
       via  49431e799ba7f7c78f596fdf896316a2e22c745e (commit)
       via  8313dfb6fc5404cd2d065af6620412f8664ada11 (commit)
      from  0098efd4443038f2d902e3a7c3640e63f06be7d1 (commit)

http://gitweb.samba.org/?p=sahlberg/ctdb.git;a=shortlog;h=master


- Log -----------------------------------------------------------------
commit 49431e799ba7f7c78f596fdf896316a2e22c745e
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Oct 16 17:59:55 2008 +1100

    new version 1.0.62

commit 8313dfb6fc5404cd2d065af6620412f8664ada11
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Thu Oct 16 17:57:50 2008 +1100

    allow multiple eventscripts using the same prefix.
    this eases the pain for users that use out of tree eventscripts

-----------------------------------------------------------------------

Summary of changes:
 packaging/RPM/ctdb.spec |    5 ++++-
 server/eventscript.c    |   12 ++++--------
 2 files changed, 8 insertions(+), 9 deletions(-)


Changeset truncated at 500 lines:

diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index 73905c0..0bc381f 100644
--- a/packaging/RPM/ctdb.spec
+++ b/packaging/RPM/ctdb.spec
@@ -5,7 +5,7 @@ Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
 Name: ctdb
 Version: 1.0
-Release: 61
+Release: 62
 Epoch: 0
 License: GNU GPL version 3
 Group: System Environment/Daemons
@@ -120,6 +120,9 @@ fi
 %{_includedir}/ctdb_private.h
 
 %changelog
+* Thu Oct 16 2008 : Version 1.0.62
+ - Allow multiple eventscritps using the same prefix number.
+   It is undefined which order scripts with the same prefix will execute in.
 * Wed Oct 15 2008 : Version 1.0.61
  - Use "route add -net" instead of "ip route add" when adding routes in 99.routing
  - lower the loglevel os several debug statements
diff --git a/server/eventscript.c b/server/eventscript.c
index 057bc80..deaf750 100644
--- a/server/eventscript.c
+++ b/server/eventscript.c
@@ -67,6 +67,7 @@ static int ctdb_event_script_v(struct ctdb_context *ctdb, const char *options)
 	DIR *dir;
 	struct dirent *de;
 	char *script;
+	int count;
 
 	if (ctdb->recovery_mode != CTDB_RECOVERY_NORMAL) {
 		/* we guarantee that only some specifically allowed event scripts are run
@@ -118,6 +119,7 @@ static int ctdb_event_script_v(struct ctdb_context *ctdb, const char *options)
 		return -1;
 	}
 
+	count = 0;
 	while ((de=readdir(dir)) != NULL) {
 		int namlen;
 		unsigned num;
@@ -154,14 +156,8 @@ static int ctdb_event_script_v(struct ctdb_context *ctdb, const char *options)
 		}
 		
 		
-		/* store the event script in the tree */		
-		script = trbt_insert32(tree, num, talloc_strdup(tree, de->d_name));
-		if (script != NULL) {
-			DEBUG(DEBUG_CRIT,("CONFIG ERROR: Multiple event scripts with the same prefix : '%s' and '%s'. Each event script MUST have a unique prefix\n", script, de->d_name));
-			talloc_free(tmp_ctx);
-			closedir(dir);
-			return -1;
-		}
+		/* store the event script in the tree */
+		trbt_insert32(tree, (num<<16)|count++, talloc_strdup(tree, de->d_name));
 	}
 	closedir(dir);
 


-- 
CTDB repository


More information about the samba-cvs mailing list