RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 832033 - Operations with '--test' switch visible when lvmetad is on, on disk metadata are not modified
Summary: Operations with '--test' switch visible when lvmetad is on, on disk metadata ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 6
Classification: Red Hat
Component: lvm2
Version: 6.3
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: rc
: ---
Assignee: Petr Rockai
QA Contact: Cluster QE
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2012-06-14 11:02 UTC by Marian Csontos
Modified: 2013-02-21 08:10 UTC (History)
12 users (show)

Fixed In Version: lvm2-2.02.97-2.el6
Doc Type: Bug Fix
Doc Text:
When using the lvmetad daemon, passing the --test argument to commands might previously have caused inconsistencies in the cache that lvmetad maintains. This has been fixed.
Clone Of:
Environment:
Last Closed: 2013-02-21 08:10:38 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHBA-2013:0501 0 normal SHIPPED_LIVE lvm2 bug fix and enhancement update 2013-02-20 21:30:45 UTC

Description Marian Csontos 2012-06-14 11:02:03 UTC
Description of problem:
lvmetad's metadata are updated on 'lvcreate --test'. Disk is not touched.

But! Having real PV, creating VG with --test, real LVs can be created on such VG. This leads to disk corruption under some circumstances when shared disk is involved:

- on node01 create testvg with --test

- on node02 create realvg (without --test)
- on realvg on node02 create realpv (without --test)

- on testvg on node01 create realpv (without --test)

realvg-realpv on node02 is now rewritten by testvg-realpv.

None of this operations were run concurrently.

But who would do that? Of course no one, except may be some programs, like RHEV-M?

lvm2-2.02.95-10.el6.x86_64, same upstream.

How reproducible:
100%

Steps to Reproduce:
1. setup and start lvmetad
2. lvcreate --test -n testlv -L 1M $TESTVG
  
Actual results:
testlv is present in `lvs` output.
testlv is neither present in /dev/mapper nor after stopping or restarting lvmetad

Expected results:
testlv not present in `lvs` output

Additional info:
- this is present in other commands too: pvcreate, vgcreate,...

Comment 3 Alasdair Kergon 2012-06-14 11:16:47 UTC
    Technical note added. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    New Contents:
If using lvmetad, which is a Technology Preview, you should avoid passing the --test argument to commands.

Currently, use of --test may lead to inconsistencies in the cache that lvmetad maintains.  This will be fixed in a future release.

If --test has been used, fix any problems by running 'pvscan --cache'.

Comment 4 Marian Csontos 2012-06-15 13:49:14 UTC
`pvscan --cache` does not remove the LV created with --test from lvmetad's cache. Need to restart lvmetad service. Technical note need an update.

Comment 5 Marian Csontos 2012-06-15 13:49:14 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -2,4 +2,4 @@
 
 Currently, use of --test may lead to inconsistencies in the cache that lvmetad maintains.  This will be fixed in a future release.
 
-If --test has been used, fix any problems by running 'pvscan --cache'.+If --test has been used, fix any problems by restarting lvmetad daemon.

Comment 6 Martin Prpič 2012-06-15 14:14:22 UTC
    Technical note updated. If any revisions are required, please edit the "Technical Notes" field
    accordingly. All revisions will be proofread by the Engineering Content Services team.
    
    Diffed Contents:
@@ -1,5 +1 @@
-If using lvmetad, which is a Technology Preview, you should avoid passing the --test argument to commands.
+When using the lvmetad daemon (currently a Technology Preview), avoid passing the --test argument to commands. The use of the --test argument may lead to inconsistencies in the cache that lvmetad maintains. This issue will be fixed in a future release. If the --test argument has been used, fix any problems by restarting the lvmetad daemon.-
-Currently, use of --test may lead to inconsistencies in the cache that lvmetad maintains.  This will be fixed in a future release.
-
-If --test has been used, fix any problems by restarting lvmetad daemon.

Comment 7 RHEL Program Management 2012-07-10 08:10:10 UTC
This request was not resolved in time for the current release.
Red Hat invites you to ask your support representative to
propose this request, if still desired, for consideration in
the next release of Red Hat Enterprise Linux.

Comment 8 RHEL Program Management 2012-07-10 23:59:00 UTC
This request was erroneously removed from consideration in Red Hat Enterprise Linux 6.4, which is currently under development.  This request will be evaluated for inclusion in Red Hat Enterprise Linux 6.4.

Comment 9 Corey Marthaler 2012-07-26 18:22:13 UTC
Adding QA ack for 6.4.

Devel will need to provide unit testing results however before this bug can be
ultimately verified by QA.

Comment 10 Petr Rockai 2012-07-30 09:21:43 UTC
Fixed upstream. The test for this is called lvmetad-test.sh:

. lib/test

aux prepare_pvs 2

vgcreate $vg1 $dev1 $dev2 --test
vgs | not grep $vg1
vgcreate $vg1 $dev1 $dev2
vgs | grep $vg1

lvcreate -n bar -l 1 $vg1 --test
lvs | not grep bar
lvcreate -n bar -l 1 $vg1
lvs | grep bar

lvremove $vg1/bar -f --test
lvs | grep bar
lvremove $vg1/bar -f
lvs | not grep bar

vgremove $vg1 --test
vgs | grep $vg1
vgremove $vg1
vgs | not grep $vg1

I have checked that the test fails before the fix and passes afterwards.

Comment 12 Nenad Peric 2013-01-21 10:01:37 UTC
I tried this out with  lvm2-2.02.98-8 and --test mode did not create any vg/lv/pvs 
the lvs or vgs commands did not show any unexpected VGs or LVs present in the output. 
The --test operations were not really added to lvmetad cache, they were acting as expected: no test operations were present in any lv command outputs later. 


Additionally I ran lvmetad-test.sh as suggested in Comment 10, with no errors. 

Tested with:

lvm2-2.02.98-8.el6.x86_64
lvm2-libs-2.02.98-8.el6.x86_64
device-mapper-1.02.77-8.el6.x86_64
kernel-2.6.32-354.el6.x86_64

Comment 13 errata-xmlrpc 2013-02-21 08:10:38 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

http://rhn.redhat.com/errata/RHBA-2013-0501.html


Note You need to log in before you can comment on or make changes to this bug.