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

OCPBUGS-18397: fix: allow vg to be gone during deletion and pick up empty pvs #404

Merged

Conversation

jakobmoellerdev
Copy link
Contributor

This allows the Volume Group in LVM to be gone during deletion and it will not error out. Also, since this results in the PV to sometimes still be present and have LVM2_member flag even though its completely empty, I changed the valid filesystem signature flag to allow LVM2_member devices under the condition that:

  1. they are empty
  2. they have no children
  3. they get picked up in the pvs command and have available capacity for allocation

I also made sure to extend the pvs output to read out the UUID and remove them from the lvmdevices file with lvmdevices --delpvid after pvremove. This makes sure that the PV is not picked up anymore as valid device in any case. if it is not present in the device list, we just ignore it as we assume pvremove did a full cleanup.

This results in the fact that an empty PV (pvcreate without vgcreate) can now be picked up by LVM operator.

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 1, 2023

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 Sep 1, 2023
@jakobmoellerdev jakobmoellerdev changed the title fix: allow vg to be gone during deletion and pick up empty pvs OCPBUGS-18397: fix: allow vg to be gone during deletion and pick up empty pvs Sep 1, 2023
@openshift-ci-robot openshift-ci-robot added jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. labels Sep 1, 2023
@openshift-ci-robot
Copy link

@jakobmoellerdev: This pull request references Jira Issue OCPBUGS-18397, which is invalid:

  • expected the bug to target the "4.14.0" version, but no target version was set

Comment /jira refresh to re-evaluate validity if changes to the Jira bug are made, or edit the title of this pull request to link to a different bug.

The bug has been updated to refer to the pull request using the external bug tracker.

In response to this:

This allows the Volume Group in LVM to be gone during deletion and it will not error out. Also, since this results in the PV to sometimes still be present and have LVM2_member flag even though its completely empty, I changed the valid filesystem signature flag to allow LVM2_member devices under the condition that:

  1. they are empty
  2. they have no children
  3. they get picked up in the pvs command and have available capacity for allocation

I also made sure to extend the pvs output to read out the UUID and remove them from the lvmdevices file with lvmdevices --delpvid after pvremove. This makes sure that the PV is not picked up anymore as valid device in any case. if it is not present in the device list, we just ignore it as we assume pvremove did a full cleanup.

This results in the fact that an empty PV (pvcreate without vgcreate) can now be picked up by LVM operator.

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 size/L Denotes a PR that changes 100-499 lines, ignoring generated files. label Sep 1, 2023
@jakobmoellerdev
Copy link
Contributor Author

/test all

@jakobmoellerdev
Copy link
Contributor Author

/test all

@jakobmoellerdev jakobmoellerdev marked this pull request as ready for review September 1, 2023 13:19
@openshift-ci openshift-ci bot removed the do-not-merge/work-in-progress Indicates that a PR should not merge because it is a work in progress. label Sep 1, 2023
@jakobmoellerdev
Copy link
Contributor Author

/test all

@jakobmoellerdev
Copy link
Contributor Author

/test lvm-operator-e2e-aws-sno

@codecov-commenter
Copy link

Codecov Report

Merging #404 (a216a88) into main (a0a0ae4) will decrease coverage by 0.44%.
The diff coverage is 27.63%.

Additional details and impacted files

Impacted file tree graph

@@            Coverage Diff             @@
##             main     #404      +/-   ##
==========================================
- Coverage   55.44%   55.01%   -0.44%     
==========================================
  Files          27       27              
  Lines        2303     2341      +38     
==========================================
+ Hits         1277     1288      +11     
- Misses        939      965      +26     
- Partials       87       88       +1     
Files Changed Coverage Δ
pkg/vgmanager/status.go 0.00% <0.00%> (ø)
pkg/vgmanager/vgmanager_controller.go 9.49% <0.00%> (-0.09%) ⬇️
pkg/vgmanager/filter.go 61.22% <26.66%> (-17.73%) ⬇️
pkg/vgmanager/lvm.go 51.72% <47.05%> (-0.31%) ⬇️
pkg/vgmanager/devices.go 76.37% <100.00%> (ø)

@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 7, 2023

@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/test-infra repository. I understand the commands that are listed here.

@suleymanakbas91
Copy link
Contributor

/lgtm
/approve

@openshift-ci openshift-ci bot added the lgtm Indicates that a PR is ready to be merged. label Sep 7, 2023
@openshift-ci
Copy link
Contributor

openshift-ci bot commented Sep 7, 2023

[APPROVALNOTIFIER] This PR is APPROVED

This pull-request has been approved by: jakobmoellerdev, suleymanakbas91

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-ci openshift-ci bot added the approved Indicates a PR has been approved by an approver from all required OWNERS files. label Sep 7, 2023
@suleymanakbas91 suleymanakbas91 merged commit 8da92ee into openshift:main Sep 7, 2023
@openshift-ci-robot
Copy link

@jakobmoellerdev: Jira Issue OCPBUGS-18397: All pull requests linked via external trackers have merged:

Jira Issue OCPBUGS-18397 has been moved to the MODIFIED state.

In response to this:

This allows the Volume Group in LVM to be gone during deletion and it will not error out. Also, since this results in the PV to sometimes still be present and have LVM2_member flag even though its completely empty, I changed the valid filesystem signature flag to allow LVM2_member devices under the condition that:

  1. they are empty
  2. they have no children
  3. they get picked up in the pvs command and have available capacity for allocation

I also made sure to extend the pvs output to read out the UUID and remove them from the lvmdevices file with lvmdevices --delpvid after pvremove. This makes sure that the PV is not picked up anymore as valid device in any case. if it is not present in the device list, we just ignore it as we assume pvremove did a full cleanup.

This results in the fact that an empty PV (pvcreate without vgcreate) can now be picked up by LVM operator.

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.

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. jira/invalid-bug Indicates that a referenced Jira bug is invalid for the branch this PR is targeting. jira/valid-reference Indicates that this PR references a valid Jira ticket of any type. lgtm Indicates that a PR is ready to be merged. size/L Denotes a PR that changes 100-499 lines, ignoring generated files.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants