Pere Diaz Bou
bc05497d99
core/mvcc: implement CursorTrait on MVCC cursor
2025-10-13 19:26:18 +02:00
Pekka Enberg
4af61d8049
Merge 'core/btree: try to introduce trait for cursors' from Pere Diaz Bou
...
I've added a trait called `CursorTrait`. I know it's not a good name for
now, but I didn't know what tto change then enum `Cursor` to. This trait
wraps all common functionality, and some functionality that is yet too
specific that needs to be fixed.
This is needed in order to have layered cursors where for example,
MvccCursor will need a fallback BTreeCursor.
Closes #3660
2025-10-10 19:25:39 +03:00
Pere Diaz Bou
160a84250e
core: add CursorTrait imports where needed
2025-10-10 15:04:15 +02:00
Pere Diaz Bou
f06ee571be
Merge 'MVCC: Don't modify the row version chain on rollback' from Duy Dang
...
Rollback shouldn't modify the row version chain. This is crucial for
implementing a Non-blocking row version chain in #3499
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com >
Closes #3583
2025-10-08 18:00:02 +02:00
Duy Dang
4fe3282d8e
Fix missing let from merge
2025-10-08 21:06:13 +07:00
Duy Dang
f7b3033a09
Merge branch 'main' into rollback-fix
2025-10-08 20:56:54 +07:00
Pekka Enberg
94c343770d
mvcc: Disable automatic checkpointing by default
...
MVCC checkpointing currently prevents concurrent writes so disable it by
default while we work on it.
2025-10-08 09:14:55 +03:00
Levy A.
cf53ecb7e3
refactor: remove TextRef and RawSlice and fix tests
2025-10-07 10:43:45 -03:00
Levy A.
77a412f6af
refactor: remove unsafe reference semantics from RefValue
...
also renames `RefValue` to `ValueRef`, to align with rusqlite and other
crates
2025-10-07 10:43:44 -03:00
Duy Dang
1c4a54a73c
Add comment explaining the 0 for infinity timestamp
2025-10-07 19:46:26 +07:00
Pekka Enberg
b98c4ece0d
Merge 'core/mvcc/logical-log: switch RwLock to parking_lot' from Pere Diaz Bou
...
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com >
Closes #3615
2025-10-07 13:43:39 +03:00
Pere Diaz Bou
3e508a4b42
core/io: remove new_dummy in place of new_yield
...
Yield is a completion that does not allocate any inner state. By design
it is completed from the start and has no errors. This allows lightly
yield without allocating any locks nor heap allocate inner state.
2025-10-07 12:00:33 +02:00
Pere Diaz Bou
44152f11d0
core/mvcc/logical-log: switch RwLock to parking_lot
2025-10-07 11:15:48 +02:00
Pekka Enberg
a72b07e949
Merge 'Fix VDBE program abort' from Nikita Sivukhin
...
This PR add proper program abort in case of unfinished statement reset
and interruption.
Also, this PR makes rollback methods non-failing because otherwise of
their callers usually unclear (if rollback failed - what is the state of
statement/connection/transaction?)
Reviewed-by: Preston Thorpe <preston@turso.tech >
Closes #3591
2025-10-07 09:07:07 +03:00
bit-aloo
66c69461fb
Add getter/setter for checkpoint threshold in LogicalLog
...
Wire threshold access through Storage
Add checkpoint threshold accessors to MvStore
2025-10-07 10:17:04 +05:30
Duy Dang
26a3e069fb
Fix missing row versions to checkpoint
2025-10-07 01:11:46 +07:00
Pekka Enberg
f8bdc02986
Merge 'Rename Completion methods' from Pedro Muniz
...
Reviewed-by: bit-aloo (@Shourya742)
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com >
Closes #3579
2025-10-06 20:12:21 +03:00
Pere Diaz Bou
59c08c1062
Merge 'core/mvcc: implement PartialOrd for RowId' from Pere Diaz Bou
...
Closes #3597
2025-10-06 16:42:04 +02:00
pedrocarlo
5a7390735d
rename Completion functions
2025-10-06 11:07:06 -03:00
Nikita Sivukhin
e2f7310617
add explicit tracker for Txn cleanup necessary for statement
2025-10-06 17:51:43 +04:00
Pekka Enberg
41d909e1fb
Merge 'MVCC: do checkpoint writes in ascending order of rowid' from Jussi Saurio
...
For insert-heavy checkpoints this gives a much higher chance of using
the balance-quick subalgorithm instead of the more complex and slower
balance-nonroot.
Closes #3589
2025-10-06 16:30:19 +03:00
Pere Diaz Bou
aed255d2e6
core/mvcc: implement PartialOrd for RowId
2025-10-06 13:43:42 +02:00
Pere Diaz Bou
fc7e1639a0
core/mvcc: filter out seek results where is not same table_id
2025-10-06 13:29:10 +02:00
Pere Diaz Bou
b9b9831d17
core/mvcc: test seek with empty table
2025-10-06 13:28:51 +02:00
Nikita Sivukhin
8dae601fac
make rollback non-failing method
2025-10-06 13:21:45 +04:00
Nikita Sivukhin
38d2630969
remove unnecessary SchemaLocked error
...
- lock() return error in case when another thread panicked while holding the same lock
- we better to just panic too in any such case
2025-10-06 12:15:15 +04:00
Jussi Saurio
fd9008f123
MVCC: do checkpoint writes in ascending order of rowid
...
For insert-heavy checkpoints this gives a much higher chance of using
the balance-quick subalgorithm instead of the more complex and slower
balance-nonroot.
2025-10-06 10:11:19 +03:00
Duy Dang
c57567d776
Adopt Hekaton solution for rollback tx
2025-10-05 23:51:50 +07:00
Pere Diaz Bou
e3f2bbf90b
core/mvcc: remove unnecessary fields in CommitState::Checkpoint
2025-10-03 22:27:03 +02:00
Pere Diaz Bou
c612a51df7
fmt
2025-10-03 22:24:38 +02:00
Pere Diaz Bou
8e80af7221
core/mvcc: checkpoint if needed after commit
2025-10-03 22:24:38 +02:00
Pere Diaz Bou
a30c95d988
core/mvcc/logical-log: add threshold for checkpoints in logical log
2025-10-03 22:24:33 +02:00
Pere Diaz Bou
55f5cd2ad7
core/mvcc/logical-log: test automatic checkpoint
2025-10-03 17:23:59 +02:00
Pere Diaz Bou
7db5a09005
core/mvcc/logical-log: checkpoint support not updating transaction_state if needed
2025-10-03 17:23:35 +02:00
Pekka Enberg
297aaf4887
core/mvcc: Rename "-lg" to "-log"
...
The "lg" name is just weird.
2025-10-03 10:08:02 +03:00
pedrocarlo
131a5b8048
adjust logical log IO functions to return Completions and not IOResult
2025-10-03 01:44:41 -03:00
Jussi Saurio
9e4ea6ea34
Merge 'core/mvcc/logical-log: fail in read_more_data if couldn't read enough' from Pere Diaz Bou
...
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com >
Closes #3500
2025-10-02 06:58:28 +03:00
Jussi Saurio
bb4e54ca73
Merge 'fix/mvcc: deserialize table_id as i64' from Jussi Saurio
...
Reviewed-by: Nikita Sivukhin (@sivukhin)
Closes #3492
2025-10-02 06:58:01 +03:00
Pere Diaz Bou
b89df44339
fmt
2025-10-01 14:31:30 +02:00
Pere Diaz Bou
dc0245d758
core/mvcc/logical-log: fail in read_more_data if couldn't read enough
2025-10-01 14:25:22 +02:00
Jussi Saurio
e9f0c59bcc
fix/mvcc: set log offset to end of file after recovery finishes
...
otherwise we start overwriting existing log entries
2025-10-01 12:46:24 +03:00
Jussi Saurio
bcb941f33b
fix/mvcc: deserialize table_id as i64
2025-10-01 10:26:23 +03:00
Jussi Saurio
d4d50b564a
fix even more tests
2025-09-30 23:22:07 +03:00
Jussi Saurio
adc5b7b27f
remove monkey print
2025-09-30 22:57:21 +03:00
Jussi Saurio
fe871188bf
fix tests again
2025-09-30 22:54:48 +03:00
Jussi Saurio
fb2878973f
fix sort order of write set
2025-09-30 22:54:36 +03:00
Jussi Saurio
fd84fd0683
fix test compilation errors
2025-09-30 22:27:28 +03:00
Jussi Saurio
e68c652f8f
Add some table ID integrity checks to logical log recovery
2025-09-30 22:27:28 +03:00
Jussi Saurio
64ce33bd5c
Move resolution of tableid/rootpage inside MvCursor constructor
2025-09-30 17:04:37 +03:00
Jussi Saurio
7c897d382f
Implement MvTableId newtype for better type safety of table ids
2025-09-30 16:54:22 +03:00