Closed
Bug 462173
Opened 16 years ago
Closed 16 years ago
We treat transaction errors as fatal when we should not
Categories
(Toolkit :: Storage, defect, P2)
Toolkit
Storage
Tracking
()
RESOLVED
FIXED
mozilla1.9.2a1
People
(Reporter: sdwilsh, Assigned: sdwilsh)
References
Details
(Keywords: fixed1.9.1)
Attachments
(1 file, 1 obsolete file)
2.20 KB,
patch
|
asuth
:
review+
|
Details | Diff | Splinter Review |
For the async statements (note the plural), we open a transaction, and then commit it when we are done. However, it is possible that this returns an error, in which case we can try to handle it (if it is SQLITE_BUSY), or we should rollback. Right now we do neither. We'll need bug 451851 to fix this properly. Requesting blocking because this breaks places pretty badly when it comes up.
Flags: blocking1.9.1?
Comment 1•16 years ago
|
||
Shouldn't ship async statements with a bug like this.
Flags: blocking1.9.1? → blocking1.9.1+
Assignee | ||
Comment 2•16 years ago
|
||
For reviewer reference: http://www.sqlite.org/lang_transaction.html
Assignee | ||
Comment 3•16 years ago
|
||
Attachment #345318 -
Flags: review?(bugmail)
Assignee | ||
Updated•16 years ago
|
Whiteboard: [has patch][needs review asuth]
Comment 4•16 years ago
|
||
Does this really fix places' problem? I would expect that the places badness would be that places has an outstanding SELECT that is still active when the async thread goes to commit its transaction. That transaction commit will fail with SQLITE_ERROR, so no retry attempt will be made and you are hosed for good unless your code starts manually trying to issue a commit/rollback on its own (without a new BEGIN). Change mozilla's sqlite3.c:48348 to SQLITE_BUSY and these changes come into play.
Assignee | ||
Comment 5•16 years ago
|
||
So, as of right now it's safe to retry this if we get SQLITE_ERROR. They may end up changing it so that it will return SQLITE_BUSY. They will investigate this and change (to make sure it doesn't have implications elsewhere) and get back with us. For now, I can change this patch to retry on SQLITE_ERROR
Comment 6•16 years ago
|
||
(In reply to comment #5) > For now, I can change this patch to retry on SQLITE_ERROR Change it to use the logic for rollback too, since rollback can have the same problem happen to it.
Assignee | ||
Comment 7•16 years ago
|
||
I don't think we can fix this without getting a fix for SQLite. There is no way to know what SQLITE_ERROR is recoverable and which are not.
Comment 8•16 years ago
|
||
(In reply to comment #7) > I don't think we can fix this without getting a fix for SQLite. There is no > way to know what SQLITE_ERROR is recoverable and which are not. Well, we could have mozStorageConnection effectively maintain its own activeVdbeCnt; as statements transition to and from executing, they notify the connection. This has the upside that instead of busy-sleep-waiting, the transaction commit could actually block on a proper notification primitive. On the other hand, that's a lot of additional book-keeping overhead. Is there a problem with just changing the one line I called out in mozilla's copy of sqlite until we get the official fix from sqlite command? Granted, we are changing an error return from fatal to non-fatal, but... 1) it's still an error, 2) people could keep retrying regardless of the error code, 3) the error code was as-is is content-free and accordingly not actionable.
Assignee | ||
Comment 9•16 years ago
|
||
We have a strict policy of not making any changes to the sqlite files and only accept official copies of sqlite. This may mean that we end up asking them for a special branch with this fix in it, but it has their qa stamp of approval then.
Assignee | ||
Updated•16 years ago
|
Whiteboard: [has patch][needs review asuth] → [needs new patch]
Assignee | ||
Updated•16 years ago
|
Attachment #345318 -
Attachment is obsolete: true
Attachment #345318 -
Flags: review?(bugmail)
Assignee | ||
Comment 10•16 years ago
|
||
SQLite 3.6.5 has a much better behavior - commits always succeed (they are already on disk anyway), but rollbacks may end up being busy. We can busy wait on rollback since it's a rare condition anyway. That change makes our lives so much easier :)
Target Milestone: mozilla1.9.1b2 → mozilla1.9.1
Assignee | ||
Comment 11•16 years ago
|
||
When we upgrade to a newer SQLite (not 3.6.5 since it crashes in FTS3), I think this is what we'll want.
Attachment #347847 -
Flags: review?(bugmail)
Assignee | ||
Updated•16 years ago
|
Whiteboard: [needs new patch] → [has patch][needs review asuth]
Comment 12•16 years ago
|
||
Comment on attachment 347847 [details] [diff] [review] v2.0 Yes, this all turns out much better/simpler with the new sqlite.
Attachment #347847 -
Flags: review?(bugmail) → review+
Assignee | ||
Updated•16 years ago
|
Whiteboard: [has patch][needs review asuth] → [has patch][has review]
Assignee | ||
Updated•16 years ago
|
Whiteboard: [has patch][has review] → [has patch][has review][can land when m-c opens]
Assignee | ||
Comment 13•16 years ago
|
||
Per blocking rankings, this needs to be fixed by release, but doesn't need to block the proposed beta 3.
Status: NEW → ASSIGNED
Priority: -- → P2
Assignee | ||
Updated•16 years ago
|
Whiteboard: [has patch][has review][can land when m-c opens] → [has patch][has review][can land]
Assignee | ||
Comment 14•16 years ago
|
||
http://hg.mozilla.org/mozilla-central/rev/5384f38dc5e5
Status: ASSIGNED → RESOLVED
Closed: 16 years ago
Resolution: --- → FIXED
Whiteboard: [has patch][has review][can land]
Target Milestone: mozilla1.9.1 → mozilla1.9.2a1
Assignee | ||
Comment 16•16 years ago
|
||
http://hg.mozilla.org/releases/mozilla-1.9.1/rev/3b6c78d8df75
Keywords: fixed1.9.1
Updated•16 years ago
|
Target Milestone: mozilla1.9.2a1 → mozilla1.9.1b3
Updated•16 years ago
|
Target Milestone: mozilla1.9.1b3 → mozilla1.9.2a1
You need to log in
before you can comment on or make changes to this bug.
Description
•