Bug 153382

Summary: Modern IDB: SQLite backend needs to support simultaneous transactions
Product: WebKit Reporter: Brady Eidson <beidson>
Component: WebCore Misc.Assignee: Brady Eidson <beidson>
Status: ASSIGNED ---    
Severity: Normal CC: achristensen, alecflett, buildbot, commit-queue, jsbell, rniwa
Priority: P2    
Version: Safari 9   
Hardware: Unspecified   
OS: Unspecified   
Bug Depends on: 149117, 153021    
Bug Blocks: 165889    
Attachments:
Description Flags
Current WIP for revisiting later
buildbot: commit-queue-
Archive of layout-test-results from ews113 for mac-yosemite
none
Archive of layout-test-results from ews101 for mac-yosemite none

Description Brady Eidson 2016-01-22 16:45:56 PST
Modern IDB: SQLite backend needs to support simultaneous transactions

During development they're being disabled (https://bugs.webkit.org/show_bug.cgi?id=153381), but we'll need to re-work the SQLiteIDBTransaction model to support more than one.
Comment 1 Brady Eidson 2016-02-03 10:13:16 PST
My planned approach here was to:
1 - Have read-only transactions not actually backed by a SQLiteTransaction
2 - Allow only one writing transaction at a time
3 - Have the writing transaction open a new connection to the SQLiteDatabase, with a begin/end transaction around the write.

I started implementing this but quickly ran into the problem of when the write transaction was finally in progress, the database file was locked and therefore the read-only transactions started throwing "database locked" errors.

I *THINK* there's supposed to be a way around this with some mix of SQLite arguments (Making sure to use WAL mode along with some specific locking modes), but I am going to put this on the back burner for now.

Having "one transaction at a time" gives us parity with Legacy IDB, but Modern IDB is still way-way-way better in every *other* way, so this is not a regression.

Attaching my current patch to maybe revisit later.
Comment 2 Brady Eidson 2016-02-03 10:14:04 PST
Created attachment 270584 [details]
Current WIP for revisiting later
Comment 3 Brady Eidson 2016-02-18 10:43:24 PST
Since we're already at parity with Legacy IDB, and improving this might be difficult, I'm inverting the blocking relationships such that this is blocked by the feature bug, meaning we can revisit it once we're feature complete.
Comment 4 Build Bot 2016-02-18 11:12:15 PST
Comment on attachment 270584 [details]
Current WIP for revisiting later

Attachment 270584 [details] did not pass mac-debug-ews (mac):
Output: http://webkit-queues.webkit.org/results/850696

Number of test failures exceeded the failure limit.
Comment 5 Build Bot 2016-02-18 11:12:19 PST
Created attachment 271675 [details]
Archive of layout-test-results from ews113 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-debug-ews.
Bot: ews113  Port: mac-yosemite  Platform: Mac OS X 10.10.5
Comment 6 Build Bot 2016-02-18 11:18:35 PST
Comment on attachment 270584 [details]
Current WIP for revisiting later

Attachment 270584 [details] did not pass mac-ews (mac):
Output: http://webkit-queues.webkit.org/results/850732

Number of test failures exceeded the failure limit.
Comment 7 Build Bot 2016-02-18 11:18:39 PST
Created attachment 271676 [details]
Archive of layout-test-results from ews101 for mac-yosemite

The attached test failures were seen while running run-webkit-tests on the mac-ews.
Bot: ews101  Port: mac-yosemite  Platform: Mac OS X 10.10.5