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
Refactor device tuning code #946
Refactor device tuning code #946
Conversation
throttleDiskTypes --> knownSlowDiskTypes throttleFastDiskTypes --> knownFastDiskTypes This is just what it is about. Signed-off-by: Michael Adam <obnox@redhat.com>
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.
/lgtm
Instead of having a list of known fast devices, and a list of known slow devices, and hard-coding in the throttleStorageDevices function for which provisioner each list is applicable, create known disk type that encapsulates the provisioner, storage class name and whether this is known to be fast or slow. The function then just becomes a simple loop. IMHO, this makes the code much more obvious and easier to extend in the future. Signed-off-by: Michael Adam <obnox@redhat.com>
Signed-off-by: Michael Adam <obnox@redhat.com>
This function is not throttling anything. It is checking whether corresponding devices should be marked for explicit tuning for rook. Signed-off-by: Michael Adam <obnox@redhat.com>
Signed-off-by: Michael Adam <obnox@redhat.com>
Signed-off-by: Michael Adam <obnox@redhat.com>
Signed-off-by: Michael Adam <obnox@redhat.com>
…f list of bools Returning two booleans is not a robust API. This changes checkTuneStorageDevices to return the speed instead. Thus, the caller can take action based on the returned device. Signed-off-by: Michael Adam <obnox@redhat.com>
a21ce3c
to
b1e0233
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jarrpa The full list of commands accepted by this bot can be found here. The pull request process is described here
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
@obnoxxx: The following test failed, say
Full PR test history. Your PR dashboard. Instructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the kubernetes/test-infra repository. I understand the commands that are listed here. |
Reviewing PR #864 made me consider the naming of functions and variables and the structure of functions. I found it confusing that it talked about throttling internally and converted this to tuning toggles for rook, while ocs-operator is not doing any throttling. Furthermore, having two lists of fast and slow device storage classes, but having the the detection function hardcode which provisioner to apply each list against did not seem very intuitive and robust to me.
This PR refactors the code to be (IMHO) more obvious and more prone to future expansions of known devices.