Commit Graph

10673 Commits

Author SHA1 Message Date
Jussi Saurio
88856de48e fmt 2025-09-15 11:33:15 +03:00
Jussi Saurio
f2dbf1eeb0 add test demonstrating that issue 3084 can be closed 2025-09-15 11:32:39 +03:00
Jussi Saurio
d643bb2092 add test that demonstrates issue 3083 can be closed 2025-09-15 11:30:56 +03:00
Jussi Saurio
59f18e2dc8 fix mvcc update
simple reason why mvcc update didn't work: it didn't try to update.
2025-09-15 11:27:56 +03:00
Pekka Enberg
54c79b879b Merge 'mvcc: fix two sources of panic' from Jussi Saurio
1. commit state machine was assuming that begin_write_tx() cannot fail,
but it can fail if there is another tx that is not using BEGIN
CONCURRENT.
2. if a brand new non-CONCURRENT transaction attempts to start exclusive
transaction but fails with Busy, we must end the read pager read tx it
just started, because otherwise the next time it attempts to do
something it will panic with: `"cannot start a new read tx without
ending an existing one"`

Closes #3125
2025-09-15 11:26:05 +03:00
Jussi Saurio
aa7a853cd2 mvcc: fix hang when CONCURRENT tx tries to commit and non-CONCURRENT tx is active 2025-09-15 11:09:19 +03:00
Jussi Saurio
9234ef86ae mvcc: fix two sources of panic
1. commit state machine was assuming that begin_write_tx() cannot
fail, but it can fail if there is another tx that is not using
BEGIN CONCURRENT.

2. if a brand new non-CONCURRENT transaction attempts to start
exclusive transaction but fails with Busy, we must end the read
pager read tx it just started, because otherwise the next time
it attempts to do something it will panic with:

"cannot start a new read tx without ending an existing one"
2025-09-15 10:59:44 +03:00
Nikita Sivukhin
3bcac441e4 reduce log level of some very frequent logs 2025-09-15 11:35:41 +04:00
Pekka Enberg
eb3f17a0a9 Merge 'Fix MVCC rollback' from Jussi Saurio
Closes #3119
Closes #3121
executing ROLLBACK did not rollback the mv-store transaction

Closes #3123
2025-09-15 10:05:59 +03:00
Nikita Sivukhin
9b5656d4dc fix stats method 2025-09-15 11:05:49 +04:00
Nikita Sivukhin
23e8204bfc yarn build 2025-09-15 10:57:03 +04:00
Nikita Sivukhin
e8b076ebe5 export SyncEngineStats type 2025-09-15 10:56:44 +04:00
Nikita Sivukhin
527d0cb1f3 expose revision in the stats method 2025-09-15 10:56:13 +04:00
Nikita Sivukhin
ebf042cf6b refine error message 2025-09-15 10:55:43 +04:00
Nikita Sivukhin
aa65c910bf fix sync-browser bug and add more tests 2025-09-15 10:55:01 +04:00
Jussi Saurio
8f43741513 fix mvcc rollback
executing ROLLBACK did not rollback the mv-store transaction
2025-09-15 09:29:08 +03:00
Jussi Saurio
0e7eecc7a1 Merge 'test/fuzz: improve maintainability/usability of tx isolation test' from Jussi Saurio
**test/fuzz: introduce fuzzoptions to tx isolation test**
this makes it significantly easier to tweak the tx isolation test
parameters, and also makes it much easier to run the MVCC version of the
test without manually tweaking code inline to make it work.
introduces default options for the non-mvcc and mvcc test variants.
---
**test/fuzz: improve error handling in tx isolation fuzz test**
- extract out common behavior for checking acceptable errors
- add functionality to check which errors require rolling back
  a transaction

Closes #3118
2025-09-15 09:21:49 +03:00
pedrocarlo
bd5dcd8d3c add timeout flag to throughput benchmark 2025-09-15 02:20:32 -03:00
pedrocarlo
3d265489dc modify semantics of busy_timeout to be more on par with sqlite 2025-09-15 02:20:32 -03:00
pedrocarlo
0586b75fbe expose function to set busy timeout duration 2025-09-15 02:20:32 -03:00
Pekka Enberg
246799c603 Fix simulator and Antithesis Docker images 2025-09-15 08:16:38 +03:00
pedrocarlo
16e79ed508 slight adjustment in perf throughtput printing 2025-09-15 02:16:18 -03:00
pedrocarlo
a56680f79e implement Busy Handler in Turso statements 2025-09-15 02:16:18 -03:00
Jussi Saurio
f2079d8f07 test/fuzz: improve error handling in tx isolation fuzz test
- extract out common behavior for checking acceptable errors
- add functionality to check which errors require rolling back
  a transaction
2025-09-15 08:03:08 +03:00
Jussi Saurio
1c5febf047 test/fuzz: introduce fuzzoptions to tx isolation test
this makes it significantly easier to tweak the tx isolation test parameters,
and also makes it much easier to run the MVCC version of the test without
manually tweaking code inline to make it work.

introduces default options for the non-mvcc and mvcc test variants.
2025-09-15 07:44:16 +03:00
Pekka Enberg
24c50597ad Merge 'Random fixes for MVCC' from Jussi Saurio
based on #3110
closes #3111
closes #3113
closes #3114
all discovered using `test_multiple_connections_fuzz_mvcc`, so no
separate tests. i can add regression unit/integration tests tomorrow
    mvcc: properly remove mutations of rolled back tx
    mvstore was not removing deletions made by a tx that rolled back.
    deletions are removed by clearing the `end` mark from the row
    version.
---
    mvcc: properly clear tx states when mvcc tx rolls back
---
    mvcc: don't double-rollback on write-write-conflict
    handle_program_error() already rolls back if this error happens.
    double rollback causes a crash.

Closes #3115
2025-09-15 07:39:35 +03:00
Pekka Enberg
27d4572c2e Merge 'mvcc: Complete commit state machine early if write set is empty' from Jussi Saurio
Closes #3104
2025-09-15 07:38:28 +03:00
pedrocarlo
cc48fa233b add perf/throughput/rusqlite to workspace 2025-09-14 18:29:03 -03:00
Jussi Saurio
f4c15a37d3 add manual hack to mvcc test
we rollback the mvcc transaction in the VDBE, so manually roll it
back in the test
2025-09-14 23:46:38 +03:00
Jussi Saurio
db3428a7a9 remove unused pager parameter 2025-09-14 23:44:24 +03:00
Jussi Saurio
d598775e33 mvcc: properly remove mutations of rolled back tx
mvstore was not removing deletions made by a tx that rolled back.
deletions are removed by clearing the `end` mark from the row
version.
2025-09-14 23:29:14 +03:00
Jussi Saurio
dccf8b9472 mvcc: properly clear tx states when mvcc tx rolls back 2025-09-14 23:29:07 +03:00
Jussi Saurio
487b8710d9 mvcc: don't double-rollback on write-write-conflict
handle_program_error() already rolls back if this error happens.
double rollback causes a crash.
2025-09-14 23:28:21 +03:00
Jussi Saurio
8510721c5e Merge 'add perf/throughput/turso to workspace' from Pedro Muniz
Closes #3102
2025-09-14 22:30:49 +03:00
Jussi Saurio
2ca1640a2a not always write 2025-09-14 22:24:07 +03:00
pedrocarlo
01a99f84a6 add perf/throughput/turso to workspace 2025-09-14 16:19:34 -03:00
Jussi Saurio
396091044e store tx_mode in conn.mv_tx
otherwise op_transaction works completely wrong because each separate
insert statement overrides the tx_mode to Write
2025-09-14 21:59:08 +03:00
Jussi Saurio
7fe25a1d0e mvcc: remove conn.mv_transactions
afaict this isn't needed for anything since there is already
conn.mv_tx_id
2025-09-14 21:26:58 +03:00
Jussi Saurio
5feb9ea2f0 mvcc: fix non-concurrent transaction semantics
on the main branch, mvcc allows concurrent inserts from multiple
txns even without BEGIN CONCURRENT, and then always hangs whenever
one of the txns tries to commit.

this commit fixes that issue.
2025-09-14 21:23:06 +03:00
Avinash Sajjanshetty
25d4070d3b avoid unnecessary cloning when formatting Txn for Display 2025-09-14 23:14:47 +05:30
Avinash Sajjanshetty
62770033c3 Add a simple test for txn::Display 2025-09-14 23:14:46 +05:30
Jussi Saurio
2ea1798d6e mvcc: end commit state machine early when write set is empty 2025-09-14 20:02:35 +03:00
Pekka Enberg
bc4aa63203 Merge 'make whopper run with checksums' from Avinash Sajjanshetty
pass `--enable-checksums` to either `run` or `explore` commands

Closes #3100
2025-09-14 18:26:12 +03:00
Pekka Enberg
76a3c20a48 Merge 'perf/throughput/turso: Don't use spawn_blocking()' from Pekka Enberg
Let's just use normal spawn()

Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #3096
2025-09-14 17:55:44 +03:00
Pekka Enberg
3273d78969 Merge 'Whopper + MVCC' from Pekka Enberg
Reviewed-by: Avinash Sajjanshetty (@avinassh)

Closes #3097
2025-09-14 17:55:25 +03:00
PThorpe92
703cb4a70f Link all writes to the fsync barrier, not just the commit frame 2025-09-14 10:39:52 -04:00
Avinash Sajjanshetty
d35789690e make whopper run with checksums
pass `--enable-checksums` to either `run` or `explore` commands
2025-09-14 20:08:34 +05:30
PThorpe92
71c139a2d4 Yet again fix state machine in commit_dirty_pages 2025-09-14 09:19:45 -04:00
PThorpe92
a7519ab47a Fix commit dirty pages state machine 2025-09-14 09:17:43 -04:00
PThorpe92
460a8e9821 Add target dir to .gitignore for perf subdirectories 2025-09-14 09:17:43 -04:00