Skip to content

Commit

Permalink
The default settings enable checksum verification on every read.
Browse files Browse the repository at this point in the history
Summary: The default settings enable checksum verification on every read.

Test Plan: make check

Reviewers: haobo

Reviewed By: haobo

CC: leveldb

Differential Revision: https://reviews.facebook.net/D15591
  • Loading branch information
dhruba committed Jan 31, 2014
1 parent 3c0dcf0 commit abd70ec
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 4 deletions.
1 change: 0 additions & 1 deletion db/version_set.cc
Original file line number Diff line number Diff line change
Expand Up @@ -2088,7 +2088,6 @@ Compaction* VersionSet::CompactRange(int input_level, int output_level,

Iterator* VersionSet::MakeInputIterator(Compaction* c) {
ReadOptions options;
options.verify_checksums = options_->paranoid_checks;
options.fill_cache = false;

// Level-0 files have to be merged together. For other levels,
Expand Down
8 changes: 5 additions & 3 deletions include/rocksdb/options.h
Original file line number Diff line number Diff line change
Expand Up @@ -672,7 +672,7 @@ enum ReadTier {
struct ReadOptions {
// If true, all data read from underlying storage will be
// verified against corresponding checksums.
// Default: false
// Default: true
bool verify_checksums;

// Should the "data block"/"index block"/"filter block" read for this
Expand Down Expand Up @@ -713,11 +713,13 @@ struct ReadOptions {

// Specify to create a tailing iterator -- a special iterator that has a
// view of the complete database (i.e. it can also be used to read newly
// added data) and is optimized for sequential reads.
// added data) and is optimized for sequential reads. It will return records
// that were inserted into the database after the creation of the iterator.
// Default: false
bool tailing;

ReadOptions()
: verify_checksums(false),
: verify_checksums(true),
fill_cache(true),
prefix_seek(false),
snapshot(nullptr),
Expand Down

0 comments on commit abd70ec

Please sign in to comment.