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

Issue 13907009: Support optimistic Create and Write operations on the SimpleCache. (Closed)

Created:
7 years, 7 months ago by felipeg
Modified:
7 years, 7 months ago
CC:
chromium-reviews, cbentzel+watch_chromium.org, gavinp+disk_chromium.org
Visibility:
Public.

Description

Support optimistic Create and Write operations on the SimpleCache. On CreateEntry we return net::OK immediately while issuing a WorkerPool thread to create the files. If the file creation fails, we will fail every next operation in the same entry. If another (read or write) operation is called in that entry before the completion of the creation, that entry is enqueued and we return IO_PENDING. The same happens to the WriteData operation. If the WriteData is called in an entry that does not have any operation in progress, we return buf_len immediately and issue a WorkerPool to write the data in the background. If the WriteData operation fails every next operation will fail. If we receive another Read/Write operation while the WriteData background operation did not complete, we always enqueue the operation and return IO_PENDING. BUG=173400 Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=198286

Patch Set 1 #

Patch Set 2 : #

Patch Set 3 : rebase #

Patch Set 4 : Unittests #

Patch Set 5 : bugfix on an unittest #

Patch Set 6 : another bugfix #

Patch Set 7 : make linker happy #

Total comments: 34

Patch Set 8 : gavin comments #

Patch Set 9 : Debug the unittest 4 on android #

Patch Set 10 : gavin last comment #

Patch Set 11 : sync #

Patch Set 12 : fix SimpleCacheOptimistic4 #

Total comments: 26

Patch Set 13 : gavin comments #

Patch Set 14 : egor comments #

Patch Set 15 : Run browser tests with our simple cache #

Total comments: 3

Patch Set 16 : fix the http_cache DCHECK(FindActiveEntry) on Create #

Total comments: 4

Patch Set 17 : gavin comments #

Total comments: 5

Patch Set 18 : #

Total comments: 5

Patch Set 19 : #

Patch Set 20 : #

Unified diffs Side-by-side diffs Delta from patch set Stats (+542 lines, -102 lines) Patch
M net/disk_cache/backend_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 2 chunks +14 lines, -0 lines 0 comments Download
M net/disk_cache/entry_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 3 chunks +331 lines, -2 lines 0 comments Download
M net/disk_cache/simple/simple_entry_impl.h View 1 2 3 4 5 6 7 8 9 10 11 12 13 2 chunks +7 lines, -4 lines 0 comments Download
M net/disk_cache/simple/simple_entry_impl.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 17 chunks +187 lines, -95 lines 0 comments Download
M net/http/http_cache.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 1 chunk +3 lines, -1 line 0 comments Download

Messages

Total messages: 45 (0 generated)
felipeg
Here you go, folks! All tests passes continuously (its been running on a loop for ...
7 years, 7 months ago (2013-04-29 14:23:42 UTC) #1
gavinp
Can you please run try jobs on this?
7 years, 7 months ago (2013-04-29 14:28:07 UTC) #2
gavinp
On 2013/04/29 14:28:07, gavinp wrote: > Can you please run try jobs on this? (note: ...
7 years, 7 months ago (2013-04-29 14:32:46 UTC) #3
gavinp
Felipe, can you rebase this on top of the version of Close deflake in trunk ...
7 years, 7 months ago (2013-04-29 14:53:22 UTC) #4
gavinp
Initial thoughts on testing: I think the existing unit tests aren't adequate for this, we ...
7 years, 7 months ago (2013-04-29 18:47:53 UTC) #5
felipeg
ptal
7 years, 7 months ago (2013-04-30 15:15:04 UTC) #6
gavinp
One quick pass. Hopefully some questions we can figure out. I'm excited! https://codereview.chromium.org/13907009/diff/37004/net/disk_cache/backend_unittest.cc File net/disk_cache/backend_unittest.cc ...
7 years, 7 months ago (2013-05-01 13:11:22 UTC) #7
felipeg
https://chromiumcodereview.appspot.com/13907009/diff/37004/net/disk_cache/backend_unittest.cc File net/disk_cache/backend_unittest.cc (right): https://chromiumcodereview.appspot.com/13907009/diff/37004/net/disk_cache/backend_unittest.cc#newcode2859 net/disk_cache/backend_unittest.cc:2859: // To make sure the file creation completed we ...
7 years, 7 months ago (2013-05-02 09:49:27 UTC) #8
gavinp
https://codereview.chromium.org/13907009/diff/37004/net/disk_cache/entry_unittest.cc File net/disk_cache/entry_unittest.cc (right): https://codereview.chromium.org/13907009/diff/37004/net/disk_cache/entry_unittest.cc#newcode2734 net/disk_cache/entry_unittest.cc:2734: simple_entry->DoomEntry(cb.callback()); This won't link right. Instead: backend_->DoomEntry(key, cb.callback());
7 years, 7 months ago (2013-05-02 09:49:34 UTC) #9
felipeg
https://codereview.chromium.org/13907009/diff/37004/net/disk_cache/entry_unittest.cc File net/disk_cache/entry_unittest.cc (right): https://codereview.chromium.org/13907009/diff/37004/net/disk_cache/entry_unittest.cc#newcode2734 net/disk_cache/entry_unittest.cc:2734: simple_entry->DoomEntry(cb.callback()); On 2013/05/02 09:49:34, gavinp wrote: > This won't ...
7 years, 7 months ago (2013-05-02 09:55:06 UTC) #10
gavinp
http://build.chromium.org/p/tryserver.chromium/builders/linux_rel/builds/123201 Looks like the failure we discussed is happening on Linux, too. Did you confirm ...
7 years, 7 months ago (2013-05-02 10:57:42 UTC) #11
felipeg_google
Yes On Thu, May 2, 2013 at 12:57 PM, <gavinp@chromium.org> wrote: > http://build.chromium.org/p/**tryserver.chromium/builders/** > linux_rel/builds/123201<http://build.chromium.org/p/tryserver.chromium/builders/linux_rel/builds/123201> ...
7 years, 7 months ago (2013-05-02 11:07:22 UTC) #12
gavinp
Looking really good! https://codereview.chromium.org/13907009/diff/37004/net/disk_cache/backend_unittest.cc File net/disk_cache/backend_unittest.cc (right): https://codereview.chromium.org/13907009/diff/37004/net/disk_cache/backend_unittest.cc#newcode2859 net/disk_cache/backend_unittest.cc:2859: // To make sure the file ...
7 years, 7 months ago (2013-05-02 12:47:39 UTC) #13
felipeg
https://codereview.chromium.org/13907009/diff/37004/net/disk_cache/backend_unittest.cc File net/disk_cache/backend_unittest.cc (right): https://codereview.chromium.org/13907009/diff/37004/net/disk_cache/backend_unittest.cc#newcode2859 net/disk_cache/backend_unittest.cc:2859: // To make sure the file creation completed we ...
7 years, 7 months ago (2013-05-02 13:55:58 UTC) #14
pasko-google - do not use
I find it difficult to follow the logic of state transitions in the simple entry. ...
7 years, 7 months ago (2013-05-02 14:01:43 UTC) #15
pasko-google - do not use
BTW, please run browser_tests with it
7 years, 7 months ago (2013-05-02 14:02:34 UTC) #16
gavinp
I have a followup CL that gets rid of the operations_ queue. I wonder how ...
7 years, 7 months ago (2013-05-02 14:05:45 UTC) #17
felipeg
https://codereview.chromium.org/13907009/diff/78002/net/disk_cache/backend_unittest.cc File net/disk_cache/backend_unittest.cc (left): https://codereview.chromium.org/13907009/diff/78002/net/disk_cache/backend_unittest.cc#oldcode1 net/disk_cache/backend_unittest.cc:1: // Copyright (c) 2012 The Chromium Authors. All rights ...
7 years, 7 months ago (2013-05-02 14:10:04 UTC) #18
pasko-google - do not use
https://codereview.chromium.org/13907009/diff/78002/net/disk_cache/simple/simple_entry_impl.cc File net/disk_cache/simple/simple_entry_impl.cc (right): https://codereview.chromium.org/13907009/diff/78002/net/disk_cache/simple/simple_entry_impl.cc#newcode539 net/disk_cache/simple/simple_entry_impl.cc:539: // |this| may be destroyed after return here. On ...
7 years, 7 months ago (2013-05-02 14:39:57 UTC) #19
felipeg
https://codereview.chromium.org/13907009/diff/78002/net/disk_cache/simple/simple_entry_impl.cc File net/disk_cache/simple/simple_entry_impl.cc (right): https://codereview.chromium.org/13907009/diff/78002/net/disk_cache/simple/simple_entry_impl.cc#newcode590 net/disk_cache/simple/simple_entry_impl.cc:590: if (!completion_callback.is_null()) On 2013/05/02 14:39:57, pasko wrote: > On ...
7 years, 7 months ago (2013-05-02 14:48:02 UTC) #20
pasko-google - do not use
https://codereview.chromium.org/13907009/diff/78002/net/disk_cache/simple/simple_entry_impl.cc File net/disk_cache/simple/simple_entry_impl.cc (right): https://codereview.chromium.org/13907009/diff/78002/net/disk_cache/simple/simple_entry_impl.cc#newcode590 net/disk_cache/simple/simple_entry_impl.cc:590: if (!completion_callback.is_null()) On 2013/05/02 14:48:02, felipeg wrote: > On ...
7 years, 7 months ago (2013-05-02 15:08:45 UTC) #21
pasko-google - do not use
https://codereview.chromium.org/13907009/diff/99007/net/disk_cache/cache_creator.cc File net/disk_cache/cache_creator.cc (right): https://codereview.chromium.org/13907009/diff/99007/net/disk_cache/cache_creator.cc#newcode85 net/disk_cache/cache_creator.cc:85: if (type_ == net::DISK_CACHE) { I thought you would ...
7 years, 7 months ago (2013-05-02 15:29:35 UTC) #22
gavinp
https://codereview.chromium.org/13907009/diff/99007/net/disk_cache/cache_creator.cc File net/disk_cache/cache_creator.cc (right): https://codereview.chromium.org/13907009/diff/99007/net/disk_cache/cache_creator.cc#newcode85 net/disk_cache/cache_creator.cc:85: if (type_ == net::DISK_CACHE) { On 2013/05/02 15:29:35, pasko ...
7 years, 7 months ago (2013-05-02 15:32:40 UTC) #23
pasko-google - do not use
https://codereview.chromium.org/13907009/diff/99007/net/disk_cache/cache_creator.cc File net/disk_cache/cache_creator.cc (right): https://codereview.chromium.org/13907009/diff/99007/net/disk_cache/cache_creator.cc#newcode85 net/disk_cache/cache_creator.cc:85: if (type_ == net::DISK_CACHE) { On 2013/05/02 15:32:40, gavinp ...
7 years, 7 months ago (2013-05-02 15:35:55 UTC) #24
pasko-google - do not use
OK this is scary: One browser test fails like this: shell> gdb --args browser_tests --gtest_filter=WebViewTest.IndexedDBIsolation ...
7 years, 7 months ago (2013-05-02 15:56:19 UTC) #25
felipeg
Fixed thanks to Gavin: https://codereview.chromium.org/11787007/diff/26002/net/http/http_cache.cc On 2013/05/02 15:56:19, pasko wrote: > OK this is scary: ...
7 years, 7 months ago (2013-05-02 16:53:38 UTC) #26
gavinp
This is looking really good, and very exciting that it passes browser tests. https://codereview.chromium.org/13907009/diff/94011/net/disk_cache/cache_creator.cc File ...
7 years, 7 months ago (2013-05-03 08:19:12 UTC) #27
felipeg
https://codereview.chromium.org/13907009/diff/94011/net/disk_cache/cache_creator.cc File net/disk_cache/cache_creator.cc (right): https://codereview.chromium.org/13907009/diff/94011/net/disk_cache/cache_creator.cc#newcode85 net/disk_cache/cache_creator.cc:85: if (type_ == net::DISK_CACHE) { On 2013/05/03 08:19:12, gavinp ...
7 years, 7 months ago (2013-05-03 09:55:49 UTC) #28
gavinp
https://codereview.chromium.org/13907009/diff/108001/net/disk_cache/cache_creator.cc File net/disk_cache/cache_creator.cc (right): https://codereview.chromium.org/13907009/diff/108001/net/disk_cache/cache_creator.cc#newcode85 net/disk_cache/cache_creator.cc:85: if (type_ == net::DISK_CACHE) { This will need to ...
7 years, 7 months ago (2013-05-03 11:19:27 UTC) #29
gavinp
LGTM with that last nit of mine about braces addressed!
7 years, 7 months ago (2013-05-03 11:39:37 UTC) #30
felipeg
https://chromiumcodereview.appspot.com/13907009/diff/108001/net/disk_cache/simple/simple_entry_impl.cc File net/disk_cache/simple/simple_entry_impl.cc (right): https://chromiumcodereview.appspot.com/13907009/diff/108001/net/disk_cache/simple/simple_entry_impl.cc#newcode263 net/disk_cache/simple/simple_entry_impl.cc:263: if (truncate) On 2013/05/03 11:19:27, gavinp wrote: > Nit: ...
7 years, 7 months ago (2013-05-03 11:47:27 UTC) #31
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felipeg@chromium.org/13907009/111013
7 years, 7 months ago (2013-05-03 12:03:38 UTC) #32
commit-bot: I haz the power
Retried try job too often on ios_dbg_simulator for step(s) googleurl_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=ios_dbg_simulator&number=48965
7 years, 7 months ago (2013-05-03 12:27:10 UTC) #33
gavinp
Looks like a flake to me.
7 years, 7 months ago (2013-05-03 12:29:10 UTC) #34
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felipeg@chromium.org/13907009/111013
7 years, 7 months ago (2013-05-03 12:29:34 UTC) #35
commit-bot: I haz the power
Retried try job too often on ios_dbg_simulator for step(s) googleurl_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=ios_dbg_simulator&number=48973
7 years, 7 months ago (2013-05-03 12:50:24 UTC) #36
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felipeg@chromium.org/13907009/111013
7 years, 7 months ago (2013-05-03 13:13:42 UTC) #37
commit-bot: I haz the power
Retried try job too often on ios_dbg_simulator for step(s) googleurl_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=ios_dbg_simulator&number=48994
7 years, 7 months ago (2013-05-03 13:38:16 UTC) #38
pasko-google - do not use
this looks good to me with small nits and removed browser_tests-related hack from cache_creator.cc. Thanks, ...
7 years, 7 months ago (2013-05-03 13:55:36 UTC) #39
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felipeg@chromium.org/13907009/111013
7 years, 7 months ago (2013-05-03 17:59:55 UTC) #40
commit-bot: I haz the power
Retried try job too often on ios_dbg_simulator for step(s) googleurl_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=ios_dbg_simulator&number=49193
7 years, 7 months ago (2013-05-03 18:25:28 UTC) #41
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felipeg@chromium.org/13907009/111013
7 years, 7 months ago (2013-05-03 21:02:25 UTC) #42
commit-bot: I haz the power
Step "update" is always a major failure. Look at the try server FAQ for more ...
7 years, 7 months ago (2013-05-03 21:20:32 UTC) #43
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/felipeg@chromium.org/13907009/111013
7 years, 7 months ago (2013-05-04 04:14:49 UTC) #44
commit-bot: I haz the power
7 years, 7 months ago (2013-05-04 04:53:16 UTC) #45
Message was sent while issue was closed.
Change committed as 198286

Powered by Google App Engine
This is Rietveld 408576698