Commit Graph

7527 Commits

Author SHA1 Message Date
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
82b75330bc adjust types.rs util.rs view.rs and mvcc to bubble io 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
Pekka Enberg
2ba28892dc serverless: 0.1.3 2025-08-13 09:56:43 +03:00
Jussi Saurio
e657626167 Merge 'Fix tables renaming to existing index and rename indexed columns on ' from Levy A.
Simple bug fixes.

Closes #2572
2025-08-13 09:56:02 +03:00
Levy A.
6a37916b49 fix: rename indexed columns 2025-08-13 08:55:17 +03:00
Levy A.
45d959635c fix: check if index exists with the same name 2025-08-13 08:55:17 +03:00
Jussi Saurio
2a4404cd13 Merge 'move our dbsp-based views to materialized views' from Glauber Costa
We will implement normal SQLite-style view-as-an-alias for
compatibility, and will call our incremental views materialized views.

Closes #2571
2025-08-13 08:53:30 +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
Jussi Saurio
3908dde832 remove committed garbage files 2025-08-13 08:34:22 +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
Glauber Costa
770f86e490 move our dbsp-based views to materialized views
We will implement normal SQLite-style view-as-an-alias for
compatibility, and will call our incremental views materialized views.
2025-08-12 14:19:17 -05:00
Pekka Enberg
a6247e891f Turso 0.1.4-pre.8 2025-08-12 19:51:42 +03:00
Pekka Enberg
3dd58e98e7 Merge 'Unify JavaScript package README files' from Pekka Enberg
Reviewed-by: Nikita Sivukhin (@sivukhin)

Closes #2563
2025-08-12 19:51:32 +03:00
Pekka Enberg
475799b3e9 Unify JavaScript package README files 2025-08-12 19:30:02 +03:00
Nikita Sivukhin
8040604362 fix clippy 2025-08-12 19:54:11 +04:00
Nikita Sivukhin
1ac3d632ca support checkpoint from remote 2025-08-12 19:53:04 +04:00
Nikita Sivukhin
bf863803da add simple test with checkpoint 2025-08-12 19:49:21 +04:00
PThorpe92
5a4c2a6ce9 Rename page -> slot for arenas + buffer pool 2025-08-12 11:36:49 -04:00
pedrocarlo
217c9061e8 advance commit_tx state machine in mvcc tests 2025-08-12 12:28:35 -03: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
78a89f0fd3 execute should create an Statement 2025-08-12 12:28:35 -03:00
pedrocarlo
10cadd4037 do not use StepResult for commit_txn 2025-08-12 12:28:35 -03:00
pedrocarlo
9ab07f59ad adjust mvcc state transitions 2025-08-12 12:28:35 -03:00
pedrocarlo
fc5492bf2c state machine for op_row_id 2025-08-12 12:28:35 -03:00
pedrocarlo
1221f65d10 state machine for op_column 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
Pekka Enberg
97ad901d96 Merge 'simple README with warning' from Nikita Sivukhin
Closes #2562
2025-08-12 18:24:53 +03:00
Pekka Enberg
2e79333de4 Merge 'turso-sync: fix schema bug' from Nikita Sivukhin
This PR fixes few issues in turso-sync-engine implementation:
1. One step of `pull` implementation works like this:
   a. Start write WAL session
   b. Revert local changes in WAL
   c. Replay WAL frames from remote DB
   d. Replay WAL frames produced by local changes applied to the remote
DB copy (`synced`)
My initial thinking was that by executing step (d) we will get the same
schema as before (with same schema cookie) and everything will be fine.
With more deep thinking we can see that it's not fine - as after step
(d) tables created locally can change their root pages (if they were
created locally, for example) - and DB will have "broken" schema
2. Sync engine execute few SQL statements and do not run them to
completion - which basically created "orphaned" locks
In order to fix (1) I decided to introduce another `conn_raw_api`
extension which allows to read and write schema cookie directly in the
transaction. So, the process described above adds step (e) which set
schema cookie to the value strictly greater than the value before.
In order to fix (2) I just fixed all places where statement were dropped
before running to completion.
These fixes are merged together because I explored them by fixing one
new test: `test_sync_single_db_many_pulls_big_payloads`

Closes #2561
2025-08-12 18:24:46 +03:00
Nikita Sivukhin
02bb891104 add npm badge 2025-08-12 18:55:39 +04:00
Nikita Sivukhin
35b51d8302 simple README with warning 2025-08-12 18:52:58 +04:00
Nikita Sivukhin
d66d6d0220 add few comments 2025-08-12 18:41:30 +04:00
Nikita Sivukhin
bf2a01866c fix clippy 2025-08-12 18:33:12 +04:00
Nikita Sivukhin
d3a27ee311 fix sync engine 2025-08-12 18:30:16 +04:00
Pekka Enberg
269b23ece5 Merge branch 'main' of https://github.com/tursodatabase/limbo 2025-08-12 17:08:30 +03:00
Pekka Enberg
5a65617602 Turso 0.1.4-pre.7 2025-08-12 17:01:47 +03:00
Pekka Enberg
2e326f5a79 Merge 'bindings/javascript: Add async connect() function' from Pekka Enberg
Let's make the API symmetric with libSQL and serverless drivers.

Closes #2557
2025-08-12 17:01:19 +03:00