Adjust the blob cache printout in db_bench/db_stress (#10614)

Summary:
Currently, `db_bench` and `db_stress` print the blob cache options even if
a shared block/blob cache is configured, i.e. when they are not actually
in effect. The patch changes this so they are only printed when a separate blob
cache is used.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/10614

Test Plan: Tested manually using `db_bench` and `db_stress`.

Reviewed By: akankshamahajan15

Differential Revision: D39144603

Pulled By: ltamasi

fbshipit-source-id: f714304c5d46186f8514746c27ee6f52aa3e4af8
main
Levi Tamasi 2 years ago committed by Facebook GitHub Bot
parent 01e88dfeb4
commit 228f2c5bf5
  1. 18
      db_stress_tool/db_stress_test_base.cc
  2. 18
      tools/db_bench_tool.cc

@ -2415,14 +2415,16 @@ void StressTest::Open(SharedState* shared) {
if (FLAGS_use_blob_cache) {
fprintf(stdout,
"Integrated BlobDB: blob cache enabled, block and blob caches "
"shared: %d, blob cache size %" PRIu64
", blob cache num shard bits: %d, blob cache prepopulated: %s\n",
FLAGS_use_shared_block_and_blob_cache, FLAGS_blob_cache_size,
FLAGS_blob_cache_numshardbits,
options_.prepopulate_blob_cache == PrepopulateBlobCache::kFlushOnly
? "flush only"
: "disable");
"Integrated BlobDB: blob cache enabled"
", block and blob caches shared: %d",
FLAGS_use_shared_block_and_blob_cache);
if (!FLAGS_use_shared_block_and_blob_cache) {
fprintf(stdout,
", blob cache size %" PRIu64 ", blob cache num shard bits: %d",
FLAGS_blob_cache_size, FLAGS_blob_cache_numshardbits);
}
fprintf(stdout, ", blob cache prepopulated: %d\n",
FLAGS_prepopulate_blob_cache);
} else {
fprintf(stdout, "Integrated BlobDB: blob cache disabled\n");
}

@ -4464,13 +4464,19 @@ class Benchmark {
fprintf(stderr, "Unknown prepopulate blob cache mode\n");
exit(1);
}
fprintf(stdout,
"Integrated BlobDB: blob cache enabled"
", block and blob caches shared: %d",
FLAGS_use_shared_block_and_blob_cache);
if (!FLAGS_use_shared_block_and_blob_cache) {
fprintf(stdout,
"Integrated BlobDB: blob cache enabled, block and blob caches "
"shared: %d, blob cache size %" PRIu64
", blob cache num shard bits: %d, hot/warm blobs prepopulated: "
"%d\n",
FLAGS_use_shared_block_and_blob_cache, FLAGS_blob_cache_size,
FLAGS_blob_cache_numshardbits, FLAGS_prepopulate_blob_cache);
", blob cache size %" PRIu64
", blob cache num shard bits: %d",
FLAGS_blob_cache_size, FLAGS_blob_cache_numshardbits);
}
fprintf(stdout, ", blob cache prepopulated: %d\n",
FLAGS_prepopulate_blob_cache);
} else {
fprintf(stdout, "Integrated BlobDB: blob cache disabled\n");
}

Loading…
Cancel
Save