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

Issue 2053163002: [Offline pages] Adding persistent request queue based on SQLite (Closed)

Created:
4 years, 6 months ago by fgorski
Modified:
3 years, 8 months ago
CC:
chromium-reviews, romax+watch_chromium.org, fgorski+watch_chromium.org, dewittj+watch_chromium.org, petewil+watch_chromium.org, chili+watch_chromium.org, dimich+watch_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

[Offline pages] Adding persistent request queue based on SQLite * This patch adds request queue SQLite base store. * Converst in memory store tests to typed tests and adapts them to SQLite. BUG=607221 Committed: https://crrev.com/5ff2a7b64f096594f1970eb18c61996972268835 Cr-Commit-Position: refs/heads/master@{#401622}

Patch Set 1 #

Patch Set 2 : Refactoring request queue store tests and adding tests for SQL store #

Patch Set 3 : Fixing the code to pass all the tests #

Patch Set 4 : Rebasing #

Total comments: 18

Patch Set 5 : Adding DEPS #

Patch Set 6 : Fixing gyp and gn files #

Patch Set 7 : Fixing save page request #

Patch Set 8 : Addressing feedback from Pete #

Patch Set 9 : Updating the gypi file to include sqlite based store #

Total comments: 6

Patch Set 10 : Updating documentation and moving code around per Doug's review #

Total comments: 8

Patch Set 11 : Addressing code review feedback from petewil #

Total comments: 54

Patch Set 12 : Addressing CR feedback from shess@ #

Patch Set 13 : Rebasing (after renaming test file outside) #

Patch Set 14 : Updating the data definition code and getting rid of the enum to access columns #

Total comments: 7

Patch Set 15 : Fixing code comments #

Total comments: 2
Unified diffs Side-by-side diffs Delta from patch set Stats (+622 lines, -126 lines) Patch
M components/offline_pages.gypi View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +3 lines, -0 lines 0 comments Download
M components/offline_pages/background/BUILD.gn View 1 2 3 4 5 6 7 8 9 10 11 12 2 chunks +3 lines, -0 lines 0 comments Download
A + components/offline_pages/background/DEPS View 1 2 3 4 1 chunk +1 line, -1 line 0 comments Download
M components/offline_pages/background/request_queue.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 1 chunk +1 line, -1 line 0 comments Download
M components/offline_pages/background/request_queue_in_memory_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 3 chunks +4 lines, -10 lines 0 comments Download
A components/offline_pages/background/request_queue_store_sql.h View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +94 lines, -0 lines 0 comments Download
A components/offline_pages/background/request_queue_store_sql.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 1 chunk +325 lines, -0 lines 2 comments Download
M components/offline_pages/background/request_queue_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 4 chunks +184 lines, -112 lines 0 comments Download
M components/offline_pages/background/save_page_request.h View 1 2 3 4 5 6 1 chunk +6 lines, -0 lines 0 comments Download
M components/offline_pages/background/save_page_request_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 1 chunk +1 line, -2 lines 0 comments Download

Messages

Total messages: 34 (8 generated)
fgorski
Please, start looking.
4 years, 6 months ago (2016-06-14 18:29:36 UTC) #2
Pete Williamson
Comments for everything except the unittest for SQL (that will come later) https://codereview.chromium.org/2053163002/diff/60001/components/components_tests.gyp File components/components_tests.gyp ...
4 years, 6 months ago (2016-06-14 21:54:48 UTC) #4
fgorski
PTAL Pete, the tests for in memory store are moving to a typed test file. ...
4 years, 6 months ago (2016-06-14 22:38:05 UTC) #5
Pete Williamson
On 2016/06/14 22:38:05, fgorski wrote: > PTAL > > Pete, the tests for in memory ...
4 years, 6 months ago (2016-06-15 00:12:42 UTC) #6
fgorski
+shess@ for extensive review of SQLite implementation of the store, please.
4 years, 6 months ago (2016-06-15 16:24:47 UTC) #8
dougarnett
lgtm https://codereview.chromium.org/2053163002/diff/160001/components/offline_pages/background/request_queue_store_unittest.cc File components/offline_pages/background/request_queue_store_unittest.cc (right): https://codereview.chromium.org/2053163002/diff/160001/components/offline_pages/background/request_queue_store_unittest.cc#newcode34 components/offline_pages/background/request_queue_store_unittest.cc:34: bool operator==(const SavePageRequest& lhs, const SavePageRequest& rhs) { ...
4 years, 6 months ago (2016-06-15 16:35:46 UTC) #9
fgorski
Addressed https://codereview.chromium.org/2053163002/diff/160001/components/offline_pages/background/request_queue_store_unittest.cc File components/offline_pages/background/request_queue_store_unittest.cc (right): https://codereview.chromium.org/2053163002/diff/160001/components/offline_pages/background/request_queue_store_unittest.cc#newcode34 components/offline_pages/background/request_queue_store_unittest.cc:34: bool operator==(const SavePageRequest& lhs, const SavePageRequest& rhs) { ...
4 years, 6 months ago (2016-06-15 16:53:32 UTC) #10
Pete Williamson
https://codereview.chromium.org/2053163002/diff/180001/components/offline_pages/background/request_queue_store_unittest.cc File components/offline_pages/background/request_queue_store_unittest.cc (right): https://codereview.chromium.org/2053163002/diff/180001/components/offline_pages/background/request_queue_store_unittest.cc#newcode183 components/offline_pages/background/request_queue_store_unittest.cc:183: TYPED_TEST_CASE(RequestQueueStoreTest, StoreTypes); Nifty! I like seeing the code only ...
4 years, 6 months ago (2016-06-15 23:37:05 UTC) #11
fgorski
Pete, PTAL. https://codereview.chromium.org/2053163002/diff/180001/components/offline_pages/background/request_queue_store_unittest.cc File components/offline_pages/background/request_queue_store_unittest.cc (right): https://codereview.chromium.org/2053163002/diff/180001/components/offline_pages/background/request_queue_store_unittest.cc#newcode183 components/offline_pages/background/request_queue_store_unittest.cc:183: TYPED_TEST_CASE(RequestQueueStoreTest, StoreTypes); On 2016/06/15 23:37:05, Pete Williamson ...
4 years, 6 months ago (2016-06-16 16:41:08 UTC) #12
Pete Williamson
lgtm
4 years, 6 months ago (2016-06-16 17:09:37 UTC) #13
Scott Hess - ex-Googler
Looks like I did some reviewing, then forgot to send. https://codereview.chromium.org/2053163002/diff/200001/components/offline_pages/background/request_queue_store_sql.cc File components/offline_pages/background/request_queue_store_sql.cc (right): https://codereview.chromium.org/2053163002/diff/200001/components/offline_pages/background/request_queue_store_sql.cc#newcode72 ...
4 years, 6 months ago (2016-06-20 19:38:33 UTC) #14
Scott Hess - ex-Googler
BTW, I _think_ request_queue_store_unittest.cc is just the deleted file, plus changes. WDYT of landing the ...
4 years, 6 months ago (2016-06-20 19:40:36 UTC) #15
fgorski
Addressed. Please continue reviewing. https://codereview.chromium.org/2053163002/diff/200001/components/offline_pages/background/request_queue_store_sql.cc File components/offline_pages/background/request_queue_store_sql.cc (right): https://codereview.chromium.org/2053163002/diff/200001/components/offline_pages/background/request_queue_store_sql.cc#newcode72 components/offline_pages/background/request_queue_store_sql.cc:72: return db->Execute(sql.c_str()); On 2016/06/20 19:38:32, ...
4 years, 6 months ago (2016-06-20 23:43:00 UTC) #16
Scott Hess - ex-Googler
I think the previous cl was https://codereview.chromium.org/1834563002/ by bburns. Is that not related to this? ...
4 years, 6 months ago (2016-06-21 00:15:44 UTC) #17
fgorski
On 2016/06/21 00:15:44, Scott Hess wrote: > I think the previous cl was https://codereview.chromium.org/1834563002/ by ...
4 years, 6 months ago (2016-06-21 18:07:22 UTC) #18
fgorski
shess@ ptal I am trying to do my best base on the last message. Let ...
4 years, 6 months ago (2016-06-21 20:33:31 UTC) #19
Scott Hess - ex-Googler
On 2016/06/21 20:33:31, fgorski wrote: > shess@ ptal I am trying to do my best ...
4 years, 6 months ago (2016-06-21 22:27:41 UTC) #20
Scott Hess - ex-Googler
I think I'm at LGTM, with only the minor nit about a spelling error. If ...
4 years, 6 months ago (2016-06-22 18:31:45 UTC) #21
fgorski
Decided not to change stuff except for the comment. I think we have a plan ...
4 years, 6 months ago (2016-06-22 23:32:17 UTC) #22
Scott Hess - ex-Googler
LGTM still. BTW, I'm going to be out for July. I'd love to have a ...
4 years, 6 months ago (2016-06-22 23:46:06 UTC) #23
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/patch-status/2053163002/280001
4 years, 6 months ago (2016-06-23 16:14:05 UTC) #26
commit-bot: I haz the power
Committed patchset #15 (id:280001)
4 years, 6 months ago (2016-06-23 16:19:41 UTC) #28
commit-bot: I haz the power
Patchset 15 (id:??) landed as https://crrev.com/5ff2a7b64f096594f1970eb18c61996972268835 Cr-Commit-Position: refs/heads/master@{#401622}
4 years, 6 months ago (2016-06-23 16:22:43 UTC) #30
pasko
https://codereview.chromium.org/2053163002/diff/280001/components/offline_pages/background/request_queue_store_sql.cc File components/offline_pages/background/request_queue_store_sql.cc (right): https://codereview.chromium.org/2053163002/diff/280001/components/offline_pages/background/request_queue_store_sql.cc#newcode132 components/offline_pages/background/request_queue_store_sql.cc:132: db->set_cache_size(500); curious: did the default values not work here ...
3 years, 8 months ago (2017-03-31 12:29:16 UTC) #32
fgorski
Hi, Egor, I was reusing a lot of offline_page_metadata_store_sql, to keep the stores as similar ...
3 years, 8 months ago (2017-03-31 16:15:22 UTC) #33
pasko
3 years, 8 months ago (2017-03-31 18:26:45 UTC) #34
Message was sent while issue was closed.
Filip, thank you for detailed response!!

On 2017/03/31 16:15:22, fgorski wrote:
> Hi, Egor,
> 
> I was reusing a lot of offline_page_metadata_store_sql, to keep the stores as
> similar as possible. I actually read through extensive comments that Scott
left
> when bburns@ was developing the first store. Please see the pasted chunk that
is
> relevant to your question, or follow the link to get more information.

yeah, makes sense

> Are you working on a store of your own right now? Is there any way I could
help
> you?

I am investigating how our various databases behave on Android to potentially
reduce the amount of stuff we write (http://crbug.com/697122). This DB is by far
not near the biggest offenders :)

This question is only related because as part of the investigation I
occasionally glanced here and wanted to self-educate.

>
https://codereview.chromium.org/2053163002/diff/280001/components/offline_pag...
> File components/offline_pages/background/request_queue_store_sql.cc (right):
> 
>
https://codereview.chromium.org/2053163002/diff/280001/components/offline_pag...
> components/offline_pages/background/request_queue_store_sql.cc:132:
> db->set_cache_size(500);
> On 2017/03/31 12:29:16, pasko wrote:
> > curious: did the default values not work here for some particular reason or
it
> > is just a copy-paste from offline_page_metadata_store_sql.cc?
> 
> This is following recommendation from shess@ made in 
>
https://codereview.chromium.org/1834563002/diff/490001/components/offline_pag...
> 
> '''
> I just realized that I was being lax about other connection setup!  Somewhere
> around here you should have something like:
>   db_->set_page_size(4096);
>   db_->set_cache_size(500);  // Or -2000
>   db_->set_histogram_tag("OfflinePageMetadata");
>   db_->set_exclusive_locking();
> 
> The default page size is 1024, but SQLite is changing to 4096.  The vast
> majority of our systems should use 4096 going forward.  4096 is somewhat more
> efficient with read-ahead and page packing, 1024 is probably better for very
> constrained systems, but the primary reason for the change is that 1024 on
many
> systems to day involves a read-modify-write cycle.  For your case, I think
your
> rows are likely to be large enough to justify this, because it should reduce
the
> incidence of overflow pages quite a bit.

hm, is this assumption the same for both databases? seems like request_queue may
operate on smaller chunks? Anyhow, changing it would be premature at this point
I think.

Powered by Google App Engine
This is Rietveld 408576698