diff --git a/db_stress_tool/db_stress_common.cc b/db_stress_tool/db_stress_common.cc index f1823302a..351c28e0c 100644 --- a/db_stress_tool/db_stress_common.cc +++ b/db_stress_tool/db_stress_common.cc @@ -160,8 +160,10 @@ void PrintKeyValue(int cf, uint64_t key, const char* value, size_t sz) { snprintf(buf, 4, "%X", value[i]); tmp.append(buf); } - fprintf(stdout, "[CF %d] %" PRIi64 " == > (%" ROCKSDB_PRIszt ") %s\n", cf, - key, sz, tmp.c_str()); + auto key_str = Key(key); + Slice key_slice = key_str; + fprintf(stdout, "[CF %d] %s (%" PRIi64 ") == > (%" ROCKSDB_PRIszt ") %s\n", + cf, key_slice.ToString(true).c_str(), key, sz, tmp.c_str()); } // Note that if hot_key_alpha != 0, it generates the key based on Zipfian diff --git a/db_stress_tool/db_stress_test_base.cc b/db_stress_tool/db_stress_test_base.cc index 0df188d5a..fe90a0796 100644 --- a/db_stress_tool/db_stress_test_base.cc +++ b/db_stress_tool/db_stress_test_base.cc @@ -329,9 +329,11 @@ void StressTest::VerificationAbort(SharedState* shared, std::string msg, void StressTest::VerificationAbort(SharedState* shared, std::string msg, int cf, int64_t key) const { + auto key_str = Key(key); + Slice key_slice = key_str; fprintf(stderr, - "Verification failed for column family %d key %" PRIi64 ": %s\n", cf, - key, msg.c_str()); + "Verification failed for column family %d key %s (%" PRIi64 "): %s\n", + cf, key_slice.ToString(true).c_str(), key, msg.c_str()); shared->SetVerificationFailure(); }