-
Notifications
You must be signed in to change notification settings - Fork 159
Fix chunksize bug for large cache size in data cache #1954
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
Conversation
4e1cdf2
to
9310f46
Compare
302dd6c
to
6457742
Compare
6457742
to
5ec6f7f
Compare
5ec6f7f
to
9caddd5
Compare
expChunkSize: "160KiB", //range defined in fetchChunkSizeKiB - min 160 KiB | ||
expErr: true, | ||
}, | ||
// cacheSize is validated in storage class parameter so assuming invalid cacheSize (like negative, 0) would not be passed to the function |
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.
Does cacheSize in StorageClass has the >=0 check? In the past there were bugs in Hyperdisk SC parameters that actually take in < 0 params. Though an error will be returned from GCE.
/retest |
9caddd5
to
590aa70
Compare
pkg/common/utils.go
Outdated
@@ -713,6 +713,13 @@ func ValidateDataCacheMode(s string) error { | |||
return fmt.Errorf("invalid data-cache-mode %s. Only \"writeback\" and \"writethrough\" is a valid input", s) | |||
} | |||
|
|||
func ValidateDataCacheSize(size int64) error { |
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.
This can be a more generic function like ValidateNonNegativeInt, it can be used in a few other places. "Input should be set to > 0, got %d".
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.
And unit tests.
590aa70
to
afed99b
Compare
/lgtm |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: Sneha-at, sunnylovestiramisu 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 |
afed99b
to
e94c263
Compare
/lgtm |
/test pull-gcp-compute-persistent-disk-csi-driver-verify |
@Sneha-at: The following tests failed, say
Full PR test history. Your PR dashboard. Please help us cut down on flakes by linking to an open issue when you hit one in your PR. 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-sigs/prow repository. I understand the commands that are listed here. |
/test pull-gcp-compute-persistent-disk-csi-driver-kubernetes-integration |
The k8s integration failure is only the known snapshot flake, I'll force-merge |
What type of PR is this?
What this PR does / why we need it:
Data cache : Setting up caching would error out for large cache size as LVM has a limit on number of chunks that could be used, this PR fixes that issue by calculating dynamic cache size
Which issue(s) this PR fixes:
Fixes #
Internal error, unreleased feature
Special notes for your reviewer:
Does this PR introduce a user-facing change?: