Commit Graph

122 Commits

Author SHA1 Message Date
Jussi Saurio
e604a80e93 fix/sim: actually enable indexes by default 2025-07-21 13:35:11 +03:00
Jussi Saurio
dce355d9b7 test/stress&sim: enable indexes by default 2025-07-21 11:49:30 +03:00
Jussi Saurio
b1ebc1c82f Merge 'sim: show seed in 'execute_interaction()' trace' from Jussi Saurio
This helps e.g. when you hit some infinite loop

Closes #2161
2025-07-18 12:27:48 +03:00
Jussi Saurio
687d126e25 sim: change --disable-create-index flag to --enable-create-index (default false) 2025-07-18 11:21:24 +03:00
Jussi Saurio
5b2d7315eb sim: show seed in 'execute_interaction()' trace 2025-07-18 11:21:04 +03:00
Jussi Saurio
1b52b5c764 Merge 'chore: update rust to version 1.88.0' from Nils Koch
This PR updates to version Rust 1.88.0 ([Release
notes](https://releases.rs/docs/1.88.0/)) and fixes all the clippy
errors that come with the new Rust version.
This is possible in the latest Rust version:
```rust
if let Some(foo) = bar && foo.is_cool() {
  ...
}
```
There are three complications in the migration (so far):
- A BUNCH of Clippy warnings (mostly fixed in
https://github.com/tursodatabase/limbo/pull/1827)
- Windows cross compilation failed; linking `advapi32` on windows fixes
it
  - Since Rust 1.87.0, advapi32 is not linked by default anymore
([Release notes](https://github.com/rust-
lang/rust/blob/master/RELEASES.md#compatibility-notes-1),
[PR](https://github.com/rust-lang/rust/pull/138233))
- Rust is more strict with FFIs and aligning pointers now. CI checks
failed with error below
  - Fixed in https://github.com/tursodatabase/turso/pull/2064
```
thread 'main' panicked at
core/ext/vtab_xconnect.rs:64:25:
misaligned pointer dereference: address must be
a multiple of 0x8 but is 0x7ffd9d901554
```

Closes #1807
2025-07-17 23:35:33 +03:00
pedrocarlo
b80218324d fix merge conflicts 2025-07-17 12:25:31 -03:00
pedrocarlo
6088aa34c2 only add the sync completion after we call sync in the closure 2025-07-17 12:25:31 -03:00
pedrocarlo
0ab2f2b951 cli options for max and min tick + adjust github action to run with faster clock so no timeouts happen 2025-07-17 12:25:31 -03:00
pedrocarlo
46a7d20c12 clippy 2025-07-17 12:24:43 -03:00
pedrocarlo
4a13286d62 modify clock to use simulated time instead 2025-07-17 12:24:43 -03:00
pedrocarlo
d72a7f5d8e decrease IO latency time as Turso becomes super slow for some reason 2025-07-17 12:24:43 -03:00
pedrocarlo
7b8eec90bd edit state machine in Btree for freeing pages + Pager state machine for free_page 2025-07-17 12:24:43 -03:00
pedrocarlo
5771d1a00e disable wal sync timeout on checkpoint 2025-07-17 12:24:43 -03:00
pedrocarlo
b292e08d2b inject latency with queuing system 2025-07-17 12:24:43 -03:00
pedrocarlo
dc5f73887e refactor to require Arc<Completion> in file traits so that we can delay IO calls correctly 2025-07-17 12:24:43 -03:00
pedrocarlo
4ca5595f07 enable io latency + limit number of tests in simulator pull request CI check 2025-07-17 12:22:27 -03:00
Nils Koch
8dc066503e chore: fix clippy errors 2025-07-16 19:34:42 +01:00
Pekka Enberg
99d61aad3c simulator: Add mention of fsync() issue for disabled fsync faults 2025-07-16 11:15:41 +03:00
Pekka Enberg
b0971f98c2 Merge 'sim: ignore fsync faults' from Jussi Saurio
`FaultyQuery` causes frequent false positives in simulator due to the
following chain of events:
- we write rows and flush wal to disk
- inject fault during fsync which fails
- error is returned to caller, simulator thinks those rows dont exist
because the query failed
- we reopen the database i.e. read the WAL back to memory from disk, it
has those extra rows we think we didn't write
- assertion fails because table has more rows than simulator expected
More discussion about fsync behavior in issue #2091

Closes #2110
2025-07-16 11:15:23 +03:00
Jussi Saurio
bb0cad459e sim: ignore fsync faults
`FaultyQuery` causes frequent false positives in simulator due to
the following chain of events:

- we write rows and flush wal to disk
- inject fault during fsync which fails
- error is returned to caller, simulator thinks those rows dont exist because the query failed
- we reopen the database i.e. read the WAL back to memory from disk, it has those extra rows we think we didn't write
- assertion fails because table has more rows than simulator expected

More discussion about fsync behavior in issue #2091
2025-07-16 11:09:54 +03:00
Pekka Enberg
1a8bade9d5 Merge 'Updates to the simulator' from Alperen Keleş
- Add generation for UNION/JOIN
- Rearchitect the oracle calling conventions to simplify the code paths
- Add brute force shrinking option by @echoumcp1

Closes #2049
2025-07-16 11:03:41 +03:00
alpaylan
6b96789b6d add random_expr for SELECT <expr>; 2025-07-14 18:48:02 -04:00
Pere Diaz Bou
88ff218810 io: assert small I/O
Let's assert **for now** that we do not read/write less bytes than
expected. This should be fixed to retrigger several reads/writes if we
couldn't read/write enough but for now let's assert.
2025-07-14 10:19:41 +02:00
alpaylan
0b3fb2ecdd Merge branch 'main' of https://github.com/tursodatabase/limbo 2025-07-13 11:10:52 -04:00
Nils Koch
828d4f5016 fix clippy errors for rust 1.88.0 (auto fix) 2025-07-12 18:58:41 +03:00
Jussi Saurio
cb16301157 sim: return LimboError::Busy when busy, instead of looping forever 2025-07-12 10:24:49 +03:00
alpaylan
e28ad97ac7 cargo fmt and cargo clippy fixes 2025-07-11 03:35:32 -04:00
alpaylan
3a967f9127 remove rusqlite integrity check, sync generation with --experimental-indexes, move FaultyQuery to disabled by default 2025-07-11 03:35:02 -04:00
alpaylan
b98542d112 cargo fmt and cargo clippy fixes 2025-07-11 02:12:56 -04:00
alpaylan
65fe60ba57 fix the merge conflicts 2025-07-11 02:04:14 -04:00
alpaylan
8f46bbc77e Merge branch 'main' of https://github.com/tursodatabase/limbo 2025-07-11 01:33:50 -04:00
alpaylan
489602b095 updates to the oracle implementations for differential and doublecheck, add integrity check to the end of the simulation, run cargo clippy --fix 2025-07-11 01:22:40 -04:00
alpaylan
a7b5a2c435 Merge branch 'main' of https://github.com/alpaylan/limbo 2025-07-09 00:14:24 -04:00
alpaylan
44a2fa60a3 add union all cardinality preservation, start generating INSERT INTO t SELECT... queries, add integrity checks to the end of run_simulation 2025-07-09 00:14:13 -04:00
echoumcp1
c5d719dafa adding better shrinking and cli opts 2025-07-07 21:21:21 -04:00
pedrocarlo
d21a629cd9 rollback simulator table when we encounter a Rollback query 2025-07-07 13:37:51 -03:00
pedrocarlo
7c8737e292 do not shadow + continue the assertion on injected fault error 2025-07-07 11:53:45 -03:00
pedrocarlo
711b1ef114 make all run_once be run under statement or connection so that rollback is called 2025-07-07 11:51:25 -03:00
pedrocarlo
897426a662 add error tracing to relevant functions + rollback transaction in step_end_write_txn + make move_to_root return result 2025-07-07 11:50:21 -03:00
pedrocarlo
5f9abb62c4 enable faulty query 2025-07-07 11:50:21 -03:00
Pekka Enberg
931a33642e Merge 'add interactive transaction to property insert-values-select' from Pere Diaz Bou
Closes #1958
2025-07-07 14:29:02 +03:00
Jussi Saurio
ec939eaaa9 sim: add feature flags (indexes,mvcc) to CLI args 2025-07-07 10:27:15 +03:00
alpaylan
ea9c67a950 generate joins and unions 2025-07-07 02:54:48 -04:00
alpaylan
2124cc41c0 enable indexes 2025-07-06 14:51:20 -04:00
alpaylan
0bce68b38d wip: add joins to the select 2025-07-06 14:46:38 -04:00
Pere Diaz Bou
897f13c173 add interactive transaction to property insert-values-select 2025-07-04 15:50:46 +02:00
pedrocarlo
251926cd79 leave io faults and fsync query disabled by default 2025-06-30 12:36:26 -03:00
pedrocarlo
4a32f83bd0 add cli option to disable faulty query 2025-06-29 15:56:03 -03:00
pedrocarlo
119c537334 add FaultyQuery Property to inject fault in a query and then assert that it did not modify the database 2025-06-29 15:54:27 -03:00