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

Issue 2384893002: PVer4: Test checksum on startup outside the hotpath of DB load (Closed)

Created:
4 years, 2 months ago by vakh (use Gerrit instead)
Modified:
4 years, 2 months ago
CC:
chromium-reviews, woz, noé
Target Ref:
refs/pending/heads/master
Project:
chromium
Visibility:
Public.

Description

PVer4: Test checksum on startup outside the hotpath of DB load On startup, when MergeUpdate is called, the old_prefixes_map is empty. When we detect this case, we shortcut the merge process. * Instead of merging the hash prefixes in lexicographical order, one by one, we copy the additions_map into the hash_prefix_map_. * Then, instead of checking the checksum at this time, we post a task to the task runner to verify the checksum. When that task runs, if the checksum matches, it returns silently; otherwise, it clears out the state and the hash_prefix_map_ of the store. This reduces the merge time for Malware and SocialEngineering lists by about 5 seconds total on my machine and brings the DB load time to <1s from 12s previously. BUG=651911, 543161 Committed: https://crrev.com/cb8c22f7ca3eedb7e207149f1f75c90c3e6a748b Cr-Commit-Position: refs/heads/master@{#424189}

Patch Set 1 #

Total comments: 15

Patch Set 2 : Log UMA metrics per store and total using base_metric and suffixes #

Patch Set 3 : Reset on IO thread #

Patch Set 4 : VerifyChecksum->VerifyChecksumDelayed #

Patch Set 5 : Remove all histogram related changes. That would be a separate CL #

Total comments: 6

Patch Set 6 : DB posts a VerifyChecksum task for itself. Enables update manager after checking checksum. #

Patch Set 7 : go: design-doc-v4store-verifychecksum -- VerifyChecksum in a way that avoids race conditions betwee… #

Total comments: 1

Patch Set 8 : Tests mimic the thread-related operations of product code. Tests pass #

Patch Set 9 : Minor: Rebase and s/base::MessageLoop::current()->task_runner()/base::ThreadTaskRunnerHandle::Get() #

Patch Set 10 : Minor: Formatting #

Total comments: 18

Patch Set 11 : shess@ feedback #

Total comments: 26

Patch Set 12 : nparker@ feedback, add test for VerifyChecksum == true, possibly fix the asan failures #

Patch Set 13 : surely fix the asan failures. fixed on my machine, at least. #

Patch Set 14 : Verify that the checksum check happens async #

Unified diffs Side-by-side diffs Delta from patch set Stats (+379 lines, -127 lines) Patch
M components/safe_browsing_db/v4_database.h View 1 2 3 4 5 6 7 8 9 10 11 3 chunks +24 lines, -2 lines 0 comments Download
M components/safe_browsing_db/v4_database.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +36 lines, -13 lines 0 comments Download
M components/safe_browsing_db/v4_database_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 13 17 chunks +51 lines, -56 lines 0 comments Download
M components/safe_browsing_db/v4_local_database_manager.h View 1 2 3 4 5 6 7 8 9 10 1 chunk +9 lines, -2 lines 0 comments Download
M components/safe_browsing_db/v4_local_database_manager.cc View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +20 lines, -5 lines 0 comments Download
M components/safe_browsing_db/v4_local_database_manager_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 12 9 chunks +76 lines, -23 lines 0 comments Download
M components/safe_browsing_db/v4_store.h View 1 2 3 4 5 6 7 8 9 10 11 4 chunks +18 lines, -4 lines 0 comments Download
M components/safe_browsing_db/v4_store.cc View 1 2 3 4 5 6 7 8 9 10 11 12 chunks +98 lines, -22 lines 0 comments Download
M components/safe_browsing_db/v4_store_unittest.cc View 1 2 3 4 5 6 7 8 9 10 11 2 chunks +47 lines, -0 lines 0 comments Download

Dependent Patchsets:

Messages

Total messages: 84 (53 generated)
Nathan Parker
(out-of-character code review on the weekend since I'm out Monday...) https://codereview.chromium.org/2384893002/diff/1/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2384893002/diff/1/components/safe_browsing_db/v4_store.cc#newcode133 ...
4 years, 2 months ago (2016-10-03 02:26:49 UTC) #7
vakh (use Gerrit instead)
Log UMA metrics per store and total using base_metric and suffixes
4 years, 2 months ago (2016-10-04 00:12:15 UTC) #8
vakh (use Gerrit instead)
Reset on IO thread
4 years, 2 months ago (2016-10-04 07:05:47 UTC) #13
vakh (use Gerrit instead)
VerifyChecksum->VerifyChecksumDelayed
4 years, 2 months ago (2016-10-04 07:14:07 UTC) #16
vakh (use Gerrit instead)
https://codereview.chromium.org/2384893002/diff/1/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2384893002/diff/1/components/safe_browsing_db/v4_store.cc#newcode133 components/safe_browsing_db/v4_store.cc:133: hash_prefix_map_.clear(); On 2016/10/03 02:26:49, Nathan Parker wrote: > This ...
4 years, 2 months ago (2016-10-04 07:14:39 UTC) #19
vakh (use Gerrit instead)
Remove all histogram related changes. That would be a separate CL
4 years, 2 months ago (2016-10-04 20:31:12 UTC) #23
vakh (use Gerrit instead)
4 years, 2 months ago (2016-10-04 20:32:47 UTC) #27
vakh (use Gerrit instead)
https://codereview.chromium.org/2384893002/diff/1/components/safe_browsing_db/v4_store.cc File components/safe_browsing_db/v4_store.cc (right): https://codereview.chromium.org/2384893002/diff/1/components/safe_browsing_db/v4_store.cc#newcode233 components/safe_browsing_db/v4_store.cc:233: RecordMergeUpdateTime(after - before); On 2016/10/04 07:14:39, vakh (Varun Khaneja) ...
4 years, 2 months ago (2016-10-04 20:34:50 UTC) #28
Scott Hess - ex-Googler
https://codereview.chromium.org/2384893002/diff/80001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/2384893002/diff/80001/components/safe_browsing_db/v4_database.cc#newcode160 components/safe_browsing_db/v4_database.cc:160: return true; Does this leave any implementations which can ...
4 years, 2 months ago (2016-10-05 04:42:13 UTC) #31
vakh (use Gerrit instead)
DB posts a VerifyChecksum task for itself. Enables update manager after checking checksum.
4 years, 2 months ago (2016-10-05 18:56:34 UTC) #32
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2384893002/100001
4 years, 2 months ago (2016-10-05 18:57:22 UTC) #35
commit-bot: I haz the power
No L-G-T-M from a valid reviewer yet. CQ run can only be started by full ...
4 years, 2 months ago (2016-10-05 18:57:24 UTC) #37
vakh (use Gerrit instead)
https://codereview.chromium.org/2384893002/diff/80001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/2384893002/diff/80001/components/safe_browsing_db/v4_database.cc#newcode160 components/safe_browsing_db/v4_database.cc:160: return true; On 2016/10/05 04:42:13, Scott Hess wrote: > ...
4 years, 2 months ago (2016-10-05 23:49:32 UTC) #38
vakh (use Gerrit instead)
go: design-doc-v4store-verifychecksum -- VerifyChecksum in a way that avoids race conditions between the task runner ...
4 years, 2 months ago (2016-10-06 06:46:33 UTC) #39
vakh (use Gerrit instead)
Tests mimic the thread-related operations of product code. Tests pass
4 years, 2 months ago (2016-10-06 20:12:50 UTC) #40
vakh (use Gerrit instead)
Minor: Rebase and s/base::MessageLoop::current()->task_runner()/base::ThreadTaskRunnerHandle::Get()
4 years, 2 months ago (2016-10-06 21:36:34 UTC) #45
vakh (use Gerrit instead)
https://codereview.chromium.org/2384893002/diff/120001/components/safe_browsing_db/v4_database.h File components/safe_browsing_db/v4_database.h (right): https://codereview.chromium.org/2384893002/diff/120001/components/safe_browsing_db/v4_database.h#newcode134 components/safe_browsing_db/v4_database.h:134: // |db_ready_for_updates_callback| TODO: format
4 years, 2 months ago (2016-10-06 21:45:21 UTC) #48
vakh (use Gerrit instead)
Minor: Formatting
4 years, 2 months ago (2016-10-06 21:45:44 UTC) #49
vakh (use Gerrit instead)
Nathan, Scott: Please take another look. I've updated the code to follow the design doc ...
4 years, 2 months ago (2016-10-06 21:47:56 UTC) #52
Scott Hess - ex-Googler
https://codereview.chromium.org/2384893002/diff/180001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/2384893002/diff/180001/components/safe_browsing_db/v4_database.cc#newcode187 components/safe_browsing_db/v4_database.cc:187: store_pair->second->Reset(); Is there any possibility that the second of ...
4 years, 2 months ago (2016-10-06 23:04:10 UTC) #53
vakh (use Gerrit instead)
shess@ feedback
4 years, 2 months ago (2016-10-07 00:39:44 UTC) #56
vakh (use Gerrit instead)
Thanks for the review. PTAL. https://codereview.chromium.org/2384893002/diff/180001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc (right): https://codereview.chromium.org/2384893002/diff/180001/components/safe_browsing_db/v4_database.cc#newcode187 components/safe_browsing_db/v4_database.cc:187: store_pair->second->Reset(); On 2016/10/06 23:04:10, ...
4 years, 2 months ago (2016-10-07 00:39:45 UTC) #57
Scott Hess - ex-Googler
Hmm. I don't see any concerns not addressed, so sounds like LGTM then! https://codereview.chromium.org/2384893002/diff/180001/components/safe_browsing_db/v4_database.cc File ...
4 years, 2 months ago (2016-10-07 13:31:09 UTC) #62
Nathan Parker
Is there a test that verifies the VerifyChecksum's are run later on startup? If so ...
4 years, 2 months ago (2016-10-07 23:24:29 UTC) #63
vakh (use Gerrit instead)
nparker@ feedback, add test for VerifyChecksum == true, possibly fix the asan failures
4 years, 2 months ago (2016-10-09 09:25:25 UTC) #64
vakh (use Gerrit instead)
surely fix the asan failures. fixed on my machine, at least.
4 years, 2 months ago (2016-10-09 12:22:49 UTC) #69
vakh (use Gerrit instead)
Verify that the checksum check happens async
4 years, 2 months ago (2016-10-10 17:41:15 UTC) #74
vakh (use Gerrit instead)
Also added a test to ensure that the checksum check happens async. https://codereview.chromium.org/2384893002/diff/200001/components/safe_browsing_db/v4_database.cc File components/safe_browsing_db/v4_database.cc ...
4 years, 2 months ago (2016-10-10 17:42:34 UTC) #77
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-cq-status.appspot.com/v2/patch-status/codereview.chromium.org/2384893002/260001
4 years, 2 months ago (2016-10-10 17:43:02 UTC) #80
commit-bot: I haz the power
Committed patchset #14 (id:260001)
4 years, 2 months ago (2016-10-10 18:26:44 UTC) #82
commit-bot: I haz the power
4 years, 2 months ago (2016-10-10 18:29:24 UTC) #84
Message was sent while issue was closed.
Patchset 14 (id:??) landed as
https://crrev.com/cb8c22f7ca3eedb7e207149f1f75c90c3e6a748b
Cr-Commit-Position: refs/heads/master@{#424189}

Powered by Google App Engine
This is Rietveld 408576698