Commit Graph

1182 Commits

Author SHA1 Message Date
pedrocarlo
187ffb5698 adjust test 2025-08-13 10:24:55 +03:00
pedrocarlo
8d48be0e61 cleanup 2025-08-13 10:24:55 +03:00
pedrocarlo
c1975cdfa1 ptrmap functions should bubble completions 2025-08-13 10:24:55 +03:00
pedrocarlo
925d4b15e1 adjust more pager IO returns 2025-08-13 10:24:55 +03:00
pedrocarlo
56905fc340 refactor checkpoint in pager 2025-08-13 10:24:55 +03:00
pedrocarlo
a7f5912e7d adjust wal checkpoint to return completions 2025-08-13 10:24:55 +03:00
pedrocarlo
10ad43d9e0 sync should return completion 2025-08-13 10:24:55 +03:00
pedrocarlo
a7873d8907 remove write counters from Wal impls 2025-08-13 10:24:55 +03:00
pedrocarlo
494fdb828b buuble completions in pager 2025-08-13 10:24:55 +03:00
pedrocarlo
ccc22863c6 remove return_if_locked and return_if_locked_maybe_load 2025-08-13 10:24:55 +03:00
pedrocarlo
f95625a06c bubble completions in btree 2025-08-13 10:24:55 +03:00
pedrocarlo
2e68296107 create IOCompletions 2025-08-13 10:24:55 +03:00
Jussi Saurio
43628e2a9a Merge 'IO Cleanups to use and ' from Pedro Muniz
Depends on #2512 .
This is an attempt to remove all the noise from my IO completions
refactor into separate PRs

Closes #2566
2025-08-13 10:24:15 +03:00
Jussi Saurio
3e8a5b92ae Merge 'turso-sync: support checkpoint' from Nikita Sivukhin
remote protocol can require client to perform checkpoint of the WAL.
This PR supports that need in the sync-engine implementation

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

Closes #2565
2025-08-13 08:49:31 +03:00
pedrocarlo
85e86d427b cleanups - use io.block in many functions and return_if_io 2025-08-13 08:32:38 +03:00
Jussi Saurio
73a2851f0b Merge 'More State machines' from Pedro Muniz
Adds more state machines and does some minor adjustments in some other
functions like `commit_tx` and `execute`.

Closes #2512
2025-08-13 08:31:05 +03:00
Preston Thorpe
a0f70f04f2 Merge 'Rename page -> slot for arenas + buffer pool' from Preston Thorpe
No semantic changes here, just name changing for to prevent confusion as
@sivukhin pointed out.

Reviewed-by: Nikita Sivukhin (@sivukhin)

Closes #2564
2025-08-12 16:03:00 -04:00
Nikita Sivukhin
1ac3d632ca support checkpoint from remote 2025-08-12 19:53:04 +04:00
PThorpe92
5a4c2a6ce9 Rename page -> slot for arenas + buffer pool 2025-08-12 11:36:49 -04:00
pedrocarlo
e94f1f9f14 refactor move_to functions to return IO on start 2025-08-12 12:28:35 -03:00
pedrocarlo
4010dc8f32 state machine for insert 2025-08-12 12:28:35 -03:00
pedrocarlo
fe0e4bcbb7 state machine for seek_end 2025-08-12 12:28:35 -03:00
pedrocarlo
fc05518192 refactor continue_payload_overflow_with_offset 2025-08-12 12:28:34 -03:00
pedrocarlo
81fbf8cb4b balance_non_root validation logic should be done in the next state 2025-08-12 12:28:34 -03:00
Pekka Enberg
0285fddd85 Merge 'Fix max_frame determination and comments in WAL checkpointing' from Preston Thorpe
in #2521, I messed up and introduced improper calculation of the current
checkpoint's max safe frame (mostly due to incorrect comments that I had
left on the method).
The confusion partially stems from our lack of Busy handling at the
moment, but essentially when determining the max safe frame for all
readers, for passive mode we cannot simply `break` out of the loop when
we find a reader with a lower read mark than we have, because _another_
reader might have an even _lower_ read mark, and we could proceed with
the first mark < shared_max.
And for !passive modes, we still attempt to backfill with the same lower
frame, we just return `Busy` at the end, after backfilling what we can
(we just don't reset the log for restart/truncate).
Most of the changes in this PR is just the renaming the fields of
Checkpoint Result, because the names were confusing

Closes #2560
2025-08-12 18:24:59 +03:00
Nikita Sivukhin
1d8ed9aa55 add methods for read/write schema cookie 2025-08-12 17:29:56 +04:00
PThorpe92
c3b536957f Fix max_frame determination and comments in WAL checkpointing 2025-08-12 08:57:35 -04:00
Jussi Saurio
9b5e61eacd Merge 'Reprepare fix on write statement' from Pedro Muniz
We have to update the Transaction State before checking for the Schema
Cookie so that we can rollback the transaction later on correctly.
Closes #2535

Closes #2549
2025-08-12 10:18:12 +03:00
pedrocarlo
96a6bc5125 end_tx does not need schema_did_change variable 2025-08-11 18:59:11 -03:00
PThorpe92
c098a48924 Remove clear dirty from checkpoint state machine in sratch page 2025-08-11 16:40:05 -04:00
PThorpe92
688851c97a Take instead of clone vec of buffers in write_pages_vectored 2025-08-11 16:18:43 -04:00
PThorpe92
e2896d2f95 Minor improvement in flush api 2025-08-11 16:01:41 -04:00
PThorpe92
1f554c2707 Cleanup some minor checkpointing issues 2025-08-11 15:40:36 -04:00
Pekka Enberg
9a35d76c55 Merge 'Add support for Full checkpoint mode in the WAL' from Preston Thorpe
Closes #2519

Closes #2521
2025-08-11 16:59:26 +03:00
bit-aloo
cf12c90428 expose freepage_list in pager 2025-08-11 09:57:46 +05:30
PThorpe92
5061617363 Fix bug in checkpoitn that sets nbackfills and lets readers skip mapping the wal 2025-08-09 16:43:05 -04:00
PThorpe92
0ba52a489e Fix check in CheckpointState::Start for work after determining safe frame 2025-08-09 15:45:47 -04:00
PThorpe92
23f30a481a Add tests for Full checkpoint mode 2025-08-09 15:45:47 -04:00
PThorpe92
cd7fb2f329 Add Full checkpoint mode in WAL 2025-08-09 15:45:45 -04:00
PThorpe92
01f281bae5 Fix doc test/comment 2025-08-09 14:41:15 -04:00
PThorpe92
3d518baef5 Fix assertion to make sure a reader or writer exists when unlock is called 2025-08-09 14:40:03 -04:00
PThorpe92
f81bc3236a Use a single packed u64 for LimboRwLock and relax memory ordering 2025-08-09 14:08:25 -04:00
PThorpe92
718114f5da Keep free api consistent with try_alloc, size instead of pages 2025-08-08 11:50:16 -04:00
PThorpe92
213d589dd1 Apply review suggestions, remove FreeEntry 2025-08-08 11:07:29 -04:00
PThorpe92
84ffed709a Round up allocation for wal frame arena to next page multiple of 64 2025-08-08 10:55:29 -04:00
PThorpe92
d182b836ef Remove basic test for buffer pool to avoid race conditions in CI 2025-08-08 10:55:29 -04:00
PThorpe92
faf248df03 Add more docs and comments for TempBufferCache 2025-08-08 10:55:28 -04:00
PThorpe92
d41377454c Fix test asserting for arena size instead of page size 2025-08-08 10:55:28 -04:00
PThorpe92
d7e4ba21f8 Add explanation for using 3mb limit 2025-08-08 10:55:28 -04:00
PThorpe92
ff7d9fe961 Add basic test for buffer pool initialization and basic use 2025-08-08 10:55:28 -04:00