-
Notifications
You must be signed in to change notification settings - Fork 40
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
OCPBUGS-37711: fix: ensure wipefs / dmsetup remove use CombinedOutput to wait for both STDERR and STDOUT before continuing #687
OCPBUGS-37711: fix: ensure wipefs / dmsetup remove use CombinedOutput to wait for both STDERR and STDOUT before continuing #687
Conversation
for given lsblk -o Kname,name (vdb was created with one partition (type 8E), after which a vg and lv thin pool have been created on it) vdb vdb vdb1 `-vdb1 dm-0 |-some--other--vg-some--lv_tmeta dm-2 | `-some--other--vg-some--lv dm-1 `-some--other--vg-some--lv_tdata dm-2 `-some--other--vg-some--lv the commands will now be dmsetup remove --force /dev/dm-2 dmsetup remove --force /dev/dm-0 dmsetup remove --force /dev/dm-2 //no-op dmsetup remove --force /dev/dm-1 wipefs --all --force /dev/vdb // will do ioctl reload and cause partition table refresh Signed-off-by: Jakob Möller <[email protected]>
for given lsblk -o Kname,name (vdb was created with one partition (type 8E), after which a vg and lv thin pool have been created on it) vdb vdb vdb1 `-vdb1 dm-0 |-some--other--vg-some--lv_tmeta dm-2 | `-some--other--vg-some--lv dm-1 `-some--other--vg-some--lv_tdata dm-2 `-some--other--vg-some--lv the commands will now be dmsetup remove --force /dev/dm-2 dmsetup remove --force /dev/dm-0 dmsetup remove --force /dev/dm-2 //no-op dmsetup remove --force /dev/dm-1 wipefs --all --force /dev/vdb // will do ioctl reload and cause partition table refresh Signed-off-by: Jakob Möller <[email protected]>
@jakobmoellerdev: This pull request references Jira Issue OCPBUGS-37711, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
@jakobmoellerdev: This pull request references Jira Issue OCPBUGS-37711, which is valid. The bug has been moved to the POST state. 3 validation(s) were run on this bug
Requesting review from QA contact: The bug has been updated to refer to the pull request using the external bug tracker. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
[APPROVALNOTIFIER] This PR is APPROVED This pull-request has been approved by: jakobmoellerdev 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 |
@jakobmoellerdev: This pull request references Jira Issue OCPBUGS-37711, which is valid. 3 validation(s) were run on this bug
Requesting review from QA contact: In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## main #687 +/- ##
==========================================
- Coverage 71.06% 70.50% -0.57%
==========================================
Files 47 47
Lines 3225 3245 +20
==========================================
- Hits 2292 2288 -4
- Misses 766 788 +22
- Partials 167 169 +2
|
@jakobmoellerdev: 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-sigs/prow repository. I understand the commands that are listed here. |
/lgtm |
@jakobmoellerdev: Jira Issue OCPBUGS-37711: All pull requests linked via external trackers have merged: Jira Issue OCPBUGS-37711 has been moved to the MODIFIED state. In response to this:
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 openshift-eng/jira-lifecycle-plugin repository. |
This fix is a set of corrections applied to our wiping behavior in order to prohibit a race between different command invocations:
for given
the commands will now be
Previously, we encountered an issue because we used the
RunCommandAsHostInto
method as well asStartCommandWithOutputAsHost
. However, these methods assume that (as is the case with lvm2) STDERR is not necessary to determine program completion, just STDOUT. However, if a program like wipefs / dmsetup issues a STDERR log after the STDOUT pipe closes, then this is not recognized. This results in the situation that wipefs calls can sometimes "double up" and race each other, which causes unpredictable wiping behavior.By switching to
CombinedOutputCommandAsHost
we wait for both STDOUT & STDERR to complete fully before moving on as the optimizations for parsing via streaming are not necessary in dmsetup or wipefs.