[SCM] CTDB repository - branch 1.0.69 updated - ctdb-1.0.69-14-ga63c793

Ronnie Sahlberg sahlberg at samba.org
Sat Apr 25 22:50:07 GMT 2009


The branch, 1.0.69 has been updated
       via  a63c79318678abe99d2a36fe4465e63eafc008b7 (commit)
       via  8628402d4cad4b9ef580151b85e36b6a5909e56c (commit)
       via  c61c4f7a7628232e9094d463275ba6abf7b79941 (commit)
       via  460e6b2402fc9bca9e9835e3a203278ac0bcaf8f (commit)
      from  fb582515c674b76e06aed28d04f24ae3a849cfe2 (commit)

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


- Log -----------------------------------------------------------------
commit a63c79318678abe99d2a36fe4465e63eafc008b7
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Sun Apr 26 08:50:35 2009 +1000

     new version 1.0.69-4

commit 8628402d4cad4b9ef580151b85e36b6a5909e56c
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Sun Apr 26 08:47:38 2009 +1000

    we only need to have transaction nesting disabled when we start the new transaction for the recovery

commit c61c4f7a7628232e9094d463275ba6abf7b79941
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Sun Apr 26 08:42:54 2009 +1000

    set the TDB_NO_NESTING flag for the tdb before we start a transaction from within recovery

commit 460e6b2402fc9bca9e9835e3a203278ac0bcaf8f
Author: Ronnie Sahlberg <ronniesahlberg at gmail.com>
Date:   Sun Apr 26 08:38:37 2009 +1000

    add TDB_NO_NESTING. When this flag is set tdb will not allow any nested transactions and tdb_transaction_start() will implicitely _cancel() any pending transactions before starting any new ones.

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

Summary of changes:
 lib/tdb/common/transaction.c |   18 ++++++++++++++----
 lib/tdb/include/tdb.h        |    1 +
 packaging/RPM/ctdb.spec      |    8 +++++++-
 server/ctdb_freeze.c         |    2 ++
 4 files changed, 24 insertions(+), 5 deletions(-)


Changeset truncated at 500 lines:

diff --git a/lib/tdb/common/transaction.c b/lib/tdb/common/transaction.c
index 4e2127b..6a34c45 100644
--- a/lib/tdb/common/transaction.c
+++ b/lib/tdb/common/transaction.c
@@ -85,6 +85,11 @@
     still available, but no transaction recovery area is used and no
     fsync/msync calls are made.
 
+  - if TDB_NO_NESTING is passed to flags in tdb open then transaction
+    nesting is disabled. tdb_transaction_start() will then implicitely
+    cancel any pending transactions and always start a new transaction
+    context instead of nesting.
+
 */
 
 
@@ -409,10 +414,15 @@ int tdb_transaction_start(struct tdb_context *tdb)
 
 	/* cope with nested tdb_transaction_start() calls */
 	if (tdb->transaction != NULL) {
-		tdb->transaction->nesting++;
-		TDB_LOG((tdb, TDB_DEBUG_TRACE, "tdb_transaction_start: nesting %d\n", 
-			 tdb->transaction->nesting));
-		return 0;
+		if (!tdb->flags & TDB_NO_NESTING) {
+			tdb->transaction->nesting++;
+			TDB_LOG((tdb, TDB_DEBUG_TRACE, "tdb_transaction_start: nesting %d\n", 
+				 tdb->transaction->nesting));
+			return 0;
+		} else {
+			tdb_transaction_cancel(tdb);
+			TDB_LOG((tdb, TDB_DEBUG_TRACE, "tdb_transaction_start: cancelling previous transaction\n"));
+		}
 	}
 
 	if (tdb->num_locks != 0 || tdb->global_lock.count) {
diff --git a/lib/tdb/include/tdb.h b/lib/tdb/include/tdb.h
index 0008085..6281181 100644
--- a/lib/tdb/include/tdb.h
+++ b/lib/tdb/include/tdb.h
@@ -47,6 +47,7 @@ extern "C" {
 #define TDB_NOSYNC   64 /* don't use synchronous transactions */
 #define TDB_SEQNUM   128 /* maintain a sequence number */
 #define TDB_VOLATILE   256 /* Activate the per-hashchain freelist, default 5 */
+#define TDB_NO_NESTING 512 /* Dont allow transaction nesting */
 
 #define TDB_ERRCODE(code, ret) ((tdb->ecode = (code)), ret)
 
diff --git a/packaging/RPM/ctdb.spec b/packaging/RPM/ctdb.spec
index 8572ab0..01d09e0 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: 69_3
+Release: 69_4
 Epoch: 0
 License: GNU GPL version 3
 Group: System Environment/Daemons
@@ -121,6 +121,12 @@ fi
 %{_includedir}/ctdb_private.h
 
 %changelog
+* Sun Apr 26 2009 : Version 1.0.69_4
+ - Add TDB_NO_NESTING to the tdb layer to prevent transaction nesting.
+ - Make sure that when we start a recovery transaction that this is not a
+   nested transaction.
+ - Add a tuneable RecoveryDropAllIPs that specifies after how long being in
+   recovery mode a node will elect to drop all its public addresses.
 * Fri Apr 24 2009 : Version 1.0.69_3
  - Make sure that if during recovery a node is stuck and does not reply to
    pull_db requests that we eventually ban this node from the recovery master.
diff --git a/server/ctdb_freeze.c b/server/ctdb_freeze.c
index e39332e..6f99f8b 100644
--- a/server/ctdb_freeze.c
+++ b/server/ctdb_freeze.c
@@ -345,7 +345,9 @@ int32_t ctdb_control_transaction_start(struct ctdb_context *ctdb, uint32_t id)
 			}
 		}
 
+		tdb_add_flags(ctdb_db->ltdb->tdb, TDB_NO_NESTING);
 		ret = tdb_transaction_start(ctdb_db->ltdb->tdb);
+		tdb_remove_flags(ctdb_db->ltdb->tdb, TDB_NO_NESTING);
 
 		tdb_remove_flags(ctdb_db->ltdb->tdb, TDB_NOLOCK);
 


-- 
CTDB repository


More information about the samba-cvs mailing list