summaryrefslogtreecommitdiffstats
path: root/sync
diff options
context:
space:
mode:
authorgangwu <gangwu@chromium.org>2015-07-17 09:20:08 -0700
committerCommit bot <commit-bot@chromium.org>2015-07-17 16:20:46 +0000
commit6193171d8b851d516897551d06683772c669654a (patch)
treea061a9146dfaeaefb6f82d1b44f77d66f96fd9e5 /sync
parentd286769b6de2b100444c4ced2fd2406206fc95d3 (diff)
downloadchromium_src-6193171d8b851d516897551d06683772c669654a.zip
chromium_src-6193171d8b851d516897551d06683772c669654a.tar.gz
chromium_src-6193171d8b851d516897551d06683772c669654a.tar.bz2
Remove using finch experiment to control database size, and now
permanently increase all the sync client database size to 32k. Increase corruption_testing::kNumEntriesRequiredForCorruption to 12000 since after database page size become 32k, 2000 trials cannot find corrupt the database. BUG=468363,510660 Review URL: https://codereview.chromium.org/1241683004 Cr-Commit-Position: refs/heads/master@{#339265}
Diffstat (limited to 'sync')
-rw-r--r--sync/syncable/directory_backing_store.cc14
-rw-r--r--sync/syncable/directory_backing_store_unittest.cc4
-rw-r--r--sync/test/directory_backing_store_corruption_testing.cc2
3 files changed, 8 insertions, 12 deletions
diff --git a/sync/syncable/directory_backing_store.cc b/sync/syncable/directory_backing_store.cc
index 378b396..317e073 100644
--- a/sync/syncable/directory_backing_store.cc
+++ b/sync/syncable/directory_backing_store.cc
@@ -10,7 +10,6 @@
#include "base/base64.h"
#include "base/logging.h"
-#include "base/metrics/field_trial.h"
#include "base/rand_util.h"
#include "base/strings/stringprintf.h"
#include "base/thread_task_runner_handle.h"
@@ -177,12 +176,6 @@ namespace {
// modifies all the columns in the entry table.
static const string::size_type kUpdateStatementBufferSize = 2048;
-bool IsSyncBackingDatabase32KEnabled() {
- const std::string group_name =
- base::FieldTrialList::FindFullName("SyncBackingDatabase32K");
- return group_name == "Enabled";
-}
-
void OnSqliteError(const base::Closure& catastrophic_error_handler,
int err,
sql::Statement* statement) {
@@ -236,7 +229,7 @@ bool SaveEntryToDB(sql::Statement* save_statement, const EntryKernel& entry) {
DirectoryBackingStore::DirectoryBackingStore(const string& dir_name)
: dir_name_(dir_name),
- database_page_size_(IsSyncBackingDatabase32KEnabled() ? 32768 : 4096),
+ database_page_size_(32768),
needs_column_refresh_(false) {
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
ResetAndCreateConnection();
@@ -245,7 +238,7 @@ DirectoryBackingStore::DirectoryBackingStore(const string& dir_name)
DirectoryBackingStore::DirectoryBackingStore(const string& dir_name,
sql::Connection* db)
: dir_name_(dir_name),
- database_page_size_(IsSyncBackingDatabase32KEnabled() ? 32768 : 4096),
+ database_page_size_(32768),
db_(db),
needs_column_refresh_(false) {
DCHECK(base::ThreadTaskRunnerHandle::IsSet());
@@ -388,8 +381,7 @@ bool DirectoryBackingStore::OpenInMemory() {
bool DirectoryBackingStore::InitializeTables() {
int page_size = 0;
- if (IsSyncBackingDatabase32KEnabled() && GetDatabasePageSize(&page_size) &&
- page_size == 4096) {
+ if (GetDatabasePageSize(&page_size) && page_size == 4096) {
IncreasePageSizeTo32K();
}
sql::Transaction transaction(db_.get());
diff --git a/sync/syncable/directory_backing_store_unittest.cc b/sync/syncable/directory_backing_store_unittest.cc
index 7260071..bc9eb07 100644
--- a/sync/syncable/directory_backing_store_unittest.cc
+++ b/sync/syncable/directory_backing_store_unittest.cc
@@ -3986,6 +3986,10 @@ TEST_F(DirectoryBackingStoreTest, IncreaseDatabasePageSizeFrom4KTo32K) {
&handles_map, &delete_journals, &metahandles_to_purge, &kernel_load_info);
EXPECT_EQ(open_result, OPENED);
+ // Set up database's page size to 4096
+ EXPECT_TRUE(dbs->db_->Execute("PRAGMA page_size=4096;"));
+ EXPECT_TRUE(dbs->Vacuum());
+
// Check if update is successful.
int pageSize = 0;
dbs->GetDatabasePageSize(&pageSize);
diff --git a/sync/test/directory_backing_store_corruption_testing.cc b/sync/test/directory_backing_store_corruption_testing.cc
index adb79c0..c35f689 100644
--- a/sync/test/directory_backing_store_corruption_testing.cc
+++ b/sync/test/directory_backing_store_corruption_testing.cc
@@ -15,7 +15,7 @@ namespace corruption_testing {
// from disk before writing, but small enough so that tests don't take too long
// and timeout. The value *may* depend on the underlying DB page size as well as
// the DB's cache_size PRAGMA.
-const int kNumEntriesRequiredForCorruption = 2000;
+const int kNumEntriesRequiredForCorruption = 12000;
bool CorruptDatabase(const base::FilePath& backing_file_path) {
// Corrupt the DB by write a bunch of zeros at the beginning.