Skip to content

Commit

Permalink
Misc cleanup, remove sqlite references. (#1360)
Browse files Browse the repository at this point in the history
Removed old comments that referenced SQLite behaviors that no longer exist.
Removed sqlite from dependancies 

Removed DTrace probe points and scripts using them around SQLite.
Fixed a few clippy complaints that had snuck in.
  • Loading branch information
leftwo authored Jun 18, 2024
1 parent e8c4aca commit 49be926
Showing 10 changed files with 7 additions and 122 deletions.
47 changes: 0 additions & 47 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
@@ -77,7 +77,6 @@ rand_chacha = "0.3.1"
reedline = "0.30.0"
reqwest = { version = "0.11", features = ["default", "blocking", "json", "stream"] }
ringbuffer = "0.15.0"
rusqlite = { version = "0.31" }
rustls-pemfile = { version = "1.0.4" }
schemars = { version = "0.8", features = [ "chrono", "uuid1" ] }
serde = { version = "1", features = [ "derive" ] }
1 change: 0 additions & 1 deletion aws_benchmark/install_crucible.yml
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@
- build-essential
- libssl-dev
- pkg-config
- libsqlite3-dev
state: present
when: os == "ubuntu"

1 change: 0 additions & 1 deletion common/Cargo.toml
Original file line number Diff line number Diff line change
@@ -9,7 +9,6 @@ edition = "2021"
anyhow.workspace = true
atty.workspace = true
nix.workspace = true
rusqlite.workspace = true
rustls-pemfile.workspace = true
schemars.workspace = true
serde.workspace = true
6 changes: 0 additions & 6 deletions common/src/lib.rs
Original file line number Diff line number Diff line change
@@ -179,12 +179,6 @@ impl From<anyhow::Error> for CrucibleError {
}
}

impl From<rusqlite::Error> for CrucibleError {
fn from(e: rusqlite::Error) -> Self {
CrucibleError::GenericError(format!("{:?}", e))
}
}

impl<T> From<std::sync::mpsc::SendError<T>> for CrucibleError {
fn from(e: std::sync::mpsc::SendError<T>) -> Self {
CrucibleError::GenericError(format!("{:?}", e))
3 changes: 1 addition & 2 deletions downstairs/Cargo.toml
Original file line number Diff line number Diff line change
@@ -35,7 +35,6 @@ rayon.workspace = true
repair-client.workspace = true
reqwest.workspace = true
ringbuffer.workspace = true
rusqlite.workspace = true
schemars.workspace = true
serde.workspace = true
serde_json.workspace = true
@@ -70,4 +69,4 @@ version_check = "0.9.4"
asm = ["usdt/asm"]
default = []
zfs_snapshot = []
integration-tests = [] # Enables creating SQLite volumes
integration-tests = []
31 changes: 3 additions & 28 deletions downstairs/src/lib.rs
Original file line number Diff line number Diff line change
@@ -15,10 +15,9 @@ use std::sync::Arc;
use std::time::Duration;

use crucible_common::{
build_logger, crucible_bail, deadline_secs,
impacted_blocks::extent_from_offset, integrity_hash, mkdir_for_file,
verbose_timeout, Block, CrucibleError, ExtentId, RegionDefinition,
MAX_BLOCK_SIZE,
build_logger, impacted_blocks::extent_from_offset, integrity_hash,
mkdir_for_file, verbose_timeout, Block, CrucibleError, ExtentId,
RegionDefinition, MAX_BLOCK_SIZE,
};
use crucible_protocol::{
BlockContext, CrucibleDecoder, JobId, Message, MessageWriter,
@@ -768,18 +767,6 @@ pub mod cdt {
num_rehashed: u64,
) {
}
fn extent__flush__sqlite__insert__start(
job_id: u64,
extent_id: u32,
extent_size: u64,
) {
}
fn extent__flush__sqlite__insert__done(
_job_id: u64,
_extent_id: u32,
extent_size: u64,
) {
}
fn extent__write__start(job_id: u64, extent_id: u32, n_blocks: u64) {}
fn extent__write__done(job_id: u64, extent_id: u32, n_blocks: u64) {}
fn extent__write__get__hashes__start(
@@ -796,18 +783,6 @@ pub mod cdt {
}
fn extent__write__file__start(job_id: u64, extent_id: u32, n_blocks: u64) {}
fn extent__write__file__done(job_id: u64, extent_id: u32, n_blocks: u64) {}
fn extent__write__sqlite__insert__start(
job_id: u64,
extent_id: u32,
n_blocks: u64,
) {
}
fn extent__write__sqlite__insert__done(
job_id: u64,
extent_id: u32,
n_blocks: u64,
) {
}
fn extent__write__raw__context__insert__start(
job_id: u64,
extent_id: u32,
8 changes: 2 additions & 6 deletions downstairs/src/region.rs
Original file line number Diff line number Diff line change
@@ -156,11 +156,7 @@ impl Region {
}
};

// The downstairs needs to open (at minimum) the extent file, the sqlite
// database, the write-ahead lock, and the sqlite shared memory file for
// each extent in the region, plus:
//
// - the seed database (db + shm + wal)
// The downstairs needs to open (at minimum) all the extent files, plus
// - region.json
// - stdin, stdout, and stderr
// - the listen and repair sockets (arbitrarily saying two sockets per
@@ -169,7 +165,7 @@ impl Region {
// - optionally, a control interface
//
// If the downstairs cannot open this many files, error here.
let required_number_of_files = def.extent_count() as u64 * 4 + 13;
let required_number_of_files = def.extent_count() as u64 + 8;

if number_of_files_limit < required_number_of_files {
bail!("this downstairs cannot open all required files!");
27 changes: 0 additions & 27 deletions tools/dtrace/perf-downstairs-finegrain-extent-timings.d
Original file line number Diff line number Diff line change
@@ -4,7 +4,6 @@
* - Total time to flush
* - Time to flush the OS file handle
* - Time to re-read the file from disk to re-hash (may be removed later)
* - Time to insert new hashes into sqlite DB
*/


@@ -33,11 +32,6 @@ crucible_downstairs*:::extent-flush-collect-hashes-start
extent_flush_collect_hashes_start[pid,arg0,arg1] = timestamp;
}

crucible_downstairs*:::extent-flush-sqlite-insert-start
{
extent_flush_sqlite_insert_start[pid,arg0,arg1] = timestamp;
}


/* and collections */
crucible_downstairs*:::extent-flush-done
@@ -61,13 +55,6 @@ crucible_downstairs*:::extent-flush-collect-hashes-done
extent_flush_collect_hashes_start[pid,arg0,arg1] = 0;
}

crucible_downstairs*:::extent-flush-sqlite-insert-done
/extent_flush_sqlite_insert_start[pid,arg0,arg1]/
{
@time["flush_sqlite_insert"] = quantize((timestamp - extent_flush_sqlite_insert_start[pid,arg0,arg1]) / arg2);
extent_flush_sqlite_insert_start[pid,arg0,arg1] = 0;
}


/*
* writes
@@ -87,11 +74,6 @@ crucible_downstairs*:::extent-write-get-hashes-start
extent_write_get_hashes_start[pid,arg0,arg1] = timestamp;
}

crucible_downstairs*:::extent-write-sqlite-insert-start
{
extent_write_sqlite_insert_start[pid,arg0,arg1] = timestamp;
}


/* and collections */
crucible_downstairs*:::extent-write-done
@@ -115,15 +97,6 @@ crucible_downstairs*:::extent-write-get-hashes-done
extent_write_get_hashes_start[pid,arg0,arg1] = 0;
}

crucible_downstairs*:::extent-write-sqlite-insert-done
/extent_write_sqlite_insert_start[pid,arg0,arg1]/
{
@time["write_sqlite_insert"] = quantize((timestamp - extent_write_sqlite_insert_start[pid,arg0,arg1]) / arg2);
extent_write_sqlite_insert_start[pid,arg0,arg1] = 0;
}




/*
* reads
4 changes: 1 addition & 3 deletions upstairs/src/client.rs
Original file line number Diff line number Diff line change
@@ -2967,9 +2967,7 @@ pub(crate) fn validate_encrypted_read_response(
// data that is returned. Due to the fact that nonces are
// random for each write, even if the Guest wrote the
// same data block 100 times, only one index will be
// valid. The sqlite backend will return any number of block
// contexts, where the raw file backend will only return
// one (because it knows the active slot).
// valid.
//
// If the computed integrity hash matched but decryption
// failed, continue to the next contexts. the current

0 comments on commit 49be926

Please sign in to comment.