ctdb-vacuum: Use non-blocking lock when traversing delete tree
authorAmitay Isaacs <amitay@gmail.com>
Wed, 5 Nov 2014 22:33:50 +0000 (09:33 +1100)
committerAmitay Isaacs <amitay@samba.org>
Fri, 5 Dec 2014 13:43:07 +0000 (14:43 +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>
ctdb/server/ctdb_vacuum.c

index 892dc07d15d74b376a76a67f18985a6e15be2e69..d678ff98ab3b155dd6aa4392b169fdd14232801e 100644 (file)
@@ -317,12 +317,8 @@ static int delete_marshall_traverse_first(void *param, void *data)
        uint32_t hash = ctdb_hash(&(dd->key));
        int res;
 
-       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));
                recs->vdata->count.delete_list.skipped++;
                recs->vdata->count.delete_list.left--;
                talloc_free(dd);