Commit Graph

9103 Commits

Author SHA1 Message Date
Pekka Enberg
0ce6469a4b Merge 'Fix some Rust compilation warnings' from Samuel Marks
Nothing fancy yet, assuming you merge this I'll do this one next:
```
warning: function pointer comparisons do not produce meaningful results since their addresses are not guaranteed to be unique
   --> core/types.rs:403:5
    |
398 | #[derive(Debug, Clone, PartialEq)]
    |                        --------- in this derive macro expansion
...
402 |     pub step_fn: StepFunction,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^
403 |     pub finalize_fn: FinalizeFunction,
    |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    |
    = note: the address of the same function can vary between different codegen units
    = note: furthermore, different functions could have the same address after being merged together
    = note: for more information visit <https://doc.rust-lang.org/nightly/core/ptr/fn.fn_addr_eq.html>
```
And fix a test failure that I resolved in Python (specific to macOS
hosts). Basically this PR is putting my toe in the water to see how open
you are to contribs!

Closes #3211
2025-09-19 08:28:53 +03:00
Jussi Saurio
bab814948c Merge ' core/mvcc: LogicalLog simple append serializer ' from Pere Diaz Bou
This is wip but since I have it working on a single connection maybe
this is worth to review right now.
I haven't done any header work right now for the on disk format, but
instead I've basically added the skeleton for logical log transactions
on MVCC to work.
**before merging this pr I have to remove cherry picked commit from
https://github.com/tursodatabase/turso/pull/3156**

Closes #3158
2025-09-19 08:08:07 +03:00
Samuel Marks
e333f151ba [*.rs] Resolve warnings (mostly "hiding a lifetime that's elided elsewhere is confusing") 2025-09-18 22:47:43 -05:00
Preston Thorpe
5819832c4e Merge 'translate/insert: fix program.result_columns when inserting multiple rows' from Preston Thorpe
closes #3206 and https://github.com/tursodatabase/turso-go/issues/21
What happens is the coroutine overwrites the program state.. so the
`RETURNING` result columns are from the `translate_select` that happens
when we insert multiple rows.
```rust
let result = translate_select(schema, select, syms, program, query_destination, connection)?;
// overwrites program.result_columns
```

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

Closes #3208
2025-09-18 17:34:42 -04:00
PThorpe92
c941955444 Fix issue with result columns being inappropriate for inserting multiple rows 2025-09-18 14:35:12 -04:00
Pere Diaz Bou
abaf2118a3 clippy 2025-09-18 19:26:46 +02:00
Pere Diaz Bou
402f171ce4 fix compilation error on logical_log 2025-09-18 19:20:37 +02:00
Pere Diaz Bou
242c48c813 core/mvcc: logical log fix offset addition 2025-09-18 19:14:56 +02:00
Pere Diaz Bou
b40e699c8c core/mvcc: don't end pager tx on logical log 2025-09-18 19:12:45 +02:00
Pere Diaz Bou
4f5833c681 fmt 2025-09-18 18:40:13 +02:00
Pere Diaz Bou
0fd704d00f core/mvcc: begin_tx with logical log don't use pager 2025-09-18 18:39:57 +02:00
Pere Diaz Bou
3e7a074f82 core/mvcc: fix review comments 2025-09-18 18:27:57 +02:00
Pere Diaz Bou
ef341338dc core/mvcc: rebase fix 2025-09-18 18:24:55 +02:00
Pere Diaz Bou
ff3c79d5d7 remove mvvmode and set logical log as default 2025-09-18 18:22:25 +02:00
Pere Diaz Bou
0e5b0fe8c4 perf/throughput/turso: add io option 2025-09-18 18:22:06 +02:00
Pere Diaz Bou
e6eb3adcbd core/mvcc/logical-log: sync 2025-09-18 18:22:06 +02:00
Pere Diaz Bou
d53c64e84b core/schema: parse schema rows for MVCC transactions 2025-09-18 18:22:06 +02:00
Pere Diaz Bou
a0555c254d core/mvcc/logical-log: change schema on update 2025-09-18 18:22:06 +02:00
Pere Diaz Bou
ba798076a0 perf/throughput/turso: add env-filter 2025-09-18 18:22:06 +02:00
Pere Diaz Bou
91c04133e9 perf/throughput/turso: allow logical log benchmark 2025-09-18 18:22:06 +02:00
Pere Diaz Bou
50c18ada1c core/mvcc: logical log update header on commit 2025-09-18 18:22:06 +02:00
Pere Diaz Bou
e2824835dc fix all open_file use cases for mvcc mode 2025-09-18 18:22:05 +02:00
Pere Diaz Bou
9b35c6efb6 rust/lib: expose mvccmode 2025-09-18 18:21:21 +02:00
Pere Diaz Bou
050055b833 core/mvcc: do not start pager txns with logical log 2025-09-18 18:21:21 +02:00
Pere Diaz Bou
6b9fb2f181 core/mvcc: fix locks in logical log 2025-09-18 18:21:04 +02:00
Pere Diaz Bou
0eb2aa123d cli/app: add mvcc mode 2025-09-18 18:21:04 +02:00
Pere Diaz Bou
81a33bb25a core/mvcc: introduce LogicalLog simple append serializer 2025-09-18 18:21:04 +02:00
Pere Diaz Bou
de8a975a0b core/mvcc: introduce MvccMode Logical Log 2025-09-18 18:21:04 +02:00
Pekka Enberg
a011548aac Merge 'core/storage: Wrap Pager::free_page_state with RwLock' from Pekka Enberg
Closes #3200
2025-09-18 17:17:53 +03:00
Pekka Enberg
beedb7a4aa Merge 'core: Rename Connection::_db to db' from Pekka Enberg
Reviewed-by: Preston Thorpe <preston@turso.tech>

Closes #3196
2025-09-18 17:17:46 +03:00
Pekka Enberg
ecbe2c231f core: Rename Connection::_db to db 2025-09-18 16:00:41 +03:00
Pekka Enberg
7ac2e49a83 core/storage: Wrap Pager::free_page_state with RwLock 2025-09-18 15:46:23 +03:00
Pekka Enberg
d69cdd92d2 Merge 'core/storage: Switch Pager::max_page_count to AtomicU32' from Pekka Enberg
Closes #3197
2025-09-18 15:45:39 +03:00
Pekka Enberg
19513fd9a7 core/storage: Switch Pager::max_page_count to AtomicU32 2025-09-18 14:46:22 +03:00
Pekka Enberg
6e9684c763 Merge 'core/storage: Use AtomicU16 for Pager::reserved_space' from Pekka Enberg
Closes #3195
2025-09-18 14:46:08 +03:00
Preston Thorpe
ec79a9063d Merge 'remove io.blocks from btree balancing code' from Nikita Sivukhin
This PR removes `io.block` usage from B-Tree balancing code (similarly
as in the #3179)

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

Closes #3194
2025-09-18 07:24:51 -04:00
Pekka Enberg
6c48cb7043 Merge 'core: Use sequential consistency for atomics by default' from Pekka Enberg
We use relaxed ordering in a lot of places where we really need to
ensure all CPUs see the write. Switch to sequential consistency, unless
acquire/release is explicitly used. If there are places that can be
optimized, we can switch to relaxed case-by-case, but have a comment
explaning *why* it is safe.

Closes #3193
2025-09-18 14:19:54 +03:00
Pekka Enberg
50acebd88e core/storage: Use AtomicU16 for Pager::reserved_space 2025-09-18 14:19:13 +03:00
Pekka Enberg
f731efdc35 Merge 'core/storage: Use AtomicU32 for Pager::page_size' from Pekka Enberg
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #3191
2025-09-18 13:40:57 +03:00
Pekka Enberg
8337e86794 core: Use sequential consistency for atomics by default
We use relaxed ordering in a lot of places where we really need to
ensure all CPUs see the write. Switch to sequential consistency, unless
acquire/release is explicitly used. If there are places that can be
optimized, we can switch to relaxed case-by-case, but have a comment
explaning *why* it is safe.
2025-09-18 13:38:13 +03:00
Nikita Sivukhin
1e0fb143f6 remove io.blocks from btree balancing code 2025-09-18 14:28:53 +04:00
Pekka Enberg
36071c0436 Merge 'stress: Retry sync on error to avoid a panic, take 2' from Pekka Enberg
Commit eeab6d5ce ("stress: Retry sync on error to avoid a panic") only
enabled sync retry in the schema creation path. Let's add it to the
stress test loop too.
Spotted during Antithesis runs.

Closes #3192
2025-09-18 13:17:25 +03:00
Jussi Saurio
c9d7cf77b8 Merge 'Fix C API compatibility tests and add a minimal CI' from Andrea Peruffo
Hi 👋 and thanks for the great project!
Related to my comment on #85
Here I implemented 3 missing APIs and added a GH Action job to verify
the results.
Let me know if I missed anything and if this is aligned with the
direction of the project.

Reviewed-by: Nikita Sivukhin (@sivukhin)

Closes #2982
2025-09-18 13:14:34 +03:00
andreatp
4c74ab10f4 fix c compat tests and add a minimal CI 2025-09-18 10:13:31 +01:00
Pekka Enberg
31ff7d196b stress: Retry sync on error to avoid a panic, take 2
Commit eeab6d5ce ("stress: Retry sync on error to avoid a panic") only
enabled sync retry in the schema creation path. Let's add it to the
stress test loop too.

Spotted during Antithesis runs.
2025-09-18 11:38:11 +03:00
Pekka Enberg
2a5284afb9 core/storage: Use AtomicU32 for Pager::page_size 2025-09-18 11:33:32 +03:00
Pekka Enberg
0799273d24 Merge 'Convert more Pager fields towards being Send' from Pekka Enberg
Reviewed-by: Jussi Saurio <jussi.saurio@gmail.com>

Closes #3177
2025-09-18 11:21:20 +03:00
Pekka Enberg
e6d994dee0 core/storage: Wrap Pager::allocate_page_state with RwLock 2025-09-18 10:55:55 +03:00
Pekka Enberg
365f606cce core/storage: Use AtomicU8 for Pager::auto_vacuum_mode 2025-09-18 10:55:55 +03:00
Pekka Enberg
2215cccebb core/storage: Wrap Pager::syncing in Arc<AtomicBool> 2025-09-18 10:55:54 +03:00