ctdbd: When a record is made sticky, log only once
authorAmitay Isaacs <amitay@gmail.com>
Wed, 31 Jul 2013 05:59:11 +0000 (15:59 +1000)
committerAmitay Isaacs <amitay@gmail.com>
Fri, 9 Aug 2013 01:07:37 +0000 (11:07 +1000)
Instead of logging from ctdb_request_call(), log the message from
ctdb_make_record_sticky().  That way if the record is already sticky, the
message is not repeated unnecessarily.

Signed-off-by: Amitay Isaacs <amitay@gmail.com>
server/ctdb_call.c

index d5b6b21a3c9717da66ed84c2046697a68aa2a5bc..6288ff2c49341ee78516066175f71657b403e101 100644 (file)
@@ -564,7 +564,9 @@ ctdb_make_record_sticky(struct ctdb_context *ctdb, struct ctdb_db_context *ctdb_
        sr->ctdb_db = ctdb_db;
        sr->pindown = NULL;
 
-       DEBUG(DEBUG_ERR,("Make record sticky in db %s\n", ctdb_db->db_name));
+       DEBUG(DEBUG_ERR,("Make record sticky for %d seconds in db %s key:0x%08x.\n",
+                        ctdb->tunable.sticky_duration,
+                        ctdb_db->db_name, ctdb_hash(&key)));
 
        trbt_insertarray32_callback(ctdb_db->sticky_records, k[0], &k[0], ctdb_make_sticky_record_callback, sr);
 
@@ -922,7 +924,6 @@ void ctdb_request_call(struct ctdb_context *ctdb, struct ctdb_req_header *hdr)
           should make it sticky.
        */
        if (ctdb_db->sticky && c->hopcount >= ctdb->tunable.hopcount_make_sticky) {
-               DEBUG(DEBUG_ERR, ("Hot record in database %s. Hopcount is %d. Make record sticky for %d seconds\n", ctdb_db->db_name, c->hopcount, ctdb->tunable.sticky_duration));
                ctdb_make_record_sticky(ctdb, ctdb_db, call->key);
        }