[SCM] CTDB repository - branch master updated - ctdb-1.10-176-g3d98288

Ronnie Sahlberg sahlberg at samba.org
Sun Mar 20 20:58:32 MDT 2011


The branch, master has been updated
       via  3d9828861c771a060923f3181fa8224e0122bffc (commit)
       via  38b2dbe0605816742e74e2b8a811eaba99c7e12d (commit)
      from  2fd27bdedb1e0d6558c07e1b74fc8e70ddf593dc (commit)

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


- Log -----------------------------------------------------------------
commit 3d9828861c771a060923f3181fa8224e0122bffc
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Mon Mar 21 13:07:17 2011 +1030

    ctdbd: call tdb_reopen_all() in freeze child.
    
    In theory, the ctdbd parent shouldn't be holding any locks, but it's a good
    idea to always call tdb_reopen_all() after a fork().

commit 38b2dbe0605816742e74e2b8a811eaba99c7e12d
Author: Rusty Russell <rusty at rustcorp.com.au>
Date:   Mon Mar 21 13:03:01 2011 +1030

    ctdbd: fix lock held on error ("ctdb_req_dmaster from non-master.")
    
    We should release the lock on the record before returning; otherwise the
    recovery (which tries to freeze the database) will fail.  Symptoms are as
    follows:
    
    ctdbd: pnn 15 dmaster request for new-dmaster 19 from non-master 1 real-dmaster=5 key f049c3c8 dbid 0x6cf2837d gen=1148812532 curgen=1148812532 c->rsn=2 header.rsn=15 reqid=2147483585 keyval=0x4f464e49
    ctdbd: ctdb_req_dmaster from non-master. Force a recovery.
    ...
    ctdbd: freeze_lock-1:server/ctdb_freeze.c:55 Failed to lock database registry.tdb
    
    CQ:1022545

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

Summary of changes:
 server/ctdb_call.c   |    1 +
 server/ctdb_freeze.c |    5 +++++
 2 files changed, 6 insertions(+), 0 deletions(-)


Changeset truncated at 500 lines:

diff --git a/server/ctdb_call.c b/server/ctdb_call.c
index 73072c3..0ea76bf 100644
--- a/server/ctdb_call.c
+++ b/server/ctdb_call.c
@@ -421,6 +421,7 @@ void ctdb_request_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr
 			DEBUG(DEBUG_ERR,("ctdb_req_dmaster from non-master. Force a recovery.\n"));
 
 			ctdb->recovery_mode = CTDB_RECOVERY_ACTIVE;
+			ctdb_ltdb_unlock(ctdb_db, key);
 			return;
 		}
 	}
diff --git a/server/ctdb_freeze.c b/server/ctdb_freeze.c
index 0f70fd3..9eb2493 100644
--- a/server/ctdb_freeze.c
+++ b/server/ctdb_freeze.c
@@ -204,6 +204,11 @@ static struct ctdb_freeze_handle *ctdb_freeze_lock(struct ctdb_context *ctdb, ui
 		close(fd[0]);
 
 		debug_extra = talloc_asprintf(NULL, "freeze_lock-%u:", priority);
+		if (tdb_reopen_all(true) != 0) {
+			DEBUG(DEBUG_ERR,(__location__ " Failed to reopen databases\n"));
+			_exit(0);
+		}
+
 		ret = ctdb_lock_all_databases(ctdb, priority);
 		if (ret != 0) {
 			_exit(0);


-- 
CTDB repository


More information about the samba-cvs mailing list