You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[API] Bounds-check that disks are a minimum size, and use a minimum granularity size #1029
Ultimately the choice is kinda arbitrary (beyond a certain size / alignment), but we should definitely be picking something larger than "a byte" for both!
Hey Ryan - the purpose of those assertions (which I assume were taken from test_disk_region_creation_failure) was to validate that the "physical" storage from our storage service is sufficiently large to allocate "virtual" storage.
This storage system currently uses "triplicate replication" - for 1 GiB of user data, we will store 3 GiB of physical data, ideally on three separate disks, for purposes of redundancy.
That second assertion was there specifically because that specific test wants to try to allocate when we want to store "disk size" bytes, but only have "2 x disk size" physical space of bytes. The test validates that the allocation fails - as it should - because we don't have enough space for replication.
I consider that specific check to be pretty test-specific -- for most disk tests, it should be fine to comfortably let the "zpool size" be much larger than the disks being allocated. That seems particularly true for this current issue, where bounds on user-inputs should be pretty unrelated to the amount of physical backing storage we can use.
Activity
ryaeng commentedon Jun 2, 2022
@smklein I'm working on this one. I have the conditional written to check that the disk is at least one gibibyte in size.
The problem that I'm running into is that I cannot get my test to pass. It continues failing on the asset at line 14.
https://gist.github.com/ryaeng/254cfae43b0ca676849374adc274e87d
ryaeng commentedon Jun 2, 2022
I have figured it out. It is actually hitting that case, which I simply borrowed from a previous test.
I can do one of two things. I can reduce zpool_size to 5 GiB or I can remove the assertions all together.
Thoughts?
smklein commentedon Jun 3, 2022
Hey Ryan - the purpose of those assertions (which I assume were taken from test_disk_region_creation_failure) was to validate that the "physical" storage from our storage service is sufficiently large to allocate "virtual" storage.
This storage system currently uses "triplicate replication" - for 1 GiB of user data, we will store 3 GiB of physical data, ideally on three separate disks, for purposes of redundancy.
That second assertion was there specifically because that specific test wants to try to allocate when we want to store "disk size" bytes, but only have "2 x disk size" physical space of bytes. The test validates that the allocation fails - as it should - because we don't have enough space for replication.
I consider that specific check to be pretty test-specific -- for most disk tests, it should be fine to comfortably let the "zpool size" be much larger than the disks being allocated. That seems particularly true for this current issue, where bounds on user-inputs should be pretty unrelated to the amount of physical backing storage we can use.
smklein commentedon Jun 3, 2022
Also, FYI to @karencfv who has been doing some work on setting constraints on size minimums / granularities recently.
ryaeng commentedon Jun 3, 2022
Sean, thanks for the update. I'll pull those assertions and get this committed and submit the pull request.
Thanks.
[API] Bounds-check that disks are a minimum size, and use a minimum g…
[API] Bounds-check that disks are a minimum size, and use a minimum g…
ryaeng commentedon Jun 6, 2022
Sean, I have submitted pull requests for #1029 & #1030. Are you able to review and provide feedback?
[API] Bounds-check that disks are a minimum size, and use a minimum g…
smklein commentedon Jun 9, 2022
Fixed by #1150