Skip to content

Commit 374c8dd

Browse files
mszeszko-metameta-codesync[bot]
authored andcommitted
Remove bytes_per_sync config option (#14276)
Summary: Pull Request resolved: #14276 No production user of Legacy overrides the default value of `bytes_per_sync`. Replace the option with a constant `kBytesPerSync` to further reduce legacy blob db customizability / configuration surface. Reviewed By: xingbowang Differential Revision: D91089096 fbshipit-source-id: 162df65646a4f3a3fab3586cf6ff223e1917d86e
1 parent 053b0d5 commit 374c8dd

File tree

8 files changed

+5
-23
lines changed

8 files changed

+5
-23
lines changed

db_stress_tool/db_stress_common.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -297,7 +297,6 @@ DECLARE_uint32(occ_lock_bucket_count);
297297

298298
// Options for StackableDB-based BlobDB
299299
DECLARE_bool(use_blob_db);
300-
DECLARE_uint64(blob_db_bytes_per_sync);
301300
DECLARE_uint64(blob_db_file_size);
302301
DECLARE_bool(blob_db_enable_gc);
303302

db_stress_tool/db_stress_gflags.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -425,11 +425,6 @@ DEFINE_bool(enable_write_thread_adaptive_yield,
425425
// Options for StackableDB-based BlobDB
426426
DEFINE_bool(use_blob_db, false, "[Stacked BlobDB] Use BlobDB.");
427427

428-
DEFINE_uint64(
429-
blob_db_bytes_per_sync,
430-
ROCKSDB_NAMESPACE::blob_db::BlobDBOptions().bytes_per_sync,
431-
"[Stacked BlobDB] Sync blob files once per every N bytes written.");
432-
433428
DEFINE_uint64(blob_db_file_size,
434429
ROCKSDB_NAMESPACE::blob_db::BlobDBOptions().blob_file_size,
435430
"[Stacked BlobDB] Target size of each blob file.");

db_stress_tool/db_stress_test_base.cc

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3844,7 +3844,6 @@ void StressTest::Open(SharedState* shared, bool reopen) {
38443844
// StackableDB-based BlobDB
38453845
if (FLAGS_use_blob_db) {
38463846
blob_db::BlobDBOptions blob_db_options;
3847-
blob_db_options.bytes_per_sync = FLAGS_blob_db_bytes_per_sync;
38483847
blob_db_options.blob_file_size = FLAGS_blob_db_file_size;
38493848
blob_db_options.enable_garbage_collection = FLAGS_blob_db_enable_gc;
38503849

tools/db_bench_tool.cc

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1064,10 +1064,6 @@ DEFINE_uint64(
10641064
ROCKSDB_NAMESPACE::blob_db::BlobDBOptions().ttl_range_secs,
10651065
"[Stacked BlobDB] TTL bucket size to use when creating blob files.");
10661066

1067-
DEFINE_uint64(blob_db_bytes_per_sync,
1068-
ROCKSDB_NAMESPACE::blob_db::BlobDBOptions().bytes_per_sync,
1069-
"[Stacked BlobDB] Bytes to sync blob file at.");
1070-
10711067
DEFINE_uint64(blob_db_file_size,
10721068
ROCKSDB_NAMESPACE::blob_db::BlobDBOptions().blob_file_size,
10731069
"[Stacked BlobDB] Target size of each blob file.");
@@ -5178,7 +5174,6 @@ class Benchmark {
51785174
blob_db_options.enable_garbage_collection = FLAGS_blob_db_enable_gc;
51795175
blob_db_options.max_db_size = FLAGS_blob_db_max_db_size;
51805176
blob_db_options.ttl_range_secs = FLAGS_blob_db_ttl_range_secs;
5181-
blob_db_options.bytes_per_sync = FLAGS_blob_db_bytes_per_sync;
51825177
blob_db_options.blob_file_size = FLAGS_blob_db_file_size;
51835178
blob_db::BlobDB* ptr = nullptr;
51845179
s = hooks.Open(options, blob_db_options, db_name, &ptr);

utilities/blob_db/blob_db.cc

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -74,9 +74,6 @@ void BlobDBOptions::Dump(Logger* log) const {
7474
ROCKS_LOG_HEADER(
7575
log, " BlobDBOptions.ttl_range_secs: %" PRIu64,
7676
ttl_range_secs);
77-
ROCKS_LOG_HEADER(
78-
log, " BlobDBOptions.bytes_per_sync: %" PRIu64,
79-
bytes_per_sync);
8077
ROCKS_LOG_HEADER(
8178
log, " BlobDBOptions.blob_file_size: %" PRIu64,
8279
blob_file_size);

utilities/blob_db/blob_db.h

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,6 +28,10 @@ constexpr uint64_t kNoExpiration = std::numeric_limits<uint64_t>::max();
2828
// Name of the directory under the base DB where blobs will be stored.
2929
constexpr const char* kBlobDirName = "blob_dir";
3030

31+
// Allows OS to incrementally sync blob files to disk for every
32+
// kBytesPerSync bytes written.
33+
constexpr uint64_t kBytesPerSync = 512 * 1024;
34+
3135
struct BlobDBOptions {
3236
// Maximum size of the database (including SST files and blob files).
3337
//
@@ -42,11 +46,6 @@ struct BlobDBOptions {
4246
// and so on
4347
uint64_t ttl_range_secs = 3600;
4448

45-
// Allows OS to incrementally sync blob files to disk for every
46-
// bytes_per_sync bytes written. Users shouldn't rely on it for
47-
// persistency guarantee.
48-
uint64_t bytes_per_sync = 512 * 1024;
49-
5049
// the target size of each blob file. File will become immutable
5150
// after it exceeds that size
5251
uint64_t blob_file_size = 256 * 1024 * 1024;

utilities/blob_db/blob_db_impl.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ BlobDBImpl::BlobDBImpl(const std::string& dbname,
8989
debug_level_(0) {
9090
clock_ = env_->GetSystemClock().get();
9191
blob_dir_ = dbname + "/" + kBlobDirName;
92-
file_options_.bytes_per_sync = blob_db_options.bytes_per_sync;
92+
file_options_.bytes_per_sync = kBytesPerSync;
9393
}
9494

9595
BlobDBImpl::~BlobDBImpl() {

utilities/blob_db/blob_db_test.cc

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1786,7 +1786,6 @@ TEST_F(BlobDBTest, SyncBlobFileBeforeClose) {
17861786
options.statistics = CreateDBStatistics();
17871787

17881788
BlobDBOptions blob_options;
1789-
blob_options.bytes_per_sync = 1 << 20;
17901789
blob_options.disable_background_tasks = true;
17911790

17921791
Open(blob_options, options);
@@ -1805,7 +1804,6 @@ TEST_F(BlobDBTest, SyncBlobFileBeforeCloseIOError) {
18051804
options.env = fault_injection_env_.get();
18061805

18071806
BlobDBOptions blob_options;
1808-
blob_options.bytes_per_sync = 1 << 20;
18091807
blob_options.disable_background_tasks = true;
18101808

18111809
Open(blob_options, options);

0 commit comments

Comments
 (0)