-
Notifications
You must be signed in to change notification settings - Fork 1.8k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Address problems in concurrent sqlite access (#10706)
* Use BEGIN IMMEDIATE to start transactions This makes it so all transactions grab a write lock rather than a read lock that can be upgraded in case of a write; in case of multiple writers (which, in our case, can only happen during a restart as the new process reopens the same sqlite database) this will prevent two transactions from attempting to upgrade their lock, which would cause a SQLITE_BUSY error in one of them. In regular operation this shouldn't cause a performance hit, as we're using a single connection to the sqlite database (guarded by locks in the go side) anyway. * Escape path in sqlite connection URL This makes it so that the sqlite backend supports paths with ? in them. * Close process storage on TeleportProcess shutdown This aligns the behavior of Shutdown with that of Close. * Allow specifying the journal mode in sqlite This will let sqlite backend users specify WAL mode in their config file, and will allow us to specify alternate journal modes for our on-disk caches in the future. This also removes sqlite memory mode, as it's not used anywhere because of its poor query performance compared to our in-memory backend, and cleans up a bit of old cruft, and runs process storage in FULL sync mode - it's very seldom written to and holds important data.
- Loading branch information
1 parent
0d18409
commit cef6a9f
Showing
4 changed files
with
126 additions
and
176 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.