go-spacemesh icon indicating copy to clipboard operation
go-spacemesh copied to clipboard

SQLite Concurrent transactions

Open abergasov opened this issue 2 years ago • 2 comments

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)

abergasov avatar Jun 14 '22 10:06 abergasov

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  

dshulyak avatar Jun 16 '22 06:06 dshulyak

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

dshulyak avatar Jun 21 '22 07:06 dshulyak

lets reconsider in the future

dshulyak avatar Mar 24 '23 09:03 dshulyak