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

Issue 197333009: Handling LevelDB errors encountered after open. (Closed)

Created:
6 years, 9 months ago by cmumford
Modified:
6 years, 8 months ago
CC:
chromium-reviews, jam, alecflett, ericu+idb_chromium.org, joi+watch-content_chromium.org, darin-cc_chromium.org, dgrogan, jsbell+idb_chromium.org
Base URL:
https://chromium.googlesource.com/chromium/src.git@master
Visibility:
Public.

Description

Un-revert Handling LevelDB errors encountered after open. The previous IndexedDB implementation only checked for (and reported) corrupted LevelDB's during open. If they are determined to be corrupted during use then the database was simply closed. The page would be unaware of this, and would likely reopen the database at a later time (which would work) only to fail again during a read/write operation. There was no way for the page to get out of that corrupted state - the user would have to delete all origin data. This change will record the fact that the backing store was corrupted, and during open this would be read and, if present, result in the same dataLoss state being reported to the page in the upgradeneeded event. Also split IndexedDBBackingStore's REPORT_ERROR macro in two: REPORT_ERROR_UNTESTED (which calls NOTREACHED) and REPORT_ERROR. REPORT_ERROR is used for errors which are encountered during tests. This was done so that runtime errors could still be caught during a debug build run. The original change (r260147) had a buffer overrun in a unit test fixed in this CL. BUG=322707 R=isherman@chromium.org, jochen@chromium.org, jsbell@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=260697

Patch Set 1 #

Total comments: 75

Patch Set 2 : Address Josh' comments from file set #1 #

Patch Set 3 : Commented that DestroyBackingStore leaves non LevelDB files alone #

Total comments: 1

Patch Set 4 : Add description for histogram metric. #

Patch Set 5 : Rebased to resolve conflict with trunk #

Patch Set 6 : Resolved upstream conflict #2 #

Patch Set 7 : Added FILE_PATH_LITERAL #

Patch Set 8 : FILE_PATH_LITERAL #2 #

Patch Set 9 : Fixed buffer overflow (woops) in original test #

Total comments: 1

Patch Set 10 : Tweaked comment. #

Patch Set 11 : Reverted two unecessary changes #

Unified diffs Side-by-side diffs Delta from patch set Stats (+593 lines, -118 lines) Patch
M content/browser/indexed_db/indexed_db_backing_store.h View 1 2 3 4 5 6 7 8 9 10 3 chunks +11 lines, -0 lines 0 comments Download
M content/browser/indexed_db/indexed_db_backing_store.cc View 1 2 3 4 5 6 57 chunks +203 lines, -79 lines 0 comments Download
M content/browser/indexed_db/indexed_db_browsertest.cc View 1 2 3 4 5 6 7 8 9 4 chunks +141 lines, -0 lines 0 comments Download
M content/browser/indexed_db/indexed_db_database.cc View 11 chunks +70 lines, -33 lines 0 comments Download
M content/browser/indexed_db/indexed_db_factory.h View 1 chunk +2 lines, -2 lines 0 comments Download
M content/browser/indexed_db/indexed_db_factory.cc View 1 2 2 chunks +19 lines, -0 lines 0 comments Download
M content/browser/indexed_db/leveldb/leveldb_database.h View 1 2 3 4 1 chunk +1 line, -0 lines 0 comments Download
M content/browser/indexed_db/leveldb/leveldb_database.cc View 1 2 3 4 1 chunk +2 lines, -0 lines 0 comments Download
M content/test/data/indexeddb/common.js View 1 1 chunk +6 lines, -0 lines 0 comments Download
A content/test/data/indexeddb/corrupted_open_db_detection.html View 1 1 chunk +114 lines, -0 lines 0 comments Download
A + content/test/data/indexeddb/corrupted_open_db_recovery.html View 3 chunks +21 lines, -4 lines 0 comments Download
M tools/metrics/histograms/histograms.xml View 1 chunk +3 lines, -0 lines 0 comments Download

Messages

Total messages: 39 (0 generated)
cmumford
jsbell@chromium.org: Please review changes in jochen@chromium.org: Please review changes in
6 years, 9 months ago (2014-03-26 02:09:49 UTC) #1
jsbell
https://codereview.chromium.org/197333009/diff/1/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/197333009/diff/1/content/browser/indexed_db/indexed_db_backing_store.cc#newcode50 content/browser/indexed_db/indexed_db_backing_store.cc:50: return ComputeFileName(origin_url).Append("corruption_info.json"); Doesn't this put the file in the ...
6 years, 8 months ago (2014-03-26 18:16:58 UTC) #2
cmumford
https://codereview.chromium.org/197333009/diff/1/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/197333009/diff/1/content/browser/indexed_db/indexed_db_backing_store.cc#newcode50 content/browser/indexed_db/indexed_db_backing_store.cc:50: return ComputeFileName(origin_url).Append("corruption_info.json"); On 2014/03/26 18:16:58, jsbell wrote: > Doesn't ...
6 years, 8 months ago (2014-03-26 21:40:36 UTC) #3
jsbell
https://codereview.chromium.org/197333009/diff/1/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/197333009/diff/1/content/browser/indexed_db/indexed_db_backing_store.cc#newcode597 content/browser/indexed_db/indexed_db_backing_store.cc:597: const IndexedDBDatabaseError& dberror) { On 2014/03/26 21:40:36, cmumford wrote: ...
6 years, 8 months ago (2014-03-26 22:49:00 UTC) #4
cmumford
Josh: I added a comment to IndexedDBFactory::HandleBackingStoreCorruption. I think that was your only request from ...
6 years, 8 months ago (2014-03-27 15:38:02 UTC) #5
jsbell
lgtm
6 years, 8 months ago (2014-03-27 16:03:47 UTC) #6
jsbell
https://codereview.chromium.org/197333009/diff/140001/content/browser/indexed_db/indexed_db_backing_store.cc File content/browser/indexed_db/indexed_db_backing_store.cc (right): https://codereview.chromium.org/197333009/diff/140001/content/browser/indexed_db/indexed_db_backing_store.cc#newcode468 content/browser/indexed_db/indexed_db_backing_store.cc:468: INDEXED_DB_BACKING_STORE_OPEN_FAILED_PRIOR_CORRUPTION, er, not lgtm This needs to be before ...
6 years, 8 months ago (2014-03-27 16:04:49 UTC) #7
jochen (gone - plz use gerrit)
rubberstamp lgtm
6 years, 8 months ago (2014-03-27 16:05:10 UTC) #8
cmumford
On 2014/03/27 16:04:49, jsbell wrote: > https://codereview.chromium.org/197333009/diff/140001/content/browser/indexed_db/indexed_db_backing_store.cc > File content/browser/indexed_db/indexed_db_backing_store.cc (right): > > https://codereview.chromium.org/197333009/diff/140001/content/browser/indexed_db/indexed_db_backing_store.cc#newcode468 > ...
6 years, 8 months ago (2014-03-27 16:19:26 UTC) #9
cmumford
Got this error with last git cl upload: Not uploading the base file for tools/metrics/histograms/histograms.xml ...
6 years, 8 months ago (2014-03-27 16:30:28 UTC) #10
jsbell
The diff is fine, just the side-by-side failed. lgtm isherman@ - histograms review?
6 years, 8 months ago (2014-03-27 16:34:02 UTC) #11
Ilya Sherman
histograms lgtm
6 years, 8 months ago (2014-03-27 20:02:52 UTC) #12
cmumford
The CQ bit was checked by cmumford@chromium.org
6 years, 8 months ago (2014-03-27 20:04:45 UTC) #13
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmumford@chromium.org/197333009/160001
6 years, 8 months ago (2014-03-27 20:05:03 UTC) #14
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-03-27 20:05:32 UTC) #15
commit-bot: I haz the power
Failed to apply patch for content/browser/indexed_db/indexed_db_backing_store.cc: While running patch -p1 --forward --force --no-backup-if-mismatch; patching file ...
6 years, 8 months ago (2014-03-27 20:05:32 UTC) #16
cmumford
The CQ bit was checked by cmumford@chromium.org
6 years, 8 months ago (2014-03-27 20:11:47 UTC) #17
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmumford@chromium.org/197333009/170001
6 years, 8 months ago (2014-03-27 20:12:24 UTC) #18
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-03-27 20:47:09 UTC) #19
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on linux_chromium_chromeos_clang_dbg
6 years, 8 months ago (2014-03-27 20:47:09 UTC) #20
cmumford
The CQ bit was checked by cmumford@chromium.org
6 years, 8 months ago (2014-03-27 21:13:17 UTC) #21
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmumford@chromium.org/197333009/190001
6 years, 8 months ago (2014-03-27 21:17:04 UTC) #22
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-03-27 23:41:53 UTC) #23
commit-bot: I haz the power
Retried try job too often on win_x64_rel for step(s) base_unittests, chrome_elf_unittests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_x64_rel&number=89071
6 years, 8 months ago (2014-03-27 23:41:54 UTC) #24
cmumford
The CQ bit was checked by cmumford@chromium.org
6 years, 8 months ago (2014-03-28 01:06:45 UTC) #25
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmumford@chromium.org/197333009/210001
6 years, 8 months ago (2014-03-28 01:10:21 UTC) #26
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-03-28 01:36:13 UTC) #27
commit-bot: I haz the power
Try jobs failed on following builders: tryserver.chromium on win_chromium_compile_dbg
6 years, 8 months ago (2014-03-28 01:36:14 UTC) #28
cmumford
The CQ bit was checked by cmumford@chromium.org
6 years, 8 months ago (2014-03-28 01:39:20 UTC) #29
commit-bot: I haz the power
CQ is trying da patch. Follow status at https://chromium-status.appspot.com/cq/cmumford@chromium.org/197333009/230001
6 years, 8 months ago (2014-03-28 01:42:11 UTC) #30
commit-bot: I haz the power
The CQ bit was unchecked by commit-bot@chromium.org
6 years, 8 months ago (2014-03-28 03:54:24 UTC) #31
commit-bot: I haz the power
Retried try job too often on win_rel for step(s) interactive_ui_tests http://build.chromium.org/p/tryserver.chromium/buildstatus?builder=win_rel&number=290103
6 years, 8 months ago (2014-03-28 03:54:24 UTC) #32
jsbell
Committed patchset #8 manually as r260147 (presubmit successful).
6 years, 8 months ago (2014-03-28 16:11:10 UTC) #33
jsbell
FYI, reverted due to Mac ASAN failures http://build.chromium.org/p/chromium.memory/builders/Mac%20ASan%20Tests%20%281%29/builds/618/steps/content_browsertests/logs/CorruptedOpenDatabase
6 years, 8 months ago (2014-03-28 18:30:26 UTC) #34
cmumford
The previous bug (caught by Mac ASan), was with fwrite. I didn't realize that it ...
6 years, 8 months ago (2014-03-28 23:20:01 UTC) #35
jsbell
lgtm with nit we should send this through the bots again https://codereview.chromium.org/197333009/diff/250001/content/browser/indexed_db/indexed_db_browsertest.cc File content/browser/indexed_db/indexed_db_browsertest.cc (right): ...
6 years, 8 months ago (2014-03-28 23:36:25 UTC) #36
cmumford
The bots missed this bug the first time. I did manually start the mac_asan test ...
6 years, 8 months ago (2014-03-28 23:55:32 UTC) #37
cmumford
Josh: I manually ran these bots: win_x64_rel, linux_rel, android_dbg_triggered_tests, android_dbg, android_aosp, and mac_asan. Two failed: ...
6 years, 8 months ago (2014-03-31 19:57:25 UTC) #38
jsbell
6 years, 8 months ago (2014-03-31 23:23:59 UTC) #39
Message was sent while issue was closed.
Committed patchset #11 manually as r260697 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698