From 435dad05cbb6d7f5149a24766145bd243145262a Mon Sep 17 00:00:00 2001 From: Rusty Russell Date: Mon, 21 Mar 2011 13:03:01 +1030 Subject: 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 (This used to be ctdb commit 38b2dbe0605816742e74e2b8a811eaba99c7e12d) --- ctdb/server/ctdb_call.c | 1 + 1 file changed, 1 insertion(+) (limited to 'ctdb/server/ctdb_call.c') diff --git a/ctdb/server/ctdb_call.c b/ctdb/server/ctdb_call.c index 73072c3f75..0ea76bf44f 100644 --- a/ctdb/server/ctdb_call.c +++ b/ctdb/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; } } -- cgit