diff options
author | shess <shess@chromium.org> | 2015-12-17 17:18:08 -0800 |
---|---|---|
committer | Commit bot <commit-bot@chromium.org> | 2015-12-18 01:19:51 +0000 |
commit | 9bf2c6745727731429baa207db994de5278505a0 (patch) | |
tree | 8c9bae35ab2d6ec26690816f175a064ecfb6633a /sync/syncable | |
parent | dfbb949421a0f2634ae49d5343d270d7e147203b (diff) | |
download | chromium_src-9bf2c6745727731429baa207db994de5278505a0.zip chromium_src-9bf2c6745727731429baa207db994de5278505a0.tar.gz chromium_src-9bf2c6745727731429baa207db994de5278505a0.tar.bz2 |
[sql] Consider fresh databases suitable for memory-mapped I/O.
GetAppropriateMmapSize() is called to validate the database as
error-free before enabling memory-mapped mode. The validation status is
stored in the [meta] table, since new databases have no [meta] table it
previously defaulted to not turning on memory-mapping. Then on second
open the file would be validated.
This change uses the lack of [meta] table as a signal that the file is
new and should be safe to memory-map. Additionally the code creating
[meta] pre-populates that setting.
Additionally disable memory-mapped mode for databases which do not make
use of the [meta] table. This makes the existing settings explicit.
BUG=537742, 555578
TBR=rdevlin.cronin@chromium.org, michaeln@chromium.org, zea@chromium.org, sky@chromium.org
Review URL: https://codereview.chromium.org/1533703002
Cr-Commit-Position: refs/heads/master@{#365959}
Diffstat (limited to 'sync/syncable')
-rw-r--r-- | sync/syncable/directory_backing_store.cc | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc index 55c99d3..fa1b947 100644 --- a/sync/syncable/directory_backing_store.cc +++ b/sync/syncable/directory_backing_store.cc @@ -1728,9 +1728,10 @@ void DirectoryBackingStore::ResetAndCreateConnection() { db_->set_cache_size(32); db_->set_page_size(database_page_size_); - // TODO(shess): Sync corruption tests interact poorly with mmap, disable for - // now. http://crbug.com/533682 + // TODO(shess): The current mitigation for http://crbug.com/537742 stores + // state in the meta table, which this database does not use. db_->set_mmap_disabled(); + if (!catastrophic_error_handler_.is_null()) SetCatastrophicErrorHandler(catastrophic_error_handler_); } |