-
Notifications
You must be signed in to change notification settings - Fork 125
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
Change container_quota_items float columns to decimals #151
Conversation
@chessbyte you approved this schema change, right? |
I believe he approved to go into gaprindashvili but not the PR itself (wasn't sure what you meant by "approved") |
Code-wise LGTM 👍 |
Yes, if this is backported to gap we would also need to bring back the corresponding data migration. Once we cut gaprindashvili, then we can't backport migrations anymore. |
Oops, I omitted in PR description what "would be simpler & faster" and "would need data migration". I don't like that, not at this point, concerned we'd miss off-by-1000x bugs in other places... Decimal is overkill but conceptually clean Right way to do it. "Last-moment feature, correct, fast — pick at most 2"... |
Ah ok, so then this is ready to go? |
Let me test this without the other PRs. I think existing refresh that doesn't archive yet would work with decimal just as well but need to confirm. |
Fixes ManageIQ/manageiq-providers-kubernetes#208 Kubernetes quotas are mostly integers but cpu-related quotas are in "millicores", multiples of 0.001. With decimal columns, we'll be able to round-trip quotas exactly to DB and back to Ruby, so refresh can determine whether they changed or not. https://bugzilla.redhat.com/show_bug.cgi?id=1504560
Checked commit cben@06227a5 with ruby 2.3.3, rubocop 0.52.0, haml-lint 0.20.0, and yamllint 1.10.0 |
Rebased and updated timestamp in file name to stay in-order. I believe this is safe to merge without any code changes.
|
@Fryguy all tested. |
Change container_quota_items float columns to decimals (cherry picked from commit 909736e)
Gaprindashvili backport details:
|
@Fryguy @agrare @Ladas @moolitayer @zeari @bazulay
I'm told this might still be possible for gaprindashvili?!
Fixes ManageIQ/manageiq-providers-kubernetes#208
Kubernetes quotas are mostly integers but cpu-related quotas are
in "millicores", multiples of 0.001.
With decimal columns, we'll be able to round-trip quotas exactly to DB
and back to Ruby, so refresh can determine whether they changed or not.
(requires couple more code changes, but this fixes the deep root problem)
https://bugzilla.redhat.com/show_bug.cgi?id=1504560
Let's not merge until I have all pieces together, but this does allow the exact fraction to come back to Ruby.
TODO: tests demonstrating what happens to existing values.
TODO: benchmark on lots of data.
Alternative NOT TAKEN: fixed-point integer column (5 would mean 5milli) ?
Some of you said that'd simpler and faster.
We wouldn't want all quotas scaled (memory in millibytes, number of pods in millipods...) but only scale CPU in millicores.