go-spacemesh
go-spacemesh copied to clipboard
SQLite Concurrent transactions
Motivation
Closes #3195
Changes
create fork of https://github.com/crawshaw/sqlite with C files with BEGIN TRANSACTION implementation and set as dependency for project - https://github.com/spacemeshos/sqlite
Test Plan
unit tests
DevOps Notes
- [x] This PR does not require configuration changes (e.g., environment variables, GitHub secrets, VM resources)
- [x] This PR does not affect public APIs
- [x] This PR does not rely on a new version of external services (PoET, elasticsearch, etc.)
- [x] This PR does not make changes to log messages (which monitoring infrastructure may rely on)
i think we also need a method that makes it easy to use and hides retries. i was thinking something like that:
type WithRetryBusy func(n int) func(opts *TxOptions) {
return ...
}
func (db *Database) WithTxConcurrent(func(db.Executor) error, ...TxOpt) error
func (db *Database) WithTx(func(db.Executor) error, ...TxOpt) error
lets put it on hold. i tend to think that it is premature to merge it without deciding where and why concurrent txs will be used
lets reconsider in the future