fix(pg_upgrade): use systemctl to start data.mount#2144
Open
fix(pg_upgrade): use systemctl to start data.mount#2144
Conversation
`complete.sh` used `mount -a` to mount `/data` after the upgraded volume was re-attached. Because the fstab entry for `/data` includes `x-systemd.device-timeout`, systemd takes ownership of the `data.mount` unit — and `mount -a` from util-linux silently skips systemd-managed mounts, exiting 0 without mounting anything. This caused `copy_configs` to run against an unmounted `/data`, exhausting its 3 retries in ~6s and marking the upgrade as failed. Ref: INC-495 Replace `retry 8 mount -a -v` with `systemctl start data.mount`, which explicitly activates the systemd unit. Follow it with `retry 8 mountpoint -q /data` as a safety net with an explicit failure message. PR #2133 (Paul Cioanca) addressed the secondary race — EBS API reporting `in-use` before the NVMe device is visible to the OS — by adding `udevadm settle` and `wait_for_data_device`. This PR addresses the root cause that remained after that fix.
Crispy1975
approved these changes
May 7, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
complete.shusedmount -ato mount/dataafter the upgraded volume was re-attached. Because the fstab entry for/dataincludesx-systemd.device-timeout, systemd takes ownership of thedata.mountunit — andmount -afrom util-linux silently skips systemd-managed mounts, exiting 0 without mounting anything.This caused
copy_configsto run against an unmounted/data, exhausting its 3 retries in ~6s and marking the upgrade as failed.Ref: INC-495
Replace
retry 8 mount -a -vwithsystemctl start data.mount, which explicitly activates the systemd unit. Follow it withretry 8 mountpoint -q /dataas a safety net with an explicit failure message.PR #2133 (Paul Cioanca) addressed the secondary race — EBS API reporting
in-usebefore the NVMe device is visible to the OS — by addingudevadm settleandwait_for_data_device. This PR addresses the root cause that remained after that fix.Please go the
Previewtab and select the appropriate sub-template: