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

Refactor device tuning code #946

Merged

Conversation

obnoxxx
Copy link
Contributor

@obnoxxx obnoxxx commented Dec 7, 2020

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.

throttleDiskTypes     --> knownSlowDiskTypes
throttleFastDiskTypes --> knownFastDiskTypes

This is just what it is about.

Signed-off-by: Michael Adam <obnox@redhat.com>
Copy link
Member

@jarrpa jarrpa left a comment

Choose a reason for hiding this comment

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

/lgtm

@openshift-ci-robot openshift-ci-robot added lgtm Indicates that a PR is ready to be merged. approved Indicates a PR has been approved by an approver from all required OWNERS files. labels Dec 7, 2020
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>
@openshift-ci-robot openshift-ci-robot removed the lgtm Indicates that a PR is ready to be merged. label Dec 7, 2020
@jarrpa
Copy link
Member

jarrpa commented Dec 7, 2020

/lgtm

@openshift-ci-robot openshift-ci-robot added the lgtm Indicates that a PR is ready to be merged. label Dec 7, 2020
@openshift-ci-robot
Copy link

[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 /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@openshift-merge-robot
Copy link
Contributor

@obnoxxx: The following test failed, say /retest to rerun all failed tests:

Test name Commit Details Rerun command
ci/prow/red-hat-storage-ocs-ci-e2e-aws b1e0233 link /test red-hat-storage-ocs-ci-e2e-aws

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.

@openshift-merge-robot openshift-merge-robot merged commit 7b2a45e into red-hat-storage:master Dec 7, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
approved Indicates a PR has been approved by an approver from all required OWNERS files. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants