Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

db_stress prints key in Hex #7533

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 4 additions & 2 deletions db_stress_tool/db_stress_common.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 4 additions & 2 deletions db_stress_tool/db_stress_test_base.cc
Original file line number Diff line number Diff line change
Expand Up @@ -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();
}

Expand Down