Commit Graph

12 Commits

Author SHA1 Message Date
Elle Mouton
c4e6f23c5b multi: add a re-usable TxOptions type
Add a re-usable implementation of the sqldb.TxOptions interface and make
use of this in the various spots (invoices, batch and graph/db) where we
had previously defined individual implementations that were all doing
the same thing.
2025-05-28 10:18:10 +02:00
Elle Mouton
df1e6da94e batch: update to allow for read-only calls
In this commit, we update the batch schedular so that it has the ability
to do read-only calls. It will do a best effort attempt at keeping a
transaction in read-only mode and then if any requests get added to a
batch that require a read-write tx, then the entire batch's tx will be
upgraded to use a read-write tx.
2025-05-22 14:14:43 +02:00
Elle Mouton
e743878bd5 batch: add a benchmark for SQLite and Postgres 2025-05-22 14:14:43 +02:00
Elle Mouton
bb95b0d9b6 batch: add benchmark tests for KVDB batch writes
Here we add a new BenchmarkBoltBatching test that helps us benchmark the
performance when writing to a bbolt backend using various different
configurations. We test using N txs for N writes, 1 tx for N writes and
then various configurations when using the TimeScheduler.
2025-05-22 14:14:43 +02:00
Elle Mouton
f5a466b051 batch+graph: update batch.Schedular to be generic
In preparation for using the same logic for non-bbolt backends, we adapt
the batch.Schedular to be more generic.

The only user of the scheduler at the moment is the KVStore in the
`graph.db` package. This store instantiates the bbolt implementation of
the scheduler.
2025-05-22 14:14:42 +02:00
Elle Mouton
11b27f07da batch: dont expose kvdb.RwTx in batch.SchedulerOptions
Currently, a few of the graph KVStore methods take the
`batch.SchedulerOptions` param. This is only used to set the LazyAdd
option. A SchedulerOption is a functional option that takes a
`batch.Request` which has bolt-specific fields in it. This commit
restructures things a bit such that the `batch.Request` type is no
longer part of the `batch.SchedulerOptions` - this will make it easier
to implement the graph store with a different DB backend.
2025-05-22 14:14:40 +02:00
ziggie
490347b056 multi: update walletdb package 2025-04-09 18:47:53 +02:00
Alex Akselrod
c29fb81d1b batch: handle serialization errors correctly 2024-12-12 10:40:36 -08:00
cuinix
60bc30dd08 remove repetitive words
Signed-off-by: cuinix <915115094@qq.com>
2024-03-07 14:05:47 +08:00
Andras Banki-Horvath
14c851c8fc kvdb: move channeldb/kvdb to top level 2021-05-07 14:18:56 +02:00
Johan T. Halseth
e3b529939e batch: add option for executing requests immediately
We make the default non-lazy, and will make the incoming gossip requests
lazy.
2021-02-10 23:54:02 +01:00
Conner Fromknecht
d1634b5e13 batch: add external batching engine for bbolt operations 2020-11-24 16:38:27 -08:00