Closed Bug 1150608 Opened 5 years ago Closed 5 years ago

Cache API DB schema should use monotonically increasing CacheId values

Categories

(Core :: DOM: Core & HTML, defect)

defect
Not set

Tracking

()

RESOLVED FIXED
mozilla40
Tracking Status
firefox40 --- fixed

People

(Reporter: bkelly, Assigned: bkelly)

References

Details

Attachments

(1 file)

With the current schema the Cache sqlite code can end up reusing the same CacheId values more than once.  This is quite bad since Cache objects can continue to operate in an orphaned state after removal from the DB table.

I believe we can fix this with the AUTOINCREMENT keyword.

My refactor of the Cache code hits this problem reliably, so making this bug block than one.
Attachment #8587590 - Flags: review?(ehsan) → review+
I think we convinced ourselves the original concern in comment 0 is invalid, however the patch is still a nice sanity feature to have.  So landing anyways:

remote:   https://hg.mozilla.org/integration/mozilla-inbound/rev/f33d0f70ab80
Summary: Cache API DB schema can incorrectly reuse CacheId values → Cache API DB schema should use monotonically increasing CacheId values
https://hg.mozilla.org/mozilla-central/rev/f33d0f70ab80
Status: ASSIGNED → RESOLVED
Closed: 5 years ago
Resolution: --- → FIXED
Target Milestone: --- → mozilla40
Component: DOM → DOM: Core & HTML
You need to log in before you can comment on or make changes to this bug.