Skip to content

Conversation

@lzaoral
Copy link
Contributor

@lzaoral lzaoral commented Apr 29, 2024

Pull Request Details:

This patch was originally created in 2021 by @pcahyna in 5d5d1db and is applied in Fedora and RHEL 8+. Somehow it has slipped under our radar and was never submitted upstream.

vgcfgrestore is not supposed to be able to restore any logical volumes that use kernel metadata. All volume types except linear and striped use kernel metadata. Main purpose of vgcfgrestore (with mandatory --force option) is to let users fix existing thin-pool, not to recreate the pool on empty disks. Do not even try vgcfgrestore on VGs that need any kernel metadata, because it might lead to an inconsistent state (if there are data that the kernel might interpret as LV metadata present on the disks).

For VGs that have any volume with kernel metadata and are thus unsupported by vgcfgrestore, switch automatically to LV creation using lvcreate, similarly to MIGRATION_MODE.

Avoid vgcfgrestore --force entirely, since it should not be needed now.

This mostly reverts changes in commits 311bfb3 and 1b779ab. The former code is preserved and gets enabled if FORCE_VGCFGRESTORE=y. This option is on purpose undocumented though and may be removed in the future.

and any other unsupported volume types.

vgcfgrestore is not supposed to be able to restore any logical volumes
that use kernel metadata. All volume types except linear and striped use
kernel metadata. Main purpose of vgcfgrestore (with mandatory --force
option) is to let users fix existing thin-pool, not to recreate the pool
on empty disks. Do not even try vgcfgrestore on VGs that need any kernel
metadata, because it might lead to an inconsistent state (if there are
data that the kernel might interpret as LV metadata present on the disks).

For VGs that have any volume with kernel metadata and are thus
unsupported by vgcfgrestore, switch automatically to LV creation using
lvcreate, similarly to MIGRATION_MODE.

Avoid vgcfgrestore --force entirely, since it should not be needed now.

This mostly reverts changes in commits
311bfb3 and
1b779ab. The former code is preserved
and gets enabled if FORCE_VGCFGRESTORE=y. This option is on purpose
undocumented though and may be removed in the future.
@jsmeix jsmeix added the bug The code does not do what it is meant to do label Apr 30, 2024
@jsmeix jsmeix added this to the ReaR v2.8 milestone Apr 30, 2024
@jsmeix
Copy link
Member

jsmeix commented Apr 30, 2024

According to
https://bugzilla.redhat.com/show_bug.cgi?id=1747468#c9
this is our matching upstream issue:
#2222

@jsmeix jsmeix added the enhancement Adaptions and new features label Apr 30, 2024
@lzaoral
Copy link
Contributor Author

lzaoral commented Apr 30, 2024

@jsmeix Could you please reassign this to @pcahyna? He is the commit author. Thank you!

@jsmeix jsmeix assigned pcahyna and unassigned lzaoral Apr 30, 2024
Copy link
Member

@schlomo schlomo left a comment

Choose a reason for hiding this comment

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

I'm not a big fan of hidden features, they tend to get forgotton.

I therefore would kindly ask you to add the variable to our default.conf and document it there. If you think that this shouldn't be used then please add a deprecation warning if the variable is set, linking to this issue and asking people to provide feedback why they need this feature.

That will make actually removing it so much easier in the future, IMHO.

# doesn't contain any LVs that use kernel metadata.
# If the function returns true, we can safely use vgcfgrestore to restore the VG.
function lvmgrp_supports_vgcfgrestore() {
if is_true "${FORCE_VGCFGRESTORE-no}"; then
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if is_true "${FORCE_VGCFGRESTORE-no}"; then
if is_true "${FORCE_VGCFGRESTORE:-no}"; then

create_logical_volumes=( \$( RmInArray "$vg" "\${create_logical_volumes[@]}" ) )
EOF
if is_true "${FORCE_VGCFGRESTORE-no}"; then
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
if is_true "${FORCE_VGCFGRESTORE-no}"; then
if is_true "${FORCE_VGCFGRESTORE:-no}"; then

@gdha
Copy link
Member

gdha commented Jun 14, 2024

@lzaoral @pcahyna @jsmeix The milestone "2.8" should be updated with "3.0" or "3.1"

@jsmeix jsmeix modified the milestones: ReaR v2.8, ReaR v3.1 Jun 20, 2024
@schlomo
Copy link
Member

schlomo commented Jul 12, 2024

@pcahyna what about the change of ${FORCE_VGCFGRESTORE-no} that I suggested?

Do we shelf this till after a 3.0 release or do you plan to merge it before? Please see my comments above.

@github-actions

This comment was marked as outdated.

@github-actions

This comment was marked as outdated.

@gdha
Copy link
Member

gdha commented May 9, 2025

@pcahyna Please address the requested changes so we can perform the merge - thanks!

@gdha gdha added the waiting for info Also used to mark an issue as stale, cf. stale.yml label May 9, 2025
@gdha gdha removed the waiting for info Also used to mark an issue as stale, cf. stale.yml label Jun 17, 2025
@github-actions

This comment was marked as outdated.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug The code does not do what it is meant to do enhancement Adaptions and new features

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants