ctdb-vacuum: Use non-blocking lock when traversing delete queue
authorAmitay Isaacs <amitay@gmail.com>
Mon, 14 Apr 2014 03:18:41 +0000 (13:18 +1000)
committerKarolin Seeger <kseeger@samba.org>
Wed, 10 Dec 2014 19:56:08 +0000 (20:56 +0100)
This avoids vacuuming getting in the way of ctdb daemon to process
record requests.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
Reviewed-by: Martin Schwenke <martin@meltin.net>
(cherry picked from commit d35f512cd972ac1f732fe998b2179242d042082d)

ctdb/server/ctdb_vacuum.c

index 0f1de19245d039e686996f1aeaff0f32b0572440..892dc07d15d74b376a76a67f18985a6e15be2e69 100644 (file)
@@ -446,12 +446,8 @@ static int delete_queue_traverse(void *param, void *data)
 
        vdata->count.delete_queue.total++;
 
-       res = tdb_chainlock(ctdb_db->ltdb->tdb, dd->key);
+       res = tdb_chainlock_nonblock(ctdb_db->ltdb->tdb, dd->key);
        if (res != 0) {
-               DEBUG(DEBUG_ERR,
-                     (__location__ " Error getting chainlock on record with "
-                      "key hash [0x%08x] on database db[%s].\n",
-                      hash, ctdb_db->db_name));
                vdata->count.delete_queue.error++;
                return 0;
        }