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

MGMT-12970: don't reset auto-assign for irrelevant hosts #4891

Merged
merged 1 commit into from Jan 18, 2023

Conversation

slaviered
Copy link
Contributor

The monitor resets the 'suggested-role' field on all hosts of the clusters if one of the hosts is in auto-assign. This was done to eliminate race conditions between 'register host' and the calculation of auto-assign a synchronically in the monitor loop.

The reset may happen once in a lifetime of a host.

However, in production, we found several types of obsolete hosts mostly orphan ones that trigger that role clearance all the time

The amendment to the query does not reset the roles where the the auto-assign host is not relevant:

  • in status disabled (obsolete)
  • disconnected
  • day2 host (old hosts - current day 2 sets the role to a worker role before registering)
  • host stuck on discovering state

This PR, in combine with future improvements to GC code, will eliminate the spurious resets of auto-assign roles.

List all the issues related to this PR

  • New Feature
  • Enhancement
  • Bug fix
  • Tests
  • Documentation
  • CI/CD

What environments does this code impact?

  • Automation (CI, tools, etc)
  • Cloud
  • Operator Managed Deployments
  • None

How was this code tested?

  • assisted-test-infra environment
  • dev-scripts environment
  • Reviewer's test appreciated
  • Waiting for CI to do a full test run
  • Manual (Elaborate on how it was tested)
  • No tests needed

Checklist

  • Title and description added to both, commit and PR.
  • Relevant issues have been associated (see CONTRIBUTING guide)
  • This change does not require a documentation update (docstring, docs, README, etc)
  • Does this change include unit-tests (note that code changes require unit-tests)

Reviewers Checklist

  • Are the title and description (in both PR and commit) meaningful and clear?
  • Is there a bug required (and linked) for this change?
  • Should this PR be backported?

@openshift-ci openshift-ci bot added the size/M Denotes a PR that changes 30-99 lines, ignoring generated files. label Jan 12, 2023
@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 12, 2023
@codecov
Copy link

codecov bot commented Jan 12, 2023

Codecov Report

Merging #4891 (0a0ac44) into master (dd832d0) will decrease coverage by 0.15%.
The diff coverage is 100.00%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##           master    #4891      +/-   ##
==========================================
- Coverage   67.77%   67.63%   -0.15%     
==========================================
  Files         202      202              
  Lines       30100    30183      +83     
==========================================
+ Hits        20401    20414      +13     
- Misses       7892     7963      +71     
+ Partials     1807     1806       -1     
Impacted Files Coverage Δ
internal/host/monitor.go 81.48% <100.00%> (+3.63%) ⬆️
internal/network/utils.go 29.53% <0.00%> (-6.52%) ⬇️
...oller/controllers/clusterdeployments_controller.go 72.10% <0.00%> (-2.20%) ⬇️
internal/host/transition.go 50.69% <0.00%> (-1.07%) ⬇️
internal/cluster/validations/validations.go 24.95% <0.00%> (-0.66%) ⬇️
internal/host/common.go 88.88% <0.00%> (ø)
internal/host/statemachine.go 100.00% <0.00%> (ø)
internal/bminventory/inventory.go 69.92% <0.00%> (+0.08%) ⬆️
internal/network/manifests_generator.go 76.56% <0.00%> (+0.09%) ⬆️
internal/host/validator.go 81.77% <0.00%> (+0.17%) ⬆️
... and 5 more

@slaviered
Copy link
Contributor Author

/assign @ori-amizur

@slaviered
Copy link
Contributor Author

/test ci/prow/edge-subsystem-kubeapi-aws

@openshift-ci
Copy link

openshift-ci bot commented Jan 12, 2023

@slaviered: The specified target(s) for /test were not found.
The following commands are available to trigger required jobs:

  • /test e2e-agent-compact
  • /test edge-assisted-operator-catalog-publish-verify
  • /test edge-ci-index
  • /test edge-e2e-ai-operator-ztp
  • /test edge-e2e-ai-operator-ztp-sno-day2-workers
  • /test edge-e2e-ai-operator-ztp-sno-day2-workers-late-binding
  • /test edge-e2e-metal-assisted
  • /test edge-e2e-metal-assisted-4-10
  • /test edge-e2e-metal-assisted-4-11
  • /test edge-e2e-metal-assisted-4-12
  • /test edge-e2e-metal-assisted-4-8
  • /test edge-e2e-metal-assisted-4-9
  • /test edge-e2e-metal-assisted-cnv
  • /test edge-e2e-metal-assisted-lvm
  • /test edge-e2e-metal-assisted-ocs
  • /test edge-e2e-metal-assisted-odf
  • /test edge-images
  • /test edge-lint
  • /test edge-subsystem-aws
  • /test edge-subsystem-kubeapi-aws
  • /test edge-unit-test
  • /test edge-verify-generated-code
  • /test images
  • /test mce-images

The following commands are available to trigger optional jobs:

  • /test edge-e2e-ai-operator-ztp-3masters
  • /test edge-e2e-ai-operator-ztp-capi
  • /test edge-e2e-ai-operator-ztp-compact-day2-masters
  • /test edge-e2e-ai-operator-ztp-compact-day2-workers
  • /test edge-e2e-ai-operator-ztp-converged
  • /test edge-e2e-ai-operator-ztp-disconnected
  • /test edge-e2e-ai-operator-ztp-hypershift-zero-nodes
  • /test edge-e2e-ai-operator-ztp-ipv4v6-3masters
  • /test edge-e2e-ai-operator-ztp-ipv4v6-3masters-ocp-411
  • /test edge-e2e-ai-operator-ztp-ipv4v6-sno
  • /test edge-e2e-ai-operator-ztp-ipv4v6-sno-ocp-411
  • /test edge-e2e-ai-operator-ztp-multiarch-3masters-ocp-411
  • /test edge-e2e-ai-operator-ztp-multiarch-sno-ocp-411
  • /test edge-e2e-ai-operator-ztp-sno-day2-masters
  • /test edge-e2e-ai-operator-ztp-sno-day2-workers-ignitionoverride
  • /test edge-e2e-metal-assisted-day2
  • /test edge-e2e-metal-assisted-day2-single-node
  • /test edge-e2e-metal-assisted-ipv4v6
  • /test edge-e2e-metal-assisted-ipv6
  • /test edge-e2e-metal-assisted-kube-api-late-binding-single-node
  • /test edge-e2e-metal-assisted-kube-api-late-unbinding-ipv4-single-node
  • /test edge-e2e-metal-assisted-kube-api-net-suite
  • /test edge-e2e-metal-assisted-none
  • /test edge-e2e-metal-assisted-onprem
  • /test edge-e2e-metal-assisted-single-node
  • /test edge-e2e-metal-assisted-static-ip-suite
  • /test edge-e2e-metal-assisted-tang
  • /test edge-e2e-metal-assisted-tpmv2
  • /test edge-e2e-metal-assisted-upgrade-agent
  • /test edge-e2e-nutanix-assisted
  • /test edge-e2e-nutanix-assisted-2workers
  • /test edge-e2e-vsphere-assisted
  • /test edge-e2e-vsphere-assisted-umn
  • /test edge-push-pr-image
  • /test push-pr-image

Use /test all to run the following jobs that were automatically triggered:

  • pull-ci-openshift-assisted-service-master-e2e-agent-compact
  • pull-ci-openshift-assisted-service-master-edge-ci-index
  • pull-ci-openshift-assisted-service-master-edge-e2e-ai-operator-ztp
  • pull-ci-openshift-assisted-service-master-edge-e2e-metal-assisted
  • pull-ci-openshift-assisted-service-master-edge-images
  • pull-ci-openshift-assisted-service-master-edge-lint
  • pull-ci-openshift-assisted-service-master-edge-subsystem-aws
  • pull-ci-openshift-assisted-service-master-edge-subsystem-kubeapi-aws
  • pull-ci-openshift-assisted-service-master-edge-unit-test
  • pull-ci-openshift-assisted-service-master-edge-verify-generated-code
  • pull-ci-openshift-assisted-service-master-images
  • pull-ci-openshift-assisted-service-master-mce-images

In response to this:

/test ci/prow/edge-subsystem-kubeapi-aws

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.

@slaviered slaviered force-pushed the auto-assign-query branch 2 times, most recently from 80734b7 to 3f151ce Compare January 16, 2023 12:08
The monitor resets the 'suggested-role' field on all hosts of the clusters
if one of the hosts is in auto-assign. This was done to eliminate
race conditions between 'register host' and the calculation of auto-assign
a synchronically in the monitor loop.

The reset may happen once in a lifetime of a host.

However, in production, we found several types of obsolete hosts
mostly orphan ones that trigger that role clearance all the time

The amendment to the query does not reset the roles where the
the auto-assign host is not relevant:
* in status disabled (obsolete)
* disconnected
* day2 host (old hosts - current day 2 sets the role to a worker role before
  registering)
* host stuck on discovering state

This PR, in combine with future improvements to GC code, will eliminate
the spurious resets of auto-assign roles.
@slaviered
Copy link
Contributor Author

/retest-required

@openshift-ci
Copy link

openshift-ci bot commented Jan 17, 2023

@slaviered: all tests passed!

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-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Jan 18, 2023
@openshift-ci
Copy link

openshift-ci bot commented Jan 18, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: ori-amizur, slaviered

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:
  • OWNERS [ori-amizur,slaviered]

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 openshift-merge-robot merged commit bbdb5e9 into openshift:master Jan 18, 2023
eliorerz pushed a commit to eliorerz/assisted-service that referenced this pull request Jan 29, 2023
)

The monitor resets the 'suggested-role' field on all hosts of the clusters
if one of the hosts is in auto-assign. This was done to eliminate
race conditions between 'register host' and the calculation of auto-assign
a synchronically in the monitor loop.

The reset may happen once in a lifetime of a host.

However, in production, we found several types of obsolete hosts
mostly orphan ones that trigger that role clearance all the time

The amendment to the query does not reset the roles where the
the auto-assign host is not relevant:
* in status disabled (obsolete)
* disconnected
* day2 host (old hosts - current day 2 sets the role to a worker role before
  registering)
* host stuck on discovering state

This PR, in combine with future improvements to GC code, will eliminate
the spurious resets of auto-assign roles.
danielerez pushed a commit to danielerez/assisted-service that referenced this pull request Oct 15, 2023
)

The monitor resets the 'suggested-role' field on all hosts of the clusters
if one of the hosts is in auto-assign. This was done to eliminate
race conditions between 'register host' and the calculation of auto-assign
a synchronically in the monitor loop.

The reset may happen once in a lifetime of a host.

However, in production, we found several types of obsolete hosts
mostly orphan ones that trigger that role clearance all the time

The amendment to the query does not reset the roles where the
the auto-assign host is not relevant:
* in status disabled (obsolete)
* disconnected
* day2 host (old hosts - current day 2 sets the role to a worker role before
  registering)
* host stuck on discovering state

This PR, in combine with future improvements to GC code, will eliminate
the spurious resets of auto-assign roles.
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. 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

3 participants