Commit Graph

119 Commits

Author SHA1 Message Date
Pekka Enberg
f2ecebc357 Rename RowResult to StepResult
The name "row result" is confusing because it really *is* a result from
a step() call. The only difference is how a row is represented as we
return from VDBE or from a statement.

Therefore, rename RowResult to StepResult.
2024-12-27 10:20:41 +02:00
Alperen Keleş
7524cf052e Merge branch 'tursodatabase:main' into main 2024-12-26 15:10:40 -05:00
alpaylan
003ad6cc64 allow failure assertions in the simulator, add creating the same table two times to the list of checked properties as a failure property example 2024-12-26 15:10:03 -05:00
Pekka Enberg
548f66e1cd Merge 'fix empty range error when 0 interactions are produced by creating at least 1 interaction' from Alperen Keleş
Fixes the panicking case in
https://github.com/tursodatabase/limbo/issues/548

Closes #549
2024-12-25 19:45:09 +02:00
alpaylan
e49ba4f982 fix empty range error when 0 interactions are produced by creating at least 1 interaction 2024-12-25 09:55:28 -05:00
Pekka Enberg
652283efc1 simulator: Kill dead code
...the old maybe_add_table() codepath as it is not used.
2024-12-25 10:41:05 +02:00
alpaylan
28ae691bf7 switch the seed, database path, and plan path prints to println instead of log::info 2024-12-25 03:04:57 -05:00
Pekka Enberg
49b235cc92 Merge 'core: wal transaction start' from Pere Diaz Bou
This pr adds support for multiple readers and a single writer with a
custom made lock called `LimboRwLock`. Basically there are 5 allowed
read locks which store the max frame allowed in that "snapshot" and any
reader will try to acquire the biggest one possible. Writer will just
try to lock the `write_lock` and if not successful, it will return busy.
The only checkpoint mode supported for now is `PASSIVE` but it should be
trivial to add more modes.
This needs testing, but I will do it in another PR. I just wanted to do
it in another PR.

Closes #544
2024-12-25 09:42:03 +02:00
Pere Diaz Bou
aed14117c9 core: transaction support 2024-12-24 18:04:30 +01:00
alpaylan
2186b3973b change the name of the simulator submodule into runner 2024-12-23 16:16:39 -05:00
alpaylan
4f07342fdc catch panics, add doublecheck 2024-12-22 23:25:35 -05:00
alpaylan
833c75080b break up the simulator primitives into their own files in the simulator submodule 2024-12-22 17:16:50 -05:00
alpaylan
9f08b621ec add clap CLI for configuring the simulator 2024-12-22 17:06:46 -05:00
alpaylan
d2723b777b update table create probability, print interactions as info logs 2024-12-20 12:18:03 -05:00
Alperen Keleş
54c3423fec Merge branch 'tursodatabase:main' into main 2024-12-20 12:17:10 -05:00
alpaylan
b355568023 use ticks as the main simulator driver, handle disconnects correctly, add multi-connection setup 2024-12-19 23:40:04 -05:00
Pekka Enberg
e93ac38e55 Add statement interruption support
This adds an interrupt() method to Statement that allows apps to
interrupt a running statement. Please note that this is different from
`sqlite3_interrupt()` which interrupts all ongoing operations in a
database. Although we want to support that too, per statement interrupt
is much more useful to apps.
2024-12-19 12:30:32 +02:00
alpaylan
cb20ca7e40 fix formatting 2024-12-18 17:10:18 -05:00
alpaylan
39b5dbed55 change gen.range based queries into frequency and one_of calls 2024-12-18 17:09:44 -05:00
alpaylan
66e7a4edec fix formatting 2024-12-17 18:30:55 -05:00
alpaylan
7d4d803a13 implement interaction plans 2024-12-17 18:24:39 -05:00
alpaylan
53ecedaceb fix formatting 2024-12-16 10:49:56 -05:00
alpaylan
be18c6e8f0 break simulator into parts, add readme 2024-12-16 10:49:05 -05:00
alpaylan
0172c512ac fix formatting 2024-12-15 12:51:01 -05:00
alpaylan
ec1c796650 change the boolean name to a more descriptive version 2024-12-15 12:50:38 -05:00
alpaylan
8e094de6aa fix random character generation 2024-12-14 14:57:32 -05:00
alpaylan
a1b2ab3f54 change names to more descriptive versions, fix the equal row comparison to check the ordering 2024-12-14 14:46:22 -05:00
alpaylan
31fcdb8727 add workload percentage back to the simulator, fix the smaller/larger UTF8 string generator 2024-12-14 14:46:22 -05:00
Alperen Keleş
5284603c6e Merge branch 'tursodatabase:main' into main 2024-12-14 14:46:12 -05:00
alpaylan
8cb7086bfc formatting changes 2024-12-13 16:08:50 -05:00
alpaylan
ab556032f5 change the names of guard to predicate, arbitrary_of to arbitrary_from, ArbitraryOf to ArbitraryFrom 2024-12-13 16:07:56 -05:00
alpaylan
2d712d2b35 update simulator to randomly pick an action and check its postconditions 2024-12-13 15:59:16 -05:00
alpaylan
6029fc6303 fix formatting errors 2024-12-13 07:56:41 -05:00
alpaylan
c51de732c8 - added Arbitrary and ArbitraryOf<T> traits for mroe centralized generation
- implemented random generation for tables and structured queries
2024-12-13 07:51:47 -05:00
Pere Diaz Bou
a4297702bd extract page cache to be multi threaded 2024-12-13 13:09:13 +01:00
Lauri Virtanen
afeb1cbe74 Clippy warning fixes 2024-11-24 20:24:47 +02:00
Lauri Virtanen
a7100d8e9b Autofix clippy issues with cargo fix --clippy 2024-11-24 20:24:47 +02:00
Pekka Enberg
f8667bb160 simulator: Remove seed from SimulatorOpts
It's not used anywhere and technically it's not even part of simulation
options, but the seed that generates them.
2024-11-20 11:55:49 +02:00
Pekka Enberg
39ca03a7ce simulator: Remove unused imports from main.rs 2024-11-20 11:55:49 +02:00
Pekka Enberg
a3078079b4 simulator: Fix clone() on double reference
Switch to to_string() and to_vec() instead of clone() + to_owned() to
fix the following warnings:

warning: using `.clone()` on a double reference, which returns `&String` instead of cloning the inner type
   --> simulator/main.rs:348:68
    |
348 |                         limbo_core::Value::Text(t) => Value::Text(t.clone().to_owned()),
    |                                                                    ^^^^^^^^
    |
    = note: `#[warn(suspicious_double_ref_op)]` on by default

warning: using `.clone()` on a double reference, which returns `&Vec<u8>` instead of cloning the inner type
   --> simulator/main.rs:349:68
    |
349 |                         limbo_core::Value::Blob(b) => Value::Blob(b.clone().to_owned()),
2024-11-20 11:55:49 +02:00
Pere Diaz Bou
e0e2ae9078 print stats 2024-11-19 17:54:32 +01:00
Pere Diaz Bou
269207d5db add rows to env and blob fix 2024-11-19 17:40:42 +01:00
Pere Diaz Bou
f5a1f7c800 various fixes in btree
* read_u8 now takes self.offset into account
* shift cell pointers left on balance_root with offset > 0
* fix wrong writes to page in degragment_page
2024-11-19 17:15:19 +01:00
Pere Diaz Bou
999787b320 query print threshold, reduce ratio of big texts 2024-11-18 16:24:12 +01:00
Pere Diaz Bou
4aa5612334 fix schema query 2024-11-18 14:06:50 +01:00
Pere Diaz Bou
44e22c50cf sim: improve simulator 2024-11-18 13:40:37 +01:00
Pere Diaz Bou
e2276c2e9d O_DIRECT disable on WAL 2024-11-13 13:45:42 +00:00
Pere Diaz Bou
0b46648c0e write wal header on init 2024-11-07 13:29:57 +01:00
Pere Diaz Bou
8eb3c89227 wasm,sim fixes 2024-11-05 15:41:30 +01:00
Pere Diaz Bou
f43e53a815 fix wasm and simulator wal impl 2024-11-05 15:29:54 +01:00