Commit Graph

350 Commits

Author SHA1 Message Date
pedrocarlo
2f237fdcfd adjust remaining calculation to use the profile 2025-08-30 11:31:52 -03:00
pedrocarlo
962666831b read Profile file from path or use predefined profiles 2025-08-30 11:31:52 -03:00
pedrocarlo
a1407869d4 add serde, schemars and garde to profiles and options 2025-08-30 11:31:52 -03:00
pedrocarlo
06b923d0c1 adjust simulator to use correct trait signature 2025-08-30 11:31:52 -03:00
pedrocarlo
e0552629e3 create Generation Options structs 2025-08-30 11:31:52 -03:00
pedrocarlo
ef16bc4cfb add profiles together 2025-08-30 11:31:52 -03:00
pedrocarlo
918c2a3f69 extend latency profile + impl Default manually 2025-08-30 11:31:52 -03:00
pedrocarlo
19d9003cd7 create profiles folder 2025-08-30 11:31:52 -03:00
pedrocarlo
bcd70488ae add sqlite integrity check back 2025-08-29 12:25:27 -03:00
pedrocarlo
8010b7d0c7 make simulator use sql_generation crate as dependency 2025-08-25 22:59:31 -03:00
Jussi Saurio
cc643362a4 sim: remove "run_once faults"
This kind of fault does not semantically represent anything real,
since we already have fault injection for every concrete IO operation
like reading, writing, syncing and so forth.

Moreover, having this feature is the direct cause of the false positive
simulator failure as reported in issue #2727. There, a "run_once fault"
happened immediately after we fsynced following an INSERT, which caused
the simulator to think the INSERT failed, and later a sim assertion failed
because the on-disk database had 1 more row than it thought it would.
2025-08-22 10:13:06 +03:00
Nikita Sivukhin
c771487933 add remove_file method to the IO 2025-08-21 14:51:02 +04:00
Jussi Saurio
e6adb8992b sim: use 'git rev-parse --show-toplevel' for getting base dir 2025-08-20 09:58:21 +03:00
pedrocarlo
7bc0545442 default impl for get_memory_io 2025-08-19 10:48:21 -03:00
pedrocarlo
f72bcbc5da default impl for wait_for_completion + check for errors in completion there 2025-08-19 10:48:21 -03:00
Jussi Saurio
97657a86b3 Do not assume error message content in FaultyQuery 2025-08-19 12:49:01 +03:00
pedrocarlo
d96a26aef9 Property TableHasExpectedContent should just check the expected
content on runtime, not generation time
2025-08-18 16:00:59 -03:00
pedrocarlo
2954e2e7bf shrinking: remove table assertions for non-dependent tables 2025-08-18 12:44:49 -03:00
pedrocarlo
59da828362 do not shadow FaultyQuery's immediately. Only shadow them later 2025-08-18 12:40:02 -03:00
pedrocarlo
7fb14cfc76 add File path to SimulatorFile 2025-08-18 11:52:10 -03:00
pedrocarlo
6388ed2017 FaultyQuery enabled by default 2025-08-18 11:52:10 -03:00
Jussi Saurio
6c17fa2a5e fix/sim: prevent sim from trying to create an existing table or index
We recently merged a change that panics the sim on parse errors, because
not doing so has masked many scenarios where the sim unintentionally
creates incorrect sql and we just ignore it.

We already have Property::DoubleCreateFailure to assert that the same table
cannot be created twice, so this should not hide any bugs.
2025-08-17 18:13:05 +03:00
Jussi Saurio
0a3ebf8914 Fail simulator on parse errors 2025-08-16 10:27:10 +03:00
PThorpe92
2810b5d8a2 Add --keep-files flag and force Drop of database in simulator to prevent issues with the Registry 2025-08-15 17:54:40 -04:00
pedrocarlo
2bc6edc3d4 introduce TableContext for the simulator to properly generate predicates for Joins 2025-08-15 23:44:00 +03:00
Jussi Saurio
3760d44c13 sim: force compound selects to have the same number of result columns 2025-08-15 23:43:38 +03:00
Jussi Saurio
96072509f5 sim: add Property::TableHasExpectedContent 2025-08-15 11:16:31 +03:00
Jussi Saurio
4c76191fec fix/sim: fix incorrect implementation of compound select generation
Problem:

sim was generating compound selects like this:

- pick a random `table`
- create a random single SELECT
- create `n` random compound SELECTs (UNION ALL etc)

assign a WHERE clause that always has a condition based on `table`

This can result in e.g.

```
SELECT a FROM foo WHERE bar.x = 'baz'
```

Solution:

Don't base the WHERE clause on a table that might not be referenced
in the query.

Again, the only reason this wasn't caught before was because `FaultyQuery`
and `FsyncNoWait` are the only paths where this is actually tested with an
assertion, and those are both disabled
2025-08-15 10:48:42 +03:00
Jussi Saurio
165f2aed23 make big joins even less likely 2025-08-14 19:35:16 +03:00
Jussi Saurio
f5438d14de make big compound selects even less likely 2025-08-14 19:35:16 +03:00
Jussi Saurio
aed48bb665 sim: reduce frequency of compound selects and complex joins 2025-08-14 19:35:16 +03:00
Jussi Saurio
1a11648974 sim: add Property::ReadYourUpdatesBack 2025-08-14 19:04:27 +03:00
Jussi Saurio
0b9d07db4c sim: restrict Update::arbitrary_from() to SET each column max once 2025-08-14 18:55:34 +03:00
Jussi Saurio
87bf488bbc chore: use rusqlite 0.37 with bundled sqlite everywhere 2025-08-11 15:13:57 +03:00
pedrocarlo
0c9ecbc768 simulator should delete files after a successful run 2025-08-09 16:25:51 -03:00
PThorpe92
f6a68cffc2 Remove RefCell from IO and Page apis 2025-08-05 16:24:49 -04:00
pedrocarlo
543cdb3e2c underscoring completions and IOResult to avoid warning messages 2025-07-31 11:51:17 -03:00
PThorpe92
daec8aeb22 impl pwritev for simulator file 2025-07-30 19:42:49 -04:00
PThorpe92
9c75872827 Make writing wal header able to be sync 2025-07-30 14:05:18 +03:00
PThorpe92
dcf346b9b0 Update apparently very old branch to new api 2025-07-30 13:48:05 +03:00
PThorpe92
52f63b2af0 Impl truncate for simulator 2025-07-30 13:48:05 +03:00
pedrocarlo
3831e0db39 convert must_use compile warnings to unused_variables to track locations where we need to refactor in the future 2025-07-28 16:09:26 -03:00
pedrocarlo
d30c7d54c8 change all Arc<Completion> to Completion 2025-07-28 15:32:45 -03:00
meteorgan
b5a18d7dc9 fix get_column_name() when column name doesn't exist 2025-07-25 23:49:31 +08:00
bit-aloo
9a54ef214e parser: Distinguish quoted identifiers and unify Id into Name enum
This commit replaces the `Name(pub String)` struct with a `Name` enum that
explicitly models how the name appeared in the source either as an
unquoted identifier (`Ident`) or a quoted string (`Quoted`).

In the process, the separate `Id` wrapper type has been coalesced into the
`Name` enum, simplifying the AST and reducing duplication in identifier
handling logic.

While this increases the size of some AST nodes (notably `yyStackEntry`),
it improves correctness and makes source structure more explicit for
later phases.
2025-07-24 14:40:19 +05:30
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
086a269a65 Merge 'sim: change --disable-create-index flag to --enable-create-index (default false)' from Jussi Saurio
Closes #2160
2025-07-18 12:27:35 +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