Skip to content

[API] Bounds-check that disks are a minimum size, and use a minimum granularity size #1029

Closed

Description

@smklein

e.g., "256 MB", or "1 GB".

Ultimately the choice is kinda arbitrary (beyond a certain size / alignment), but we should definitely be picking something larger than "a byte" for both!

Activity

  1. added
    api
    nexus
    Good for new hires
    on May 6, 2022
  2. ryaeng commented on Jun 2, 2022

    @ryaeng
    Contributor

    @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

  3. ryaeng commented on Jun 2, 2022

    @ryaeng
    Contributor

    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?

  4. smklein commented on Jun 3, 2022

    @smklein
    CollaboratorAuthor

    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.

  5. smklein commented on Jun 3, 2022

    @smklein
    CollaboratorAuthor

    Also, FYI to @karencfv who has been doing some work on setting constraints on size minimums / granularities recently.

  6. ryaeng commented on Jun 3, 2022

    @ryaeng
    Contributor

    Sean, thanks for the update. I'll pull those assertions and get this committed and submit the pull request.

    Thanks.

  7. ryaeng commented on Jun 6, 2022

    @ryaeng
    Contributor

    Sean, I have submitted pull requests for #1029 & #1030. Are you able to review and provide feedback?

  8. smklein commented on Jun 9, 2022

    @smklein
    CollaboratorAuthor

    Fixed by #1150

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Good for new hiresapinexus

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions