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

Bug 1916169: storeCurrentConfigOnDisk after os changes #2922

Merged
merged 1 commit into from
Jan 25, 2022

Conversation

mkenigs
Copy link
Contributor

@mkenigs mkenigs commented Jan 20, 2022

Currently the MachineConfig being applied is saved to disk before OS
changes are applied. If the node loses power while OS changes are being
applied, the MCO incorrectly concludes from the config stored on disk
that the update has been applied. Instead, wait until the OS changes
have been made to write the config to disk.

I manually verified that this shouldn't break anything:
getCurrentConfigOnDisk is the only function that accesses the config on
disk, and it is only called in the following code paths:
syncNode->runPreflightConfigDriftCheck
syncNode->startConfigDriftMonitor
performPostConfigChangeAction->startConfigDriftMonitor
checkStateOnFirstRun
syncNode->prepUpdateFromCluster
runOnceFromMachineConfig->prepUpdateFromCluster

None of those functions are called between where the config is currently
stored to disk and where I'm moving it to, so this change should be
safe.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1916169

- How to verify it
Run the reproducer script from https://bugzilla.redhat.com/show_bug.cgi?id=1916169 before and after the change. Without the change, the node does not end up with a realtime kernel, but with the change, the switch to realtime kernel is correctly performed

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 20, 2022

Skipping CI for Draft Pull Request.
If you want CI signal for your change, please convert it to an actual PR.
You can still manually trigger a test run with /test all

@openshift-ci openshift-ci bot added the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Jan 20, 2022
@cgwalters
Copy link
Member

Background: I think I'd summarize this "write current config" thing is a workaround for not having #1190

Basically it was trying to track the intention of switching to a new configuration by writing to the current /etc. But if we delegate that whole thing to ostree, we are always either in the new config or the old.

@mkenigs
Copy link
Contributor Author

mkenigs commented Jan 21, 2022

But if we delegate that whole thing to ostree, we are always either in the new config or the old.

+1 for layering

Currently the MachineConfig being applied is saved to disk before OS
changes are applied. If the node loses power while OS changes are being
applied, the MCO incorrectly concludes from the config stored on disk
that the update has been applied. Instead, wait until the OS changes
have been made to write the config to disk.

I manually verified that this shouldn't break anything:
getCurrentConfigOnDisk is the only function that accesses the config on
disk, and it is only called in the following code paths:
syncNode->runPreflightConfigDriftCheck
syncNode->startConfigDriftMonitor
performPostConfigChangeAction->startConfigDriftMonitor
checkStateOnFirstRun
syncNode->prepUpdateFromCluster
runOnceFromMachineConfig->prepUpdateFromCluster

None of those functions are called between where the config is currently
stored to disk and where I'm moving it to, so this change should be
safe.

Fixes https://bugzilla.redhat.com/show_bug.cgi?id=1916169
@mkenigs mkenigs changed the title storeCurrentConfigOnDisk after os changes Bug 1916169: storeCurrentConfigOnDisk after os changes Jan 24, 2022
@mkenigs mkenigs marked this pull request as ready for review January 24, 2022 17:46
@openshift-ci openshift-ci bot added bugzilla/severity-high Referenced Bugzilla bug's severity is high for the branch this PR is targeting. and removed do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. labels Jan 24, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 24, 2022

@mkenigs: This pull request references Bugzilla bug 1916169, which is valid. The bug has been moved to the POST state. The bug has been updated to refer to the pull request using the external bug tracker.

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

No GitHub users were found matching the public email listed for the QA contact in Bugzilla ([email protected]), skipping review request.

In response to this:

Bug 1916169: storeCurrentConfigOnDisk after os changes

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 bugzilla/valid-bug Indicates that a referenced Bugzilla bug is valid for the branch this PR is targeting. label Jan 24, 2022
Copy link
Contributor

@yuqi-zhang yuqi-zhang left a comment

Choose a reason for hiding this comment

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

Looking at the code and Matthew's assessment, I think this code lgtm

Just to make sure, since the original BZ is quite long, do we foresee this being able to close all non-MCO reboot races? I presume no, but this should leave us in a proper "error" state instead of having it not report errors but also not be updated?

@openshift-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Jan 24, 2022
@mkenigs
Copy link
Contributor Author

mkenigs commented Jan 24, 2022

Do you have any specific races in mind that this wouldn't solve? I don't feel like I know whether or not this fixes all races and would have to look into https://issues.redhat.com/browse/MCO-156 in more depth

That BZ is kinda vague but this would fix the only failure it explicitly describes

@yuqi-zhang
Copy link
Contributor

Not off the top of my head. I think we can use 156 to pursue follow ups if they arise.

/lgtm

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

openshift-ci bot commented Jan 24, 2022

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: mkenigs, yuqi-zhang

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-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

8 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

7 similar comments
@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-bot
Copy link
Contributor

/retest-required

Please review the full test history for this PR and help us cut down flakes.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 25, 2022

@mkenigs: The following tests 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-single-node d324dac link false /test e2e-aws-single-node
ci/prow/e2e-aws-disruptive d324dac link false /test e2e-aws-disruptive
ci/prow/e2e-aws-workers-rhel8 d324dac link false /test e2e-aws-workers-rhel8
ci/prow/okd-e2e-aws d324dac link false /test okd-e2e-aws
ci/prow/e2e-vsphere-upgrade d324dac link false /test e2e-vsphere-upgrade
ci/prow/e2e-aws-workers-rhel7 d324dac link false /test e2e-aws-workers-rhel7
ci/prow/e2e-aws-upgrade-single-node d324dac link false /test e2e-aws-upgrade-single-node

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-merge-robot openshift-merge-robot merged commit b68d8e1 into openshift:master Jan 25, 2022
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Jan 25, 2022

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

Bugzilla bug 1916169 has been moved to the MODIFIED state.

In response to this:

Bug 1916169: storeCurrentConfigOnDisk after os changes

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.

@mkenigs mkenigs deleted the 169-resilience branch March 18, 2022 13:48
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/severity-high Referenced Bugzilla bug's severity is high 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. lgtm Indicates that a PR is ready to be merged.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants