ctdb: add an option --print-hash to enable printing of record hashes when dumping dbs
[rusty/ctdb.git] / client / ctdb_client.c
index 1190fba8b2ac9a996bb08d2e2222c97c2581e269..47f375927112c4b361f9fd62514befaa62b66010 100644 (file)
@@ -2146,6 +2146,10 @@ int ctdb_dumpdb_record(struct ctdb_context *ctdb, TDB_DATA key, TDB_DATA data, v
                fprintf(f, "lmaster: %u\n", ctdb_lmaster(ctdb, &key));
        }
 
+       if (c->printhash) {
+               fprintf(f, "hash: 0x%08x\n", ctdb_hash(&key));
+       }
+
        fprintf(f, "flags: 0x%08x", h->flags);
        if (h->flags & CTDB_REC_FLAG_MIGRATED_WITH_DATA) printf(" MIGRATED_WITH_DATA");
        if (h->flags & CTDB_REC_FLAG_VACUUM_MIGRATED) printf(" VACUUM_MIGRATED");