add extra logging for failed ctdb_ltdb_unlock() for a few more places
authorRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 9 Jun 2010 04:31:05 +0000 (14:31 +1000)
committerRonnie Sahlberg <ronniesahlberg@gmail.com>
Wed, 9 Jun 2010 04:37:24 +0000 (14:37 +1000)
it is called from

server/ctdb_call.c

index 180d9905ea5db68d995ca99eace0127c8667f190..6ef73fe12bd378b521e8f1d035559856e2494a7b 100644 (file)
@@ -380,7 +380,11 @@ void ctdb_request_dmaster(struct ctdb_context *ctdb, struct ctdb_req_header *hdr
                ctdb_become_dmaster(ctdb_db, hdr, key, data, c->rsn);
        } else {
                ctdb_send_dmaster_reply(ctdb_db, &header, key, data, c->dmaster, hdr->reqid);
-               ctdb_ltdb_unlock(ctdb_db, key);
+
+               ret = ctdb_ltdb_unlock(ctdb_db, key);
+               if (ret != 0) {
+                       DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+               }
        }
 }
 
@@ -441,7 +445,11 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
        if (header.dmaster != ctdb->pnn) {
                talloc_free(data.dptr);
                ctdb_call_send_redirect(ctdb, call->key, c, &header);
-               ctdb_ltdb_unlock(ctdb_db, call->key);
+
+               ret = ctdb_ltdb_unlock(ctdb_db, call->key);
+               if (ret != 0) {
+                       DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+               }
                return;
        }
 
@@ -466,14 +474,21 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
                                 ctdb->pnn, ctdb_hash(&(call->key)), c->hdr.srcnode));
                        ctdb_call_send_dmaster(ctdb_db, c, &header, &(call->key), &data);
                        talloc_free(data.dptr);
-                       ctdb_ltdb_unlock(ctdb_db, call->key);
+
+                       ret = ctdb_ltdb_unlock(ctdb_db, call->key);
+                       if (ret != 0) {
+                               DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+                       }
                        return;
                }
        }
 
        ctdb_call_local(ctdb_db, call, &header, hdr, &data, c->hdr.srcnode);
 
-       ctdb_ltdb_unlock(ctdb_db, call->key);
+       ret = ctdb_ltdb_unlock(ctdb_db, call->key);
+       if (ret != 0) {
+               DEBUG(DEBUG_ERR,(__location__ " ctdb_ltdb_unlock() failed with error %d\n", ret));
+       }
 
        len = offsetof(struct ctdb_reply_call, data) + call->reply_data.dsize;
        r = ctdb_transport_allocate(ctdb, ctdb, CTDB_REPLY_CALL, len,