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

stages/disks: retry sgdisk --zap-all invocation #1735

Merged
merged 2 commits into from
Oct 26, 2023
Merged

Conversation

jlebon
Copy link
Member

@jlebon jlebon commented Oct 25, 2023

When wipeTable is enabled, we run sgdisk --zap-all. But if the table
was corrupted in the first place, sgdisk will exit with code 2 which
then breaks boot.

As a workaround, Ignition used to retry the invocation but the context
around it was lost in #544 and #1149 and the retry was removed and
the error-checking was added.

So this patch effectively re-applies 94c98bc ("sgdisk: retry zap-all
operation on failure"), but now with a comment and a test to make sure
we don't regress again.

Closes: coreos/fedora-coreos-tracker#1596

When `wipeTable` is enabled, we run `sgdisk --zap-all`. But if the table
was corrupted in the first place, `sgdisk` will exit with code 2 which
then breaks boot.

As a workaround, Ignition used to retry the invocation but the context
around it was lost in coreos#544 and coreos#1149 and the retry was removed and
the error-checking was added.

So this patch effectively re-applies 94c98bc ("sgdisk: retry zap-all
operation on failure"), but now with a comment and a test to make sure
we don't regress again.

Closes: coreos/fedora-coreos-tracker#1596
In the context of the test added in the previous patch, it's normal for
the first `sgdisk --zap-all` invocation to fail. Add a knob to allow the
harness to tolerate this and make use of it in the new test.
Copy link
Collaborator

@prestist prestist left a comment

Choose a reason for hiding this comment

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

Wow; thank you for finding and fixing this and then adding more tests!

LGTM!

@jlebon jlebon merged commit 1e0f6fc into coreos:main Oct 26, 2023
9 checks passed
@jlebon jlebon deleted the pr/re-retry branch October 26, 2023 21:07
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Ignition fails to wipe disk if partition table is corrupted
2 participants