-
Notifications
You must be signed in to change notification settings - Fork 2.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
sqlite: set connection attributes on open #17867
Conversation
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: vrothberg The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
The symptoms in containers#17859 indicate that setting the PRAGMAs in individual EXECs outside of a transaction can lead to concurrency issues and failures when the DB is locked. Hence set all PRAGMAs when opening the connection. Move them into individual constants to improve documentation and readability. Further make transactions exclusive as containers#17859 also mentions an error that the DB is locked during a transaction. [NO NEW TESTS NEEDED] - existing tests cover the code. Fixes: containers#17859 Signed-off-by: Valentin Rothberg <[email protected]>
LGTM |
@mheon PTAL |
Yes, I did not tackle #17858 in this PR.
That is good news, thanks! |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
The string "database is locked" does not appear in any of the logs for the abovementioned CI run of #17831. (Two systest failures, both expected). (And, two "UNIQUE constraint" failures, and I know this PR did not set out to fix that, but I had this fantasy that the bugs were related and could be 2birds1stoned...)
Anyhow, LGTM |
Those numbers are really great to have, thanks, Ed! @baude, we can leverage Ed's timing tracking for the upcoming performance massages. |
@vrothberg PTAL at #17874 - I think we can avoid transaction exclusivity |
Why open a new PR that conflicts with this one? Seems like a time waste. |
OK, we had a quick chat and greed to mix the two PRs together. This PR gets rid of the multiple EXECs setting the PRAGMAs which is flaking. An open question is what setting max connections does in comparison to making transactions exclusive. I assumed that transactions (i.e., writes) must be exclusive. But I am buried in meeting til the end of my workday and let @mheon take over :) |
Pulled it into my PR, closing this now |
The symptoms in #17859 indicate that setting the PRAGMAs in individual EXECs outside of a transaction can lead to concurrency issues and failures when the DB is locked. Hence set all PRAGMAs when opening the connection. Move them into individual constants to improve documentation and readability.
Further make transactions exclusive as #17859 also mentions an error that the DB is locked during a transaction.
Fixes: #17859
Does this PR introduce a user-facing change?
@mheon @baude @edsantiago PTAL