[SCM] CTDB repository - branch 1.0.112 updated - ctdb-1.0.111-47-gf158dd5

Ronnie Sahlberg sahlberg at samba.org
Sun Feb 14 14:18:49 MST 2010


The branch, 1.0.112 has been updated
       via  f158dd57ae0c9985ac52b7c9719be63c7b571e18 (commit)
       via  11cc59c011a741eae2c701edd136957294d141c5 (commit)
       via  6ab622c7313dbe6fbff6cea2662cc673b4487037 (commit)
       via  500070827c11d2ee4094739cd2cabe93f3803fc9 (commit)
       via  723ba09f00533c767ba8967d478d1af4f9429801 (commit)
       via  21ff92c71652e7545651eb93a101996ae6fc3be6 (commit)
       via  a338fb35d46a4babee593df3f476e9ac09de16cb (commit)
      from  883f8befc27a9d66c9dc707edaf92edd69790c25 (commit)

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


- Log -----------------------------------------------------------------
commit f158dd57ae0c9985ac52b7c9719be63c7b571e18
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Feb 15 08:17:48 2010 +1100

    New version 1.0.112-8

commit 11cc59c011a741eae2c701edd136957294d141c5
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Fri Feb 12 17:02:56 2010 +1030

    Leave sequence number alone when merely migrating records.
    
    (Based on earlier version from Ronnie which modified tdb; this one
    is standalone).
    
    When storing records in a tdb that has "automatic seqnum updates"
    also check if the actual data for the record has changed or not.
    
    If it has not changed at all, except for possibly the header,
    this is likely just a dmaster migration operation in which case
    we want to write the record to the tdb but we do not want the tdb
    sequence number to be increased.
    
    This resolves the problem of notify.tdb being thrashed under load:
    the heuristic in smbd to only reread this when the sequence number
    increases (rarely) breaks down.
    
    Before, running nbench --num-progs=512 across 4 nodes, we saw numbers like:
     512      1496  118.33 MB/sec  execute 60 sec  latency 0.00 msec
    And turning on latency tracking, this was typical in the logs:
     ctdbd: High latency 9380914.000000s for operation lockwait on database notify.tdb
    
    After this commit:
      512      2451  143.85 MB/sec  execute 60 sec  latency 0.00 msec
    And no more latency messages...
    
    Signed-off-by: Rusty Russell <rusty at rustcorp.com.au>

commit 6ab622c7313dbe6fbff6cea2662cc673b4487037
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Feb 15 08:09:52 2010 +1100

    Revert "Add a new flag/enum to _tdb_store() to allow writing a record without increasing the seqnum"
    
    This reverts commit 4e683873e0617b4c8f69ededeebd850d2f44694a.

commit 500070827c11d2ee4094739cd2cabe93f3803fc9
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Feb 15 08:09:40 2010 +1100

    Revert "When storing records in a tdb that has "automatic seqnum updates""
    
    This reverts commit 8198e27e5d8dd1f5a927d75aff9ef122d7a5ac15.

commit 723ba09f00533c767ba8967d478d1af4f9429801
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Feb 15 08:09:23 2010 +1100

    Revert "Suggestion from Tridge."
    
    This reverts commit d5c477c92252062d1c27f393ffb93471c00d75b6.

commit 21ff92c71652e7545651eb93a101996ae6fc3be6
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Feb 15 08:09:10 2010 +1100

    Revert "Increase the package version for tdb to reflect the changes/additions to the"
    
    This reverts commit fb10a98f31303a4620d022d53d282fd9de4ca555.

commit a338fb35d46a4babee593df3f476e9ac09de16cb
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Mon Feb 15 08:08:55 2010 +1100

    Revert "Change ctdb to use the TDB_NOSEQNUM flag instead of the old/removed"
    
    This reverts commit 9fa818afe0ccc1117a972a603b223f67c87eb00b.

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

Summary of changes:
 common/ctdb_ltdb.c         |   18 +-----------------
 lib/tdb/common/tdb.c       |   15 +++++----------
 lib/tdb/configure.ac       |    2 +-
 lib/tdb/include/tdb.h      |    5 +----
 packaging/RPM/ctdb.spec.in |    7 ++++++-
 5 files changed, 14 insertions(+), 33 deletions(-)


Changeset truncated at 500 lines:

diff --git a/common/ctdb_ltdb.c b/common/ctdb_ltdb.c
index 038c191..12fcf52 100644
--- a/common/ctdb_ltdb.c
+++ b/common/ctdb_ltdb.c
@@ -128,7 +128,6 @@ int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key,
 	struct ctdb_context *ctdb = ctdb_db->ctdb;
 	TDB_DATA rec;
 	int ret;
-	int flag;
 
 	if (ctdb->flags & CTDB_FLAG_TORTURE) {
 		struct ctdb_ltdb_header *h2;
@@ -148,22 +147,7 @@ int ctdb_ltdb_store(struct ctdb_db_context *ctdb_db, TDB_DATA key,
 	memcpy(rec.dptr, header, sizeof(*header));
 	memcpy(rec.dptr + sizeof(*header), data.dptr, data.dsize);
 
-	flag = TDB_REPLACE;
-	/* Databases with seqnum updates enabled only get their seqnum
-	   changes when/if we modify the data */
-	if (ctdb_db->seqnum_update != NULL) {
-		TDB_DATA old;
-		old = tdb_fetch(ctdb_db->ltdb->tdb, key);
-
-		if ( (old.dsize == rec.dsize)
-		&& !memcmp(old.dptr+sizeof(struct ctdb_ltdb_header),
-			  rec.dptr+sizeof(struct ctdb_ltdb_header),
-			  rec.dsize-sizeof(struct ctdb_ltdb_header)) ) {
-			flag |= TDB_NOSEQNUM;
-		}
-		if (old.dptr) free(old.dptr);
-	}
-	ret = tdb_store(ctdb_db->ltdb->tdb, key, rec, flag);
+	ret = tdb_store(ctdb_db->ltdb->tdb, key, rec, TDB_REPLACE);
 	if (ret != 0) {
 		DEBUG(DEBUG_ERR, (__location__ " Failed to store dynamic data\n"));
 	}
diff --git a/lib/tdb/common/tdb.c b/lib/tdb/common/tdb.c
index 694c52e..d2688de 100644
--- a/lib/tdb/common/tdb.c
+++ b/lib/tdb/common/tdb.c
@@ -466,18 +466,15 @@ static tdb_off_t tdb_find_dead(struct tdb_context *tdb, uint32_t hash,
 }
 
 static int _tdb_store(struct tdb_context *tdb, TDB_DATA key,
-		       TDB_DATA dbuf, int flags, uint32_t hash)
+		       TDB_DATA dbuf, int flag, uint32_t hash)
 {
 	struct tdb_record rec;
 	tdb_off_t rec_ptr;
 	char *p = NULL;
 	int ret = -1;
-	int op;
-
-	op = flags&TDB_STORE_ENUM_MASK;
 
 	/* check for it existing, on insert. */
-	if (op == TDB_INSERT) {
+	if (flag == TDB_INSERT) {
 		if (tdb_exists_hash(tdb, key, hash)) {
 			tdb->ecode = TDB_ERR_EXISTS;
 			goto fail;
@@ -488,7 +485,7 @@ static int _tdb_store(struct tdb_context *tdb, TDB_DATA key,
 			goto done;
 		}
 		if (tdb->ecode == TDB_ERR_NOEXIST &&
-		    op == TDB_MODIFY) {
+		    flag == TDB_MODIFY) {
 			/* if the record doesn't exist and we are in TDB_MODIFY mode then
 			 we should fail the store */
 			goto fail;
@@ -500,7 +497,7 @@ static int _tdb_store(struct tdb_context *tdb, TDB_DATA key,
 	/* delete any existing record - if it doesn't exist we don't
            care.  Doing this first reduces fragmentation, and avoids
            coalescing with `allocated' block before it's updated. */
-	if (op != TDB_INSERT)
+	if (flag != TDB_INSERT)
 		tdb_delete_hash(tdb, key, hash);
 
 	/* Copy key+value *before* allocating free space in case malloc
@@ -587,9 +584,7 @@ static int _tdb_store(struct tdb_context *tdb, TDB_DATA key,
 	ret = 0;
  fail:
 	if (ret == 0) {
-		if (!(flags & TDB_NOSEQNUM)) {
-			tdb_increment_seqnum(tdb);
-		}
+		tdb_increment_seqnum(tdb);
 	}
 
 	SAFE_FREE(p); 
diff --git a/lib/tdb/configure.ac b/lib/tdb/configure.ac
index ef9a472..779f596 100644
--- a/lib/tdb/configure.ac
+++ b/lib/tdb/configure.ac
@@ -2,7 +2,7 @@ AC_PREREQ(2.50)
 AC_DEFUN([SMB_MODULE_DEFAULT], [echo -n ""])
 AC_DEFUN([SMB_LIBRARY_ENABLE], [echo -n ""])
 AC_DEFUN([SMB_ENABLE], [echo -n ""])
-AC_INIT(tdb, 1.2.1)
+AC_INIT(tdb, 1.2.0)
 AC_CONFIG_SRCDIR([common/tdb.c])
 AC_CONFIG_HEADER(include/config.h)
 AC_LIBREPLACE_ALL_CHECKS
diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h
index 7e72f89..db9ce4a 100644
--- a/lib/tdb/include/tdb.h
+++ b/lib/tdb/include/tdb.h
@@ -32,13 +32,10 @@ extern "C" {
 
 #include "signal.h"
 
-/* enums to tdb_store() */
+/* flags to tdb_store() */
 #define TDB_REPLACE 1		/* Unused */
 #define TDB_INSERT 2 		/* Don't overwrite an existing entry */
 #define TDB_MODIFY 3		/* Don't create an existing entry    */
-#define TDB_STORE_ENUM_MASK 0x0f
- /* flags to tdb_store */
-#define TDB_NOSEQNUM 0x10	/* Don't bump the seqnum */
 
 /* flags for tdb_open() */
 #define TDB_DEFAULT 0 /* just a readability place holder */
diff --git a/packaging/RPM/ctdb.spec.in b/packaging/RPM/ctdb.spec.in
index b83303b..c6b3730 100644
--- a/packaging/RPM/ctdb.spec.in
+++ b/packaging/RPM/ctdb.spec.in
@@ -5,7 +5,7 @@ Vendor: Samba Team
 Packager: Samba Team <samba at samba.org>
 Name: ctdb
 Version: 1.0.112
-Release: 7
+Release: 8
 Epoch: 0
 License: GNU GPL version 3
 Group: System Environment/Daemons
@@ -123,6 +123,11 @@ rm -rf $RPM_BUILD_ROOT
 %{_docdir}/ctdb/tests/bin/ctdb_transaction
 
 %changelog
+* Mon Feb 15 2010 : Version 1.0.112-8
+ - Try to restart rpc-rquotad if it has crashed
+ - Dont update the tdb seqnum when performing dmaster migrations
+   This provides a huge performance boost and avoids trashing
+   for seqnum enabled databases such as notify and registry.tdb
 * Thu Feb 11 2010 : Version 1.0.112-7
  - Add logging of process if we detect we have started to swap from
    the 00.ctdb eventscript.


-- 
CTDB repository


More information about the samba-cvs mailing list