Skip to content

Commit 49be926

Browse files
authored
Misc cleanup, remove sqlite references. (#1360)
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.
1 parent e8c4aca commit 49be926

File tree

10 files changed

+7
-122
lines changed

10 files changed

+7
-122
lines changed

Cargo.lock

-47
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -77,7 +77,6 @@ rand_chacha = "0.3.1"
7777
reedline = "0.30.0"
7878
reqwest = { version = "0.11", features = ["default", "blocking", "json", "stream"] }
7979
ringbuffer = "0.15.0"
80-
rusqlite = { version = "0.31" }
8180
rustls-pemfile = { version = "1.0.4" }
8281
schemars = { version = "0.8", features = [ "chrono", "uuid1" ] }
8382
serde = { version = "1", features = [ "derive" ] }

aws_benchmark/install_crucible.yml

-1
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@
3535
- build-essential
3636
- libssl-dev
3737
- pkg-config
38-
- libsqlite3-dev
3938
state: present
4039
when: os == "ubuntu"
4140

common/Cargo.toml

-1
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,6 @@ edition = "2021"
99
anyhow.workspace = true
1010
atty.workspace = true
1111
nix.workspace = true
12-
rusqlite.workspace = true
1312
rustls-pemfile.workspace = true
1413
schemars.workspace = true
1514
serde.workspace = true

common/src/lib.rs

-6
Original file line numberDiff line numberDiff line change
@@ -179,12 +179,6 @@ impl From<anyhow::Error> for CrucibleError {
179179
}
180180
}
181181

182-
impl From<rusqlite::Error> for CrucibleError {
183-
fn from(e: rusqlite::Error) -> Self {
184-
CrucibleError::GenericError(format!("{:?}", e))
185-
}
186-
}
187-
188182
impl<T> From<std::sync::mpsc::SendError<T>> for CrucibleError {
189183
fn from(e: std::sync::mpsc::SendError<T>) -> Self {
190184
CrucibleError::GenericError(format!("{:?}", e))

downstairs/Cargo.toml

+1-2
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,6 @@ rayon.workspace = true
3535
repair-client.workspace = true
3636
reqwest.workspace = true
3737
ringbuffer.workspace = true
38-
rusqlite.workspace = true
3938
schemars.workspace = true
4039
serde.workspace = true
4140
serde_json.workspace = true
@@ -70,4 +69,4 @@ version_check = "0.9.4"
7069
asm = ["usdt/asm"]
7170
default = []
7271
zfs_snapshot = []
73-
integration-tests = [] # Enables creating SQLite volumes
72+
integration-tests = []

downstairs/src/lib.rs

+3-28
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,9 @@ use std::sync::Arc;
1515
use std::time::Duration;
1616

1717
use crucible_common::{
18-
build_logger, crucible_bail, deadline_secs,
19-
impacted_blocks::extent_from_offset, integrity_hash, mkdir_for_file,
20-
verbose_timeout, Block, CrucibleError, ExtentId, RegionDefinition,
21-
MAX_BLOCK_SIZE,
18+
build_logger, impacted_blocks::extent_from_offset, integrity_hash,
19+
mkdir_for_file, verbose_timeout, Block, CrucibleError, ExtentId,
20+
RegionDefinition, MAX_BLOCK_SIZE,
2221
};
2322
use crucible_protocol::{
2423
BlockContext, CrucibleDecoder, JobId, Message, MessageWriter,
@@ -768,18 +767,6 @@ pub mod cdt {
768767
num_rehashed: u64,
769768
) {
770769
}
771-
fn extent__flush__sqlite__insert__start(
772-
job_id: u64,
773-
extent_id: u32,
774-
extent_size: u64,
775-
) {
776-
}
777-
fn extent__flush__sqlite__insert__done(
778-
_job_id: u64,
779-
_extent_id: u32,
780-
extent_size: u64,
781-
) {
782-
}
783770
fn extent__write__start(job_id: u64, extent_id: u32, n_blocks: u64) {}
784771
fn extent__write__done(job_id: u64, extent_id: u32, n_blocks: u64) {}
785772
fn extent__write__get__hashes__start(
@@ -796,18 +783,6 @@ pub mod cdt {
796783
}
797784
fn extent__write__file__start(job_id: u64, extent_id: u32, n_blocks: u64) {}
798785
fn extent__write__file__done(job_id: u64, extent_id: u32, n_blocks: u64) {}
799-
fn extent__write__sqlite__insert__start(
800-
job_id: u64,
801-
extent_id: u32,
802-
n_blocks: u64,
803-
) {
804-
}
805-
fn extent__write__sqlite__insert__done(
806-
job_id: u64,
807-
extent_id: u32,
808-
n_blocks: u64,
809-
) {
810-
}
811786
fn extent__write__raw__context__insert__start(
812787
job_id: u64,
813788
extent_id: u32,

downstairs/src/region.rs

+2-6
Original file line numberDiff line numberDiff line change
@@ -156,11 +156,7 @@ impl Region {
156156
}
157157
};
158158

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

174170
if number_of_files_limit < required_number_of_files {
175171
bail!("this downstairs cannot open all required files!");

tools/dtrace/perf-downstairs-finegrain-extent-timings.d

-27
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,6 @@
44
* - Total time to flush
55
* - Time to flush the OS file handle
66
* - Time to re-read the file from disk to re-hash (may be removed later)
7-
* - Time to insert new hashes into sqlite DB
87
*/
98

109

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

36-
crucible_downstairs*:::extent-flush-sqlite-insert-start
37-
{
38-
extent_flush_sqlite_insert_start[pid,arg0,arg1] = timestamp;
39-
}
40-
4135

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

64-
crucible_downstairs*:::extent-flush-sqlite-insert-done
65-
/extent_flush_sqlite_insert_start[pid,arg0,arg1]/
66-
{
67-
@time["flush_sqlite_insert"] = quantize((timestamp - extent_flush_sqlite_insert_start[pid,arg0,arg1]) / arg2);
68-
extent_flush_sqlite_insert_start[pid,arg0,arg1] = 0;
69-
}
70-
7158

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

90-
crucible_downstairs*:::extent-write-sqlite-insert-start
91-
{
92-
extent_write_sqlite_insert_start[pid,arg0,arg1] = timestamp;
93-
}
94-
9577

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

118-
crucible_downstairs*:::extent-write-sqlite-insert-done
119-
/extent_write_sqlite_insert_start[pid,arg0,arg1]/
120-
{
121-
@time["write_sqlite_insert"] = quantize((timestamp - extent_write_sqlite_insert_start[pid,arg0,arg1]) / arg2);
122-
extent_write_sqlite_insert_start[pid,arg0,arg1] = 0;
123-
}
124-
125-
126-
127100

128101
/*
129102
* reads

upstairs/src/client.rs

+1-3
Original file line numberDiff line numberDiff line change
@@ -2967,9 +2967,7 @@ pub(crate) fn validate_encrypted_read_response(
29672967
// data that is returned. Due to the fact that nonces are
29682968
// random for each write, even if the Guest wrote the
29692969
// same data block 100 times, only one index will be
2970-
// valid. The sqlite backend will return any number of block
2971-
// contexts, where the raw file backend will only return
2972-
// one (because it knows the active slot).
2970+
// valid.
29732971
//
29742972
// If the computed integrity hash matched but decryption
29752973
// failed, continue to the next contexts. the current

0 commit comments

Comments
 (0)