Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
81 commits
Select commit Hold shift + click to select a range
082c009
[nexus] Refactor test-utilities to helper crate, add test benchmarks
smklein Dec 8, 2021
444aaa0
No need to be screamy about disk posting, that's for another PR
smklein Dec 8, 2021
42727a7
Optimize CRDB setup by using 'compile-time' population of a seed data…
smklein Dec 8, 2021
d1c1345
Merge branch 'main' into benchmark-tests
smklein Dec 8, 2021
54b6f68
Add to top-level workspace
smklein Dec 9, 2021
6850f67
Merge branch 'benchmark-tests' into optimize-crdb-setup
smklein Dec 9, 2021
c736fe0
Add some explanations
smklein Dec 9, 2021
05aed1b
re-run if build.rs changes
smklein Dec 9, 2021
304d03d
The temporary directory might not exist
smklein Dec 9, 2021
61d3fd3
Merge branch 'main' into benchmark-tests
smklein Dec 9, 2021
a992ee8
Merge branch 'benchmark-tests' into optimize-crdb-setup
smklein Dec 9, 2021
c5427aa
proby dropshot
smklein Dec 9, 2021
fea3cd9
Remove test-utils from default workspace
smklein Dec 9, 2021
0153e19
Download database executables *before* we build/test all targets
smklein Dec 9, 2021
0bcdc28
Merge branch 'main' into benchmark-tests
smklein Dec 9, 2021
52b31c6
Merge branch 'benchmark-tests' into optimize-crdb-setup
smklein Dec 9, 2021
a0c88a4
Adjust path when building, we want that executable for our build script
smklein Dec 9, 2021
56718af
Add skeleton of saga-based structure
smklein Dec 9, 2021
a00cd7c
Skeleton of test
smklein Dec 9, 2021
43b75c9
Merge branch 'main' into benchmark-tests
smklein Dec 9, 2021
3dd98d8
Merge branch 'benchmark-tests' into optimize-crdb-setup
smklein Dec 9, 2021
419d89e
Merge branch 'main' into benchmark-tests
smklein Dec 9, 2021
7b9dc1b
Merge branch 'benchmark-tests' into optimize-crdb-setup
smklein Dec 9, 2021
9ad763c
Merge branch 'main' into optimize-crdb-setup
smklein Dec 9, 2021
1b19c57
fixup
smklein Dec 9, 2021
4f9feef
review feedback
smklein Dec 9, 2021
8eb0549
OUT of the default members again gah
smklein Dec 9, 2021
e8a5f91
Merge branch 'main' into optimize-crdb-setup
smklein Dec 10, 2021
dcec64c
Merge branch 'optimize-crdb-setup' into regions
smklein Dec 10, 2021
0d673ba
... allocation query still WIP
smklein Dec 10, 2021
ee3dee7
Merge branch 'main' into regions
smklein Dec 13, 2021
95be792
Still workin towards a test
smklein Dec 14, 2021
0276b73
Unit test OK
smklein Dec 14, 2021
39aa5b9
Add 'below threshold' test
smklein Dec 14, 2021
7911388
First steps towards txn
smklein Dec 15, 2021
388a0b8
Merge branch 'main' into regions
smklein Dec 17, 2021
f8a191f
Merge branch 'main' into regions (... merged, not necessarily compiling)
smklein Dec 21, 2021
ab2bf3a
Txns now compiling w/better errors, woo
smklein Dec 21, 2021
cad0df6
Merge branch 'main' into regions
smklein Dec 27, 2021
1b1510c
making requests to crucible agent
smklein Dec 28, 2021
8bc078c
Allocations now requested in parallel
smklein Dec 28, 2021
285dd04
fmt
smklein Dec 28, 2021
ee84a12
Plumbing log
smklein Dec 28, 2021
fa1691b
More fleshed out simulated server (still just a HashMap)
smklein Jan 3, 2022
e38bb4a
Fix broken test (test_region_allocation_not_enough_datasets)
smklein Jan 3, 2022
48f3488
fmt
smklein Jan 3, 2022
e497dd3
Heyo, the disk integration tests are passing
smklein Jan 3, 2022
d459cab
Idempotent region allocation, adding undo saga actions, more tests
smklein Jan 6, 2022
291f3da
Cleaned up integration tests for disks
smklein Jan 6, 2022
f8bb5cf
Merge branch 'main' into regions
smklein Jan 6, 2022
ad1defd
fmt
smklein Jan 6, 2022
cfb923c
Cleanup comments
smklein Jan 6, 2022
c3bd755
Make use of the #derive(JsonSchema) addition to progenitor
smklein Jan 7, 2022
5d488af
Merge branch 'main' into regions
smklein Jan 13, 2022
124fbad
Add indices
smklein Jan 14, 2022
830c254
Add an Explainable trait to EXPLAIN Diesel statements
smklein Jan 14, 2022
23fc024
fmt
smklein Jan 14, 2022
067c97c
Add tests
smklein Jan 14, 2022
3f16a4b
Merge branch 'main' into regions
smklein Jan 14, 2022
014f4fc
Merge branch 'main' into explain
smklein Jan 14, 2022
1ce9c6a
Testing queries
smklein Jan 14, 2022
d984e48
Merge branch 'explain' into regions
smklein Jan 14, 2022
d574f67
review feedback
smklein Jan 17, 2022
49e9429
Merge branch 'main' into explain
smklein Jan 18, 2022
f777cf0
Merge, fix authz checks/test
smklein Jan 19, 2022
20eaafa
Implement QueryID
smklein Jan 19, 2022
fac6456
Merge branch 'explain' into regions
smklein Jan 19, 2022
18add71
Make explained Queries work (requiring QueryId), update tests, fmt
smklein Jan 19, 2022
39d2c6b
logs, idempotency, and setting concurrency limits
smklein Jan 19, 2022
64ad4f2
extent_size -> blocks_per_extent (everywhere but sled-agent/, which i…
smklein Jan 19, 2022
e893253
Store used size of datasets, fix indices, avoid full table scans
smklein Jan 20, 2022
91c3965
Merge branch 'main' into explain
smklein Jan 21, 2022
2d918fb
Add expectorate
smklein Jan 21, 2022
08bcfdc
I forgot to EXPECTORATE the right newline
smklein Jan 21, 2022
36201b9
Merge branch 'explain' into regions
smklein Jan 21, 2022
5664434
Merge branch 'regions' into use-json-schema
smklein Jan 21, 2022
8e2f3a5
Update deps, rely on new implied JsonSchema derives
smklein Jan 21, 2022
2d337a4
Merge branch 'main' into regions
smklein Jan 21, 2022
d06cc75
Merge branch 'use-json-schema' into regions
smklein Jan 21, 2022
c24a46e
Clarifying comment
smklein Jan 21, 2022
e2df003
Merge branch 'main' into regions
smklein Jan 24, 2022
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions Cargo.lock

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

10 changes: 5 additions & 5 deletions common/src/api/external/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -399,7 +399,7 @@ impl JsonSchema for RoleName {
* the database as an i64. Constraining it here ensures that we can't fail to
* serialize the value.
*/
#[derive(Copy, Clone, Debug, Deserialize, Serialize, JsonSchema)]
#[derive(Copy, Clone, Debug, Deserialize, Serialize, JsonSchema, PartialEq)]
pub struct ByteCount(u64);

impl ByteCount {
Expand Down Expand Up @@ -468,8 +468,8 @@ impl From<u32> for ByteCount {
}
}

impl From<&ByteCount> for i64 {
fn from(b: &ByteCount) -> Self {
impl From<ByteCount> for i64 {
fn from(b: ByteCount) -> Self {
/* We have already validated that this value is in range. */
i64::try_from(b.0).unwrap()
}
Expand Down Expand Up @@ -2072,12 +2072,12 @@ mod test {
/* Largest supported value: both constructors that support it. */
let max = ByteCount::try_from(i64::MAX).unwrap();
assert_eq!(i64::MAX, max.to_bytes() as i64);
assert_eq!(i64::MAX, i64::from(&max));
assert_eq!(i64::MAX, i64::from(max));

let maxu64 = u64::try_from(i64::MAX).unwrap();
let max = ByteCount::try_from(maxu64).unwrap();
assert_eq!(i64::MAX, max.to_bytes() as i64);
assert_eq!(i64::MAX, i64::from(&max));
assert_eq!(i64::MAX, i64::from(max));
assert_eq!(
(i64::MAX / 1024 / 1024 / 1024 / 1024) as u64,
max.to_whole_tebibytes()
Expand Down
21 changes: 18 additions & 3 deletions common/src/sql/dbinit.sql
Original file line number Diff line number Diff line change
Expand Up @@ -105,13 +105,21 @@ CREATE TABLE omicron.public.Dataset (
/* FK into the Pool table */
pool_id UUID NOT NULL,

/* Contact information for the downstairs region */
/* Contact information for the dataset */
ip INET NOT NULL,
port INT4 NOT NULL,

kind omicron.public.dataset_kind NOT NULL
kind omicron.public.dataset_kind NOT NULL,

/* An upper bound on the amount of space that might be in-use */
size_used INT
);

/* Create an index on the size usage for Crucible's allocation */
CREATE INDEX on omicron.public.Dataset (
size_used
) WHERE size_used IS NOT NULL AND time_deleted IS NULL AND kind = 'crucible';

/*
* A region of space allocated to Crucible Downstairs, within a dataset.
*/
Expand All @@ -129,10 +137,17 @@ CREATE TABLE omicron.public.Region (

/* Metadata describing the region */
block_size INT NOT NULL,
extent_size INT NOT NULL,
blocks_per_extent INT NOT NULL,
extent_count INT NOT NULL
);

/*
* Allow all regions belonging to a disk to be accessed quickly.
*/
CREATE INDEX on omicron.public.Region (
disk_id
);

/*
* Organizations
*/
Expand Down
3 changes: 2 additions & 1 deletion nexus/Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,11 @@ path = "../rpaths"

[dependencies]
anyhow = "1.0"
async-bb8-diesel = { git = "https://github.com/oxidecomputer/async-bb8-diesel", rev = "c849b717be" }
async-trait = "0.1.51"
bb8 = "0.7.1"
async-bb8-diesel = { git = "https://github.com/oxidecomputer/async-bb8-diesel", rev = "c849b717be" }
cookie = "0.16"
crucible-agent-client = { git = "https://github.com/oxidecomputer/crucible", rev = "078d364e14d57d5faa3a44001c65709935419779" }
# Tracking pending 2.0 version.
diesel = { git = "https://github.com/diesel-rs/diesel", rev = "ce77c382", features = ["postgres", "r2d2", "chrono", "serde_json", "network-address", "uuid"] }
futures = "0.3.18"
Expand Down
Loading