Skip to content
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

internal/driver: Fix off-by-one error with max volume attachments #184

Merged
merged 1 commit into from
Jul 4, 2024

Conversation

nesv
Copy link
Contributor

@nesv nesv commented Jul 3, 2024

When calculating the maximum number of allowed volume attachments, the code was previously taking the ideal maximum number of volumes that could be attached to a node. The way the attachment was calculated, it treated instance disks the same as volumes, which is not correct.

This commit fixes what is effectively an off-by-one error, by subtracting the number of instance disks from the theoretical maximum number of block devices that can be attached to the instance.

In other words, controller and node servers will now report the number of block storage volumes that can be attached, not just block devices.

Fixes #182

@nesv nesv added the bugfix for any bug fixes in the changelog. label Jul 3, 2024
@nesv nesv self-assigned this Jul 3, 2024
@nesv nesv requested review from a team as code owners July 3, 2024 19:09
@nesv nesv force-pushed the bugfix.attachment-off-by-one branch from 726d7d6 to 4c7b258 Compare July 3, 2024 19:33
@nesv
Copy link
Contributor Author

nesv commented Jul 3, 2024

Squashed fixup commits.

@nesv nesv requested a review from AshleyDumaine July 3, 2024 19:58
Copy link
Contributor

@AshleyDumaine AshleyDumaine left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

When calculating the maximum number of allowed volume attachments, the
code was previously taking the ideal maximum number of volumes that
could be attached to a node. The way the attachment was calculated, it
treated instance disks the same as volumes, which is not correct.

This commit fixes what is effectively an off-by-one error, by
subtracting the number of instance disks from the theoretical maximum
number of block devices that can be attached to the instance.

In other words, controller and node servers will now report the number
of block storage volumes that can be attached, not just block devices.

Fixes #182
@nesv nesv force-pushed the bugfix.attachment-off-by-one branch from abf376e to 06ed6c3 Compare July 3, 2024 20:23
@nesv
Copy link
Contributor Author

nesv commented Jul 3, 2024

Squashed fixup commits (again).

Copy link
Collaborator

@rahulait rahulait left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@nesv nesv merged commit ae3291f into main Jul 4, 2024
3 checks passed
@nesv nesv deleted the bugfix.attachment-off-by-one branch July 4, 2024 14:50
@komer3 komer3 mentioned this pull request Nov 20, 2024
10 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bugfix for any bug fixes in the changelog.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Linodes cannot mount more than 7 PVC on instances with 8GB or less.
4 participants