Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(12)

Issue 2728543008: [sql] Experiment to enable smart-vacuum on Android.

Created:
3 years, 9 months ago by Scott Hess - ex-Googler
Modified:
3 years, 8 months ago
Reviewers:
pasko, Maria
CC:
chromium-reviews
Target Ref:
refs/heads/master
Project:
chromium
Visibility:
Public.

Description

[sql] Experiment to enable smart-vacuum on Android. BUG=698010

Patch Set 1 #

Patch Set 2 : cl feature suggestion, and test it. #

Total comments: 6

Patch Set 3 : Just read page size. #

Unified diffs Side-by-side diffs Delta from patch set Stats (+85 lines, -0 lines) Patch
M sql/connection.cc View 1 2 3 chunks +23 lines, -0 lines 0 comments Download
M sql/connection_unittest.cc View 1 3 chunks +62 lines, -0 lines 0 comments Download

Depends on Patchset:

Messages

Total messages: 26 (13 generated)
Scott Hess - ex-Googler
I was thinking "Yeah, experiments seem so easy these days", then as I was working ...
3 years, 9 months ago (2017-03-03 00:13:17 UTC) #2
Scott Hess - ex-Googler
On 2017/03/03 00:13:17, Scott Hess wrote: > I was thinking "Yeah, experiments seem so easy ...
3 years, 9 months ago (2017-03-03 19:47:04 UTC) #3
Maria
On 2017/03/03 19:47:04, Scott Hess wrote: > On 2017/03/03 00:13:17, Scott Hess wrote: > > ...
3 years, 9 months ago (2017-03-03 20:02:01 UTC) #4
pasko
On 2017/03/03 20:02:01, Maria wrote: > On 2017/03/03 19:47:04, Scott Hess wrote: > > On ...
3 years, 9 months ago (2017-03-06 17:13:23 UTC) #5
Scott Hess - ex-Googler
cl feature suggestion, and test it.
3 years, 9 months ago (2017-03-28 00:17:24 UTC) #6
Scott Hess - ex-Googler
On 2017/03/06 17:13:23, pasko wrote: > On 2017/03/03 20:02:01, Maria wrote: > > On 2017/03/03 ...
3 years, 9 months ago (2017-03-28 00:24:43 UTC) #9
Maria
https://codereview.chromium.org/2728543008/diff/20001/sql/connection.cc File sql/connection.cc (right): https://codereview.chromium.org/2728543008/diff/20001/sql/connection.cc#newcode1868 sql/connection.cc:1868: const int page_size = page_size_ ? page_size_ : 1024; ...
3 years, 8 months ago (2017-03-28 22:14:59 UTC) #16
Scott Hess - ex-Googler
https://codereview.chromium.org/2728543008/diff/20001/sql/connection.cc File sql/connection.cc (right): https://codereview.chromium.org/2728543008/diff/20001/sql/connection.cc#newcode1868 sql/connection.cc:1868: const int page_size = page_size_ ? page_size_ : 1024; ...
3 years, 8 months ago (2017-03-29 03:28:46 UTC) #17
Maria
https://codereview.chromium.org/2728543008/diff/20001/sql/connection_unittest.cc File sql/connection_unittest.cc (right): https://codereview.chromium.org/2728543008/diff/20001/sql/connection_unittest.cc#newcode1669 sql/connection_unittest.cc:1669: base::FEATURE_DISABLED_BY_DEFAULT}; On 2017/03/29 03:28:46, Scott Hess wrote: > On ...
3 years, 8 months ago (2017-03-29 04:23:51 UTC) #18
Scott Hess - ex-Googler
Just read page size.
3 years, 8 months ago (2017-03-29 20:49:55 UTC) #19
Scott Hess - ex-Googler
Also, the previous pass' broken bots were ... random chance? I don't know, they didn't ...
3 years, 8 months ago (2017-03-29 21:11:24 UTC) #22
Maria
lgtm
3 years, 8 months ago (2017-03-29 21:30:45 UTC) #23
Scott Hess - ex-Googler
3 years, 8 months ago (2017-03-31 00:09:37 UTC) #26
On 2017/03/29 21:30:45, Maria wrote:
> lgtm

Unfortunately, sql::Connection::Open() is called before the system has
initialized feature lists in many cases, which causes a CHECK failure:
FATAL:feature_list.cc(250)] Check failed: !g_initialized_from_accessor.

I do not fully understand what this means.  I _think_ it means that there needs
to be a particular ordering between first access to the feature list and first
use.  It's possible this is a test-only failure, like there's some non-obvious
set of new setup dependencies which my change needs someone else to have before
it can work.

I'm not sure that problem is worth solving, given that this only applies to
Android.  But I don't think an #if to make the change Android-specific will
solve the build problem.  I'm out next week, and I'm running out of runway to
even do anything with it, so if either of you want to run with this to start
generating data, you have my blessing and encouragement.  [Actually, if you want
to see results from this, it might be best to move on it from your end.]

The operation of SQLITE_FCNTL_CHUNK_SIZE reaches down to the VFS layer of
SQLite, while the auto_vacuum_slack_pages PRAGMA affects the pager layer, which
is why the setup code is a little funky, because it has to bridge between the
native units of each.  It may be that there is a way to link them within SQLite,
I was just trying to keep the patch minimal (I'd rather have 12 lines of code up
in sql::Connection::Open() than a routinely-broken patch against SQLite).

Powered by Google App Engine
This is Rietveld 408576698