Skip to content

Commit

Permalink
flip default DBOptions::fail_if_options_file_error (#11800)
Browse files Browse the repository at this point in the history
Summary:
Changed `DBOptions::fail_if_options_file_error` default from `false` to
`true`. It is safer to fail an operation by default when it encounters
an error.

Also changed the API doc to list items in the conventional way for listing items in a sentence. The slashes weren't working well as one got dropped, probably because it looked like a typo.

Pull Request resolved: #11800

Test Plan: rely on CI

Reviewed By: jowlyzhang

Differential Revision: D49030532

Pulled By: ajkr

fbshipit-source-id: e606062aa25f9063d8c6fb0d03aebca5c2bc56d3
  • Loading branch information
ajkr authored and facebook-github-bot committed Sep 29, 2023
1 parent 63ed868 commit 3c4cc6c
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 3 deletions.
6 changes: 3 additions & 3 deletions include/rocksdb/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -1200,11 +1200,11 @@ struct DBOptions {
// currently.
WalFilter* wal_filter = nullptr;

// If true, then DB::Open / CreateColumnFamily / DropColumnFamily
// If true, then DB::Open, CreateColumnFamily, DropColumnFamily, and
// SetOptions will fail if options file is not properly persisted.
//
// DEFAULT: false
bool fail_if_options_file_error = false;
// DEFAULT: true
bool fail_if_options_file_error = true;

// If true, then print malloc stats together with rocksdb.stats
// when printing to LOG.
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
* The default value of `DBOptions::fail_if_options_file_error` changed from `false` to `true`. Operations that set in-memory options (e.g., `DB::Open*()`, `DB::SetOptions()`, `DB::CreateColumnFamily*()`, and `DB::DropColumnFamily()`) but fail to persist the change will now return a non-OK `Status` by default.

0 comments on commit 3c4cc6c

Please sign in to comment.