Skip to content

Commit

Permalink
Mark unsafe/outdated options as deprecated
Browse files Browse the repository at this point in the history
These options were added for users to roll back a behavior change
without downgrading. To our knowledge they were not needed so can now be
removed.

- `level_compaction_dynamic_file_size`
- `ignore_max_compaction_bytes_for_input`

These options were added for users to disable an online validation in
case it is expensive or has false positives. Those validations have
shown to be cheap, correct, and are enabled by default, so these options
can be removed.

- `check_flush_compaction_key_order`
- `flush_verify_memtable_count`
- `compaction_verify_record_count`
- `fail_if_options_file_error`

This option was added for users to violate API contracts or run old
databases that used to violate API contracts. It appears to be set by
MyRocks so it is unclear whether we can remove it. In any case we should
discourage it until it can be removed.

- `enforce_single_del_contracts`
  • Loading branch information
ajkr committed Jan 18, 2024
1 parent 4835c11 commit 3054fd6
Show file tree
Hide file tree
Showing 3 changed files with 15 additions and 0 deletions.
6 changes: 6 additions & 0 deletions include/rocksdb/advanced_options.h
Original file line number Diff line number Diff line change
Expand Up @@ -547,6 +547,8 @@ struct AdvancedColumnFamilyOptions {
// Default: true
bool level_compaction_dynamic_level_bytes = true;

// DEPRECATED: This function might be removed in a future release.
//
// Allows RocksDB to generate files that are not exactly the target_file_size
// only for the non-bottommost files. Which can reduce the write-amplification
// from compaction. The file size could be from 0 to 2x target_file_size.
Expand Down Expand Up @@ -582,6 +584,8 @@ struct AdvancedColumnFamilyOptions {
// Dynamically changeable through SetOptions() API
uint64_t max_compaction_bytes = 0;

// DEPRECATED: This function might be removed in a future release.
//
// When setting up compaction input files, we ignore the
// `max_compaction_bytes` limit when pulling in input files that are entirely
// within output key range.
Expand Down Expand Up @@ -697,6 +701,8 @@ struct AdvancedColumnFamilyOptions {
// Default: false
bool optimize_filters_for_hits = false;

// DEPRECATED: This function might be removed in a future release.
//
// During flush or compaction, check whether keys inserted to output files
// are in order.
//
Expand Down
8 changes: 8 additions & 0 deletions include/rocksdb/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -502,6 +502,8 @@ struct DBOptions {
// Default: true
bool paranoid_checks = true;

// DEPRECATED: This function might be removed in a future release.
//
// If true, during memtable flush, RocksDB will validate total entries
// read in flush, and compare with counter inserted into it.
//
Expand All @@ -512,6 +514,8 @@ struct DBOptions {
// Default: true
bool flush_verify_memtable_count = true;

// DEPRECATED: This function might be removed in a future release.
//
// If true, during compaction, RocksDB will count the number of entries
// read and compare it against the number of entries in the compaction
// input files. This is intended to add protection against corruption
Expand Down Expand Up @@ -1206,6 +1210,8 @@ struct DBOptions {
// currently.
WalFilter* wal_filter = nullptr;

// DEPRECATED: This function might be removed in a future release.
//
// If true, then DB::Open, CreateColumnFamily, DropColumnFamily, and
// SetOptions will fail if options file is not properly persisted.
//
Expand Down Expand Up @@ -1421,6 +1427,8 @@ struct DBOptions {
// Default: kNonVolatileBlockTier
CacheTier lowest_used_cache_tier = CacheTier::kNonVolatileBlockTier;

// DEPRECATED: This function might be removed in a future release.
//
// If set to false, when compaction or flush sees a SingleDelete followed by
// a Delete for the same user key, compaction job will not fail.
// Otherwise, compaction job will fail.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Deprecated several options: `level_compaction_dynamic_file_size`, `ignore_max_compaction_bytes_for_input`, `check_flush_compaction_key_order`, `flush_verify_memtable_count`, `compaction_verify_record_count`, `fail_if_options_file_error`, and `enforce_single_del_contracts`

0 comments on commit 3054fd6

Please sign in to comment.