Commit Graph

8400 Commits

Author SHA1 Message Date
pedrocarlo
f25f51b8aa do not need wait_for_read_complete anymore 2025-08-09 21:50:18 -03:00
pedrocarlo
76d6c4a28d only open 1 file for sorter so chunks just reuse that file 2025-08-09 21:50:18 -03:00
pedrocarlo
4a3408003a wait for flush to complete 2025-08-09 21:50:18 -03:00
pedrocarlo
5924274d61 adjust state machine transition 2025-08-09 21:50:18 -03:00
pedrocarlo
6fe19e4ef4 adjust external sort init_chunk_heap and next_from_chunk_heap 2025-08-09 21:50:18 -03:00
pedrocarlo
c02936eb30 state machine for insert 2025-08-09 21:50:18 -03:00
pedrocarlo
2ec58b0264 state machine for sort 2025-08-09 21:50:18 -03:00
pedrocarlo
c91c22a6a8 state machine for next 2025-08-09 21:50:18 -03:00
pedrocarlo
2ffc5ee423 SorterChunk read and write should return completions 2025-08-09 21:50:18 -03:00
PThorpe92
496105ac15 Add Full checkpoint mode to test_multiple_connections_fuzz 2025-08-09 17:34:23 -04:00
PThorpe92
5061617363 Fix bug in checkpoitn that sets nbackfills and lets readers skip mapping the wal 2025-08-09 16:43:05 -04:00
Jussi Saurio
e2eed9b3f3 perf/btree: optimize op_column 2025-08-09 23:16:43 +03: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
Preston Thorpe
efd6fde389 Merge 'docs: fix CLI command and add homebrew install instructions for MacOS' from Mattia
Hi there,
I wasn't able to run the Turso CLI locally following the manual in the
docs (with both the release version and Homebrew). I found out that the
right command is `tursodb` rather than just turso as specified in the
cli/Cargo.toml.
This MR updates the docs and also mention the instruction to install it
with Homebrew.
Demo:
<img width="629" height="129" alt="image" src="https://github.com/user-
attachments/assets/3c684328-dab6-436a-bae6-4b6199f5b0b5" />

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

Closes #2514
2025-08-09 15:42:26 -04:00
Preston Thorpe
dbd9195828 Merge 'Reimplement LimboRwLock in the WAL' from Preston Thorpe
This PR rewrites the `LimboRwLock`, which previously used 3 separate
`AtomicU32` values to store the lock state, in favor of a single,
packed, cache friendly `AtomicU64`.
The previous impl has some complexity and rather hairy edge cases/issues
because we are not updating the lock state together. This PR also
adjusts it to use `Acquire`/`Release` for `load`/`store` operations, and
tries to improve the API of using the locks.

Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #2518
2025-08-09 15:38:36 -04:00
pedrocarlo
0c9ecbc768 simulator should delete files after a successful run 2025-08-09 16:25:51 -03: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
TcMits
b428d0bd75 finish ALTER without tests 2025-08-09 17:50:51 +07:00
Mattia Pitossi
398bea9f12 docs: fix command add homebrew install instructions for MacOS 2025-08-09 11:58:11 +02:00
Preston Thorpe
54613cceec Merge 'BufferPool: add arena backed pool to support fixed opcodes and coalescing' from Preston Thorpe
This PR introduces a BufferPool which allocates all (usually) of the
memory we will need up front as two large arenas (one for WAL frames and
one for DB pages) and hands our pages from those two arena allocations.
(each will be 3 MB by default, because 8MB is typically the RL_MEMLOCK
limit so without `setcap cap_ipc_lock` changed, it will not be able to
properly register the arenas with io_uring).
Any additional memory needed will fall back to the previous style buffer
pool, with a simple thread local cache, which should be slightly faster
for most cases.

Closes #2419
2025-08-08 14:38:21 -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
34d90d5acb Remove Clone impl for Buffer and PageContent to make any copying of page data explicit 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
PThorpe92
66964fd8d2 Add documentation and comments to new buffer pool, add get_frame api 2025-08-08 10:55:28 -04:00
PThorpe92
d94e252ef9 Actually pre-register two arenas with the ring 2025-08-08 10:55:28 -04:00
PThorpe92
f9df267f42 Increase test arena size and fix import 2025-08-08 10:55:28 -04:00
PThorpe92
39d230a899 Add bitmap for tracking pages in arena 2025-08-08 10:55:27 -04:00
PThorpe92
0ffba81216 Make register buffer io trait return the buf index 2025-08-08 10:55:27 -04:00
PThorpe92
3cff47e490 Fix btree test to properly initialize pool 2025-08-08 10:55:27 -04:00
PThorpe92
fd09fe1237 Adjust io_uring to register two arenas, one for frames and the other for db pages 2025-08-08 10:55:27 -04:00
PThorpe92
cc75bc448e Move TLC buffer cache to io/mod 2025-08-08 10:55:27 -04:00
PThorpe92
9d1ca1c8ca Add ReadFixed/WriteFixed opcodes for buffers from registered arena 2025-08-08 10:55:27 -04:00
PThorpe92
dffa47b048 Use temp buffer for wal header 2025-08-08 10:55:27 -04:00
PThorpe92
2e072cadb0 Add CI=true env var so the tests dont each allocate 4mb by default 2025-08-08 10:55:26 -04:00
PThorpe92
7ea52a3f89 Fix changing page size and initialization for buffer pool 2025-08-08 10:55:26 -04:00
PThorpe92
036ae596c4 Fix test with old buffer api 2025-08-08 10:55:26 -04:00
PThorpe92
0884fec799 Use parent buffer pool for ephemeral pager and wal 2025-08-08 10:55:26 -04:00
PThorpe92
5750b1229c Setup and initialize pool properly 2025-08-08 10:55:26 -04:00
PThorpe92
4ffb273b53 Adjust IO to use new buffer pool and buffer API 2025-08-08 10:55:26 -04:00
PThorpe92
27113885a9 Update sorter to use new buffer api 2025-08-08 10:55:26 -04:00