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,...
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'.
`pvscan --cache` does not remove the LV created with --test from lvmetad's cache. Need to restart lvmetad service. Technical note need an update.
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.
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.
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.
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.
Adding QA ack for 6.4. Devel will need to provide unit testing results however before this bug can be ultimately verified by QA.
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.
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
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