From ac1d69da31205a979b5a8510f33c31ae977530f0 Mon Sep 17 00:00:00 2001 From: Sanjay Ghemawat Date: Thu, 11 Dec 2014 08:13:18 -0800 Subject: LevelDB now attempts to reuse the preceding MANIFEST and log file when re-opened. (Based on a suggestion by cmumford.) "open" benchmark on my workstation speeds up significantly since we can now avoid three fdatasync calls and a compaction per open: Before: ~80000 microseconds After: ~130 microseconds Details: (1) Added Options::reuse_logs (currently defaults to false) to control new behavior. The intention is to change the default to true after some baking. (2) Added Env::NewAppendableFile() whose default implementation returns a not-supported error. (3) VersionSet::Recovery attempts to reuse the MANIFEST from which it is recovering. (4) DBImpl recovery attempts to reuse the last log file and memtable. (5) db_test.cc now tests a new configuration that sets reuse_logs to true. (6) fault_injection_test also tests a reuse_logs==true config. (7) Added a new recovery_test. --- util/options.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'util/options.cc') diff --git a/util/options.cc b/util/options.cc index 76af5b9..8b618fb 100644 --- a/util/options.cc +++ b/util/options.cc @@ -22,8 +22,8 @@ Options::Options() block_size(4096), block_restart_interval(16), compression(kSnappyCompression), + reuse_logs(false), filter_policy(NULL) { } - } // namespace leveldb -- cgit v1.2.1