diff options
author | Chris Mumford <cmumford@chromium.org> | 2015-02-23 09:11:36 -0800 |
---|---|---|
committer | Chris Mumford <cmumford@chromium.org> | 2015-02-23 17:13:31 +0000 |
commit | 41d8c32e93f7ba13717303eb25497be255da98f1 (patch) | |
tree | 767c036204f50aa589a5a49bf850df81c19726f9 | |
parent | 7d36cddd9883e95fe5bd50a9e1bc4987e006ec73 (diff) | |
download | chromium_src-41d8c32e93f7ba13717303eb25497be255da98f1.zip chromium_src-41d8c32e93f7ba13717303eb25497be255da98f1.tar.gz chromium_src-41d8c32e93f7ba13717303eb25497be255da98f1.tar.bz2 |
IndexedDB: Disable leveldb log reuse on Chrome OS only.
Once the leveldb log reuse was enabled database corruption rates increased, but
only appreciably on Chrome OS. All other platforms were effectively flat.
Because of the significant performance gains to this original change we are
disabling log reuse on Chrome OS only.
BUG=460568
Review URL: https://codereview.chromium.org/947573002
(cherry picked from commit 4c93e0fb4f65b1bceb9653e421a7687ffa5a4004)
Cr-Original-Commit-Position: refs/heads/master@{#317499}
Cr-Commit-Position: refs/branch-heads/2272@{#360}
Cr-Branched-From: 827a380cfdb31aa54c8d56e63ce2c3fd8c3ba4d4-refs/heads/master@{#310958}
-rw-r--r-- | content/browser/indexed_db/leveldb/leveldb_database.cc | 5 | ||||
-rw-r--r-- | third_party/leveldatabase/env_chromium.cc | 8 |
2 files changed, 13 insertions, 0 deletions
diff --git a/content/browser/indexed_db/leveldb/leveldb_database.cc b/content/browser/indexed_db/leveldb/leveldb_database.cc index 8dd60c8..6160836 100644 --- a/content/browser/indexed_db/leveldb/leveldb_database.cc +++ b/content/browser/indexed_db/leveldb/leveldb_database.cc @@ -103,7 +103,12 @@ static leveldb::Status OpenDB( options.create_if_missing = true; options.paranoid_checks = true; options.filter_policy = filter_policy->get(); +#if defined(OS_CHROMEOS) + // Disabled on CrOS until crbug.com/460568 is fixed. + options.reuse_logs = false; +#else options.reuse_logs = true; +#endif options.compression = leveldb::kSnappyCompression; // For info about the troubles we've run into with this parameter, see: diff --git a/third_party/leveldatabase/env_chromium.cc b/third_party/leveldatabase/env_chromium.cc index 67d005f..d1d096f 100644 --- a/third_party/leveldatabase/env_chromium.cc +++ b/third_party/leveldatabase/env_chromium.cc @@ -900,6 +900,14 @@ Status ChromiumEnv::NewWritableFile(const std::string& fname, Status ChromiumEnv::NewAppendableFile(const std::string& fname, leveldb::WritableFile** result) { +#if defined(OS_CHROMEOS) + // Disabled until crbug.com/460568 is fixed. Technically this method shouldn't + // be called if reuse_logs is false, but a leveldb bug (fixed, but not yet in + // Chrome) still calls this function. Using default leveldb Env implementation + // to workaround this bug. + return Env::NewAppendableFile(fname, result); +#endif + *result = NULL; FilePath path = FilePath::FromUTF8Unsafe(fname); scoped_ptr<base::File> f(new base::File( |