-
Notifications
You must be signed in to change notification settings - Fork 39
OCPBUGS-63348: Fix capacity calculation #184
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
c183655 to
2ce7584
Compare
8379c29 to
06577fe
Compare
|
@kyrtapz: This pull request references Jira Issue OCPBUGS-63348, which is invalid:
Comment The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
b71c9a0 to
394540b
Compare
394540b to
939fac2
Compare
|
/jira refresh |
|
@kyrtapz: This pull request references Jira Issue OCPBUGS-63348, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/verified by 'Pre-merge testing' |
|
@huiran0826: This PR has been marked as verified by In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
| // Include CPICs where spec.node OR status.node matches to handle transitions | ||
| cpicIPs := sets.New[string]() | ||
| for _, cloudPrivateIPConfig := range cloudPrivateIPConfigs { | ||
| if isAssignedCloudPrivateIPConfigOnNode(cloudPrivateIPConfig, key) { |
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.
you may remove isAssignedCloudPrivateIPConfigOnNode method which is no longer needed.
| if isAssignedCloudPrivateIPConfigOnNode(cloudPrivateIPConfig, key) { | ||
| cloudPrivateIPConfigs[index] = cloudPrivateIPConfig | ||
| index++ | ||
| if cloudPrivateIPConfig.Spec.Node == key || cloudPrivateIPConfig.Status.Node == key { |
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.
Nit: If capacity is just about excluding only IPs_consumed_by_non_CPIC_sources from the limit, why can't we just pass all cloudPrivateIPConfigs to GetNodeEgressIPConfiguration method for simplicity ?
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 would mean the same logic would have to be copied across all of the implementations. Doing it the way we have here avoids it.
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.
i meant to check assignedIP with all cpicIPs, but anyway this also looks fine.
| g.nodeMapLock.Lock() | ||
| defer g.nodeMapLock.Unlock() | ||
| if _, ok := g.nodeLockMap[nodeName]; !ok { | ||
| g.nodeLockMap[nodeName] = &sync.Mutex{} |
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.
shouldn't cleanup the lock when node is deleted ?
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.
That's a valid point. Done(added it for azure as well).
The previous capacity calculation incorrectly only counted CloudPrivateIPConfigs that had the status set. This is racy and can lead to artificially reduced capacity. Fix it by accounting for all CloudPrivateIPConfigs that are or were assigned to the matching node. Change the calculation in openstack to only consider IPs that were assigned to the port by using `allowed_address_pairs`. Signed-off-by: Patryk Diak <[email protected]>
To avoid the following error being returned when trying to add/remove multiple IPs at once: err: googleapi: Error 412: Invalid fingerprint. From the docs: The request will fail with error 400 Bad Request if the fingerprint is not provided, or 412 Precondition Failed if the fingerprint is out of date. Signed-off-by: Patryk Diak <[email protected]>
Signed-off-by: Patryk Diak <[email protected]>
939fac2 to
f6b12fd
Compare
WalkthroughThis pull request refactors CloudPrivateIPConfig parameter handling across cloud provider implementations by replacing slice-based inputs with set-based IP collections. The changes include parameter signature updates in AWS, Azure, GCP, and OpenStack providers, addition of Changes
Estimated code review effort🎯 4 (Complex) | ⏱️ ~60 minutes
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit UI Review profile: CHILL Plan: Pro Cache: Disabled due to data retention organization setting Knowledge base: Disabled due to 📒 Files selected for processing (8)
🔇 Additional comments (1)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.5.0)Error: can't load config: unsupported version of the configuration: "" See https://golangci-lint.run/docs/product/migration-guide for migration instructions Comment |
|
/verified |
|
@huiran0826: The In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/verified by @huiran0826 |
|
@huiran0826: This PR has been marked as verified by In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/test hypershift-e2e-aks |
|
/lgtm |
|
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: kyrtapz, pperiyasamy 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 |
|
/override ci/prow/hypershift-e2e-aks |
|
@kyrtapz: Overrode contexts on behalf of kyrtapz: ci/prow/hypershift-e2e-aks In response to this:
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. |
|
@kyrtapz: 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-sigs/prow repository. I understand the commands that are listed here. |
a179997
into
openshift:main
|
@kyrtapz: Jira Issue Verification Checks: Jira Issue OCPBUGS-63348 Jira Issue OCPBUGS-63348 has been moved to the MODIFIED state and will move to the VERIFIED state when the change is available in an accepted nightly payload. 🕓 In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
|
/cherry-pick release-4.20 |
|
@kyrtapz: new pull request created: #188 In response to this:
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. |
The previous capacity calculation incorrectly only counted CloudPrivateIPConfigs that had the status set.
This is racy and can lead to artificially reduced capacity.
Fix it by accounting for all CloudPrivateIPConfigs that are or were assigned to the matching node.