ctdbd: fix lock held on error ("ctdb_req_dmaster from non-master.") foo
authorRusty Russell <rusty@rustcorp.com.au>
Mon, 21 Mar 2011 02:33:01 +0000 (13:03 +1030)
committerRonnie Sahlberg <sahlberg@lenovo-laptop.(none)>
Mon, 21 Mar 2011 02:51:25 +0000 (13:51 +1100)
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

server/ctdb_call.c

index 73072c3f758529b45bc2c0adf2bd6434927a66df..0ea76bf44fdaac0f380a13b67a24ca7797f08b26 100644 (file)
@@ -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;
                }
        }