diff --git a/simulator/generation/plan.rs b/simulator/generation/plan.rs index 12ab2e454..910794faf 100644 --- a/simulator/generation/plan.rs +++ b/simulator/generation/plan.rs @@ -650,7 +650,12 @@ fn reopen_database(env: &mut SimulatorEnv) { // 2. Re-open database let db_path = env.db_path.clone(); - let db = match turso_core::Database::open_file(env.io.clone(), &db_path, false, false) { + let db = match turso_core::Database::open_file( + env.io.clone(), + &db_path, + env.opts.experimental_mvcc, + env.opts.experimental_indexes, + ) { Ok(db) => db, Err(e) => { panic!("error opening simulator test file {:?}: {:?}", db_path, e); diff --git a/simulator/runner/cli.rs b/simulator/runner/cli.rs index 28daa1840..1727e765f 100644 --- a/simulator/runner/cli.rs +++ b/simulator/runner/cli.rs @@ -94,6 +94,10 @@ pub struct SimulatorCLI { default_value_t = 0 )] pub latency_probability: usize, + #[clap(long, help = "Enable experimental MVCC feature")] + pub experimental_mvcc: bool, + #[clap(long, help = "Enable experimental indexing feature")] + pub experimental_indexes: bool, } #[derive(Parser, Debug, Clone, Serialize, Deserialize, PartialEq, PartialOrd, Eq, Ord)] diff --git a/simulator/runner/env.rs b/simulator/runner/env.rs index b85d8edb9..66118c954 100644 --- a/simulator/runner/env.rs +++ b/simulator/runner/env.rs @@ -123,6 +123,8 @@ impl SimulatorEnv { max_interactions: rng.gen_range(cli_opts.minimum_tests..=cli_opts.maximum_tests), max_time_simulation: cli_opts.maximum_time, disable_reopen_database: cli_opts.disable_reopen_database, + experimental_mvcc: cli_opts.experimental_mvcc, + experimental_indexes: cli_opts.experimental_indexes, }; let io = @@ -138,7 +140,12 @@ impl SimulatorEnv { std::fs::remove_file(wal_path).unwrap(); } - let db = match Database::open_file(io.clone(), db_path.to_str().unwrap(), false, false) { + let db = match Database::open_file( + io.clone(), + db_path.to_str().unwrap(), + opts.experimental_mvcc, + opts.experimental_indexes, + ) { Ok(db) => db, Err(e) => { panic!("error opening simulator test file {:?}: {:?}", db_path, e); @@ -241,4 +248,7 @@ pub(crate) struct SimulatorOpts { pub(crate) max_interactions: usize, pub(crate) page_size: usize, pub(crate) max_time_simulation: usize, + + pub(crate) experimental_mvcc: bool, + pub(crate) experimental_indexes: bool, }