-
Notifications
You must be signed in to change notification settings - Fork 45
Fail if there isn't available space for a disk #1231
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
jmpesp
merged 14 commits into
oxidecomputer:main
from
jmpesp:not_enough_available_space
Aug 26, 2022
Merged
Changes from all commits
Commits
Show all changes
14 commits
Select commit
Hold shift + click to select a range
88023d9
Fail if there isn't available space for a disk
jmpesp 1b4a03b
rename method to test_disk_backed_by_multiple_region_sets
jmpesp ce62445
add test_disk_size_accounting
jmpesp b333434
Merge remote-tracking branch 'upstream/main'
jmpesp 9940fc1
add TryFrom<diesel::pg::data_types::PgNumeric> for ByteCount
jmpesp a601010
fmt
jmpesp 797fbde
update diesel-dtrace
jmpesp 84d6d0a
add conversions for i64 + fmt
jmpesp 7b5686f
Compute size_used using query inside transaction
jmpesp da3cdcd
fmt
jmpesp 4f8cc65
Merge remote-tracking branch 'upstream/main' into not_enough_availabl…
jmpesp c2e713a
set DiskTest::DEFAULT_ZPOOL_SIZE_GIB, and assert test conditions to m…
jmpesp 181c5d0
make sure all dataset's size_used does not exceed zpool total_size
jmpesp 86422ce
nexus-db-model now requires pq-sys (and rpath fix)
jmpesp File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Oops, something went wrong.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
// This Source Code Form is subject to the terms of the Mozilla Public | ||
// License, v. 2.0. If a copy of the MPL was not distributed with this | ||
// file, You can obtain one at https://mozilla.org/MPL/2.0/. | ||
|
||
// See omicron-rpaths for documentation. | ||
// NOTE: This file MUST be kept in sync with the other build.rs files in this | ||
// repository. | ||
fn main() { | ||
omicron_rpaths::configure_default_omicron_rpaths(); | ||
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason to do the conversion to/from the
PgNumeric
type specifically? Why not the https://docs.diesel.rs/master/diesel/sql_types/struct.Numeric.html type? (coping with individual digits at a time seems like a pain in the butt)There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is a pain, but I don't see a way to chain
Into
orFrom
here to go from eitherPgNumeric
orNumeric
into i64.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Taking a step back - I don't just mean this function. I mean, why are we using
PgNumeric
in the db? There are other DB types which could be used instead here, like https://docs.diesel.rs/master/diesel/sql_types/struct.BigInt.html , if you're just going to / from i64.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We're not using
PgNumeric
in the db - as far as I understand,diesel::sql_types::Numeric
is being returned due to the use of the sum. Trying to use any other type, I kept running into errors likeand eventually just went with
PgNumeric
because I could get at the enum variants to actually turn it intoByteCount
.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
smallint
/integer
/bigint
implies "this is an integer, of a particular size""byte count" seems like it should be an integer, not a variable-precision number, right?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also, AFAICT:
sum
acts on types which areFoldable
Foldable
is implemented for the integer types: https://docs.diesel.rs/master/diesel/sql_types/trait.Foldable.html#impl-Foldable-for-BigIntThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Right but if I follow the Foldable link to the source, I see
which I think means that the sum widens the type from BigInt to Numeric?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
got it. Okay, don't hold up the PR on this point. I think we're in agreement that "it would be nice if bytes could be integer types", but if the implicit SQL conversions make that difficult, we can punt on it.
(But dang, would be nice if we could coerce them to stay as integer-based types!)