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

ignition-ostree: make sure we don't mount /sysroot before transposefs #2526

Merged
merged 1 commit into from
Aug 1, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,11 @@ After=ignition-disks.service
# Avoid racing with UUID regeneration
After=ignition-ostree-uuid-root.service
After=ignition-ostree-growfs.service
Before=initrd-root-fs.target
Comment on lines 7 to +8
Copy link
Member

Choose a reason for hiding this comment

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

OK now that I look I think I'm starting to understand this better. Before this PR, we only had Before=ignition-ostree-transposefs-restore.service on this service, which is itself just Before=ignition-ostree-mount-firstboot-sysroot.service.

Yet that service is just a no-op if we have a root kernel argument.

So there were no constraints and we just end up racing.

So the multipath bits exposed this core race condition because it is done via a root= karg.

# https://issues.redhat.com/browse/OCPBUGS-16157
# On multipath systems mounting the /sysroot before
# the ignition-ostree services causes the transpose to fai.
Before=sysroot.mount
Before=ignition-ostree-transposefs-restore.service
OnFailure=emergency.target
OnFailureJobMode=isolate
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ After=ignition-disks.service
After=ignition-ostree-uuid-root.service
After=ignition-ostree-growfs.service
Before=ignition-ostree-mount-firstboot-sysroot.service
# https://issues.redhat.com/browse/OCPBUGS-16157
# On multipath systems mounting the /sysroot before
# the ignition-ostree services causes the transpose to fai.
Before=initrd-root-fs.target
Before=sysroot.mount
Comment on lines +12 to +13
Copy link
Member

Choose a reason for hiding this comment

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

This is 100% fine, but I'd note that normally sysroot.mount is itself Before=initrd-root-fs.target, so we could just be Before=sysroot.mount too.

Or maybe the simple way to say it is: anywhere we have Before=ignition-ostree-mount-firstboot-sysroot.service we also need Before=sysroot.mount.

OnFailure=emergency.target
OnFailureJobMode=isolate

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,11 @@ ConditionKernelCommandLine=ostree
ConditionPathIsDirectory=/run/ignition-ostree-transposefs
# Any services looking at mounts need to order after this
# because it causes device re-probing.
# https://issues.redhat.com/browse/OCPBUGS-16157
# On multipath systems mounting the /sysroot before
# the ignition-ostree services causes the transpose to fai.
Before=initrd-root-fs.target
Before=sysroot.mount
After=coreos-gpt-setup.service
OnFailure=emergency.target
OnFailureJobMode=isolate
Expand Down