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

OCPBUGS-1348: Fix deleting machine affecting new machine failure domain #106

Merged
merged 1 commit into from Oct 3, 2022

Conversation

RadekManak
Copy link
Contributor

When failure domains are mapped onto indexes, we first try to assign failure domains of machines to indexes and after that we populate empty indexes with remaining failure domains. We iterate over indexes in ascending order to be consistent.

This caused a bug if you deleted a machine on index 0. The first thing that would happen is it would notice the deleting machine on index 0 and assign its failure domain to the index. Even if there were more machines with that failure domain over the maximum allowed.

To fix this, I have removed machines in deleting phase from affecting failure domain mapping.

@openshift-ci-robot openshift-ci-robot added the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Sep 29, 2022
@openshift-ci-robot
Copy link

@RadekManak: This pull request references Jira Issue OCPBUGS-1348, which is invalid:

  • expected the bug to target the "4.12.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

When failure domains are mapped onto indexes, we first try to assign failure domains of machines to indexes and after that we populate empty indexes with remaining failure domains. We iterate over indexes in ascending order to be consistent.

This caused a bug if you deleted a machine on index 0. The first thing that would happen is it would notice the deleting machine on index 0 and assign its failure domain to the index. Even if there were more machines with that failure domain over the maximum allowed.

To fix this, I have removed machines in deleting phase from affecting failure domain mapping.

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.

@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Sep 29, 2022
@RadekManak
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot
Copy link

@RadekManak: This pull request references Jira Issue OCPBUGS-1348, which is invalid:

  • expected the bug to target the "4.12.0" version, but it targets "4.12" instead

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

In response to this:

/jira refresh

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.

@RadekManak
Copy link
Contributor Author

/jira refresh

@openshift-ci-robot openshift-ci-robot added jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. labels Sep 29, 2022
@openshift-ci-robot
Copy link

@RadekManak: This pull request references Jira Issue OCPBUGS-1348, which is valid. The bug has been moved to the POST state.

3 validation(s) were run on this bug
  • bug is open, matching expected state (open)
  • bug target version (4.12.0) matches configured target version for branch (4.12.0)
  • bug is in the state ASSIGNED, which is one of the valid states (NEW, ASSIGNED, POST)

Requesting review from QA contact:
/cc @sunzhaohua2

In response to this:

/jira refresh

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.

@openshift-ci-robot openshift-ci-robot removed the jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. label Sep 29, 2022
Comment on lines +129 to +136
if pointer.StringDeref(machine.Status.Phase, "") == "Deleting" {
continue
}
Copy link
Contributor

Choose a reason for hiding this comment

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

What if the deleting machine is the only machine in the index, are we sure this is what we want?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

That's the case in the test. Without this change, the deleting machine gets matched to index 0 then indexes 1 and 2 get populated from base because failure domain "us-east-1a" is fully represented in deleting machine at index 0

With this change, it assigns index 1 to "us-east-1a" because there is a ready machine there. This swaps the failure domain in indexes 0 and 1 causing the candidate for index 0 to be "us-east-1b". Index 0 gets assigned "us-east-1b" because it is empty. Index 2 gets assigned "us-east-1c" because failure domain "us-east-1a" in that index is overrepresented.

This problem occurs only in the OnDelete strategy because the user deleted a machine that was considered healthy. In fact, they were all equally healthy, but the algorithm had to choose which ones are the superfluous.

@RadekManak
Copy link
Contributor Author

Fixed the linter errors.

@JoelSpeed
Copy link
Contributor

Have reviewed the bug and the code again and I can see why this makes sense
/lgtm
/approve

Good work here understanding the issue!

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 30, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 30, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: JoelSpeed

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 30, 2022
@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 025ef24 and 2 for PR HEAD 843cc27 in total

@openshift-ci-robot
Copy link

/retest-required

Remaining retests: 0 against base HEAD 43e48fe and 1 for PR HEAD 843cc27 in total

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 1, 2022

@RadekManak: The following test failed, say /retest to rerun all failed tests or /retest-required to rerun all mandatory failed tests:

Test name Commit Details Required Rerun command
ci/prow/e2e-aws-disruptive 843cc27 link false /test e2e-aws-disruptive

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.

@JoelSpeed
Copy link
Contributor

/override ci/prow/e2e-aws-serial

Known OVN failure, sending alerts because of 4 masters

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Oct 3, 2022

@JoelSpeed: Overrode contexts on behalf of JoelSpeed: ci/prow/e2e-aws-serial

In response to this:

/override ci/prow/e2e-aws-serial

Known OVN failure, sending alerts because of 4 masters

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.

@openshift-merge-robot openshift-merge-robot merged commit 6ac5cd3 into openshift:main Oct 3, 2022
@openshift-ci-robot
Copy link

@RadekManak: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-1348 has been moved to the MODIFIED state.

In response to this:

When failure domains are mapped onto indexes, we first try to assign failure domains of machines to indexes and after that we populate empty indexes with remaining failure domains. We iterate over indexes in ascending order to be consistent.

This caused a bug if you deleted a machine on index 0. The first thing that would happen is it would notice the deleting machine on index 0 and assign its failure domain to the index. Even if there were more machines with that failure domain over the maximum allowed.

To fix this, I have removed machines in deleting phase from affecting failure domain mapping.

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.

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. bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. jira/valid-bug Indicates that a referenced Jira bug is valid for the branch this PR is targeting. lgtm Indicates that a PR is ready to be merged. size/M Denotes a PR that changes 30-99 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

4 participants