1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-22 17:35:59 +03:00
Commit Graph

180 Commits

Author SHA1 Message Date
Petr Rockai
17f3b8280b test: Correctly trigger inconsistent metadata repair in lvmcache-exercise.
Since lvconvert --repair sets handles_missing_pvs, it will not repair
inconsistent metadata automatically. Calling lvs instead should do the trick.
2013-10-09 14:44:15 +02:00
Zdenek Kabelac
830d233b17 tests: needed --type mirror
Avoid testing raids here (would need kernel module)
2013-10-08 16:56:09 +02:00
Zdenek Kabelac
2ee969e851 tests: reappering device
Simulation of problem for:
https://bugzilla.redhat.com/show_bug.cgi?id=995440
2013-10-08 16:19:14 +02:00
Zdenek Kabelac
273373bf53 tests: lvconvert more thin extorg conversions
Add test for conversion of pool and thin lv at the same time.
2013-10-08 13:42:10 +02:00
Zdenek Kabelac
7edf61186b tests: vgrename duplicate rename
Test for rename of duplicated vgname (with different UUID)
2013-10-08 13:42:09 +02:00
Jonathan Brassow
098896fb29 mirror/RAID: Honor mirror_segtype_default when converting from linear
1) When converting from an x-way mirror/raid1 to a y-way mirror/raid1,
the default behaviour should be to stay the same segment type.

2) When converting from linear to mirror or raid1, the default behaviour
should honor the mirror_segtype_default.

3) When converting and the '--type' argument is specified, the '--type'
argument should be honored.

catch such conditions, but errors in the tests caused the issue to go
unnoticed.  The code has been fixed to perform #2 properly, the tests
have been corrected to properly test for #2, and a few other tests
were changed to explicitly specify the '--type mirror' when necessary.
2013-09-25 22:25:43 -05:00
Jonathan Brassow
c37c59e155 Test/clean-up: Indent clean-up and additional RAID resize test
Better indenting and a test for bug 1005434 (parity RAID should
extend in a contiguous fashion).
2013-09-24 21:32:53 -05:00
Zdenek Kabelac
9658032cba tests: drop extra loop
Loop was added as a result of unworking singlenode locking, since
this should be now fixed - remove this workaround.
2013-09-23 12:14:21 +02:00
Zdenek Kabelac
151f4ba64e tests: drop pointeless test
Writing directly to thin-pool and reading it is not a good idea.
2013-09-23 12:14:21 +02:00
Jonathan Brassow
cafde60890 test: Blacklist fedora-19 kernel for RAID4/5/6 dev replace tests
A know issue with kmem_cach is causing failures while testing
RAID 4/5/6 device replacement.  Blacklist the offending kernel
so that these tests are not performed there.
2013-09-20 11:33:29 -05:00
Zdenek Kabelac
61427af377 tests: no activate LV
Since our current vgcfgbackup/restore doesn't deal
with difference of active volumes between current and
restored set of volumes -  run test with inactive LVs.
2013-09-16 15:38:42 +02:00
Zdenek Kabelac
2abaf87a9b tests: update vgcfgrestore test
Test vgcfgrestore when seqno of restored mda is smaller then current
metadata on device.
2013-09-16 13:48:44 +02:00
Zdenek Kabelac
fbb732bd8e tests: enhance pvmove testing
Rewrite check lv_on  and add new  lv_tree_on
Move more pvmove test unrelated code out to check & get sections
(so they do not obfuscate trace output unnecesserily)

Use new lv_tree_on()
NOTE: unsure how the snapshot origin should be accounted here.

Split pmove-all-segments into separate tests for raid and thins
(so the test output properly shows what has been skipped in test)
2013-09-16 11:22:04 +02:00
Zdenek Kabelac
47b7cc6850 tests: use check for raid test
Use test-suite built-in check command for this test
(creates better logs, and reduces amount of valgrind-ed commands)
2013-09-16 11:22:04 +02:00
Jonathan Brassow
1d06868240 TEST: Unaccounted possible output causing failure
lvchange-raid.sh checks to ensure that the 'p'artial flag takes
precedence over the 'w'ritemostly flag by disabling and reenabling
a device in the array.  Most of the time this works fine, but
sometimes the kernel can notice the device failure before it is
reenabled.  In that case, the attr flag will not return to 'w', but
to 'r'efresh.  This is because 'r'efresh also takes precedence over
the 'w'ritemostly flag.  So, we also do a quick check for 'r' and
not just 'w'.
2013-09-12 13:23:53 -05:00
Jonathan Brassow
82228acfc9 Mirror/Thin: Disallow thinpools on mirror logical volumes
The same corner cases that exist for snapshots on mirrors exist for
any logical volume layered on top of mirror.  (One example is when
a mirror image fails and a non-repair LVM command is the first to
detect it via label reading.  In this case, the LVM command will hang
and prevent the necessary LVM repair command from running.)  When
a better alternative exists, it makes no sense to allow a new target
to stack on mirrors as a new feature.  Since, RAID is now capable of
running EX in a cluster and thin is not active-active aware, it makes
sense to pair these two rather than mirror+thinpool.

As further background, here are some additional comments that I made
when addressing a bug related to mirror+thinpool:
(https://bugzilla.redhat.com/show_bug.cgi?id=919604#c9)
I am going to disallow thin* on top of mirror logical volumes.
Users will have to use the "raid1" segment type if they want this.

This bug has come down to a choice between:
1) Disallowing thin-LVs from being used as PVs.
2) Disallowing thinpools on top of mirrors.

The problem is that the code in dev_manager.c:device_is_usable() is unable
to tell whether there is a mirror device lower in the stack from the device
being checked.  Pretty much anything layered on top of a mirror will suffer
from this problem.  (Snapshots are a good example of this; and option #1
above has been chosen to deal with them.  This can also be seen in
dev_manager.c:device_is_usable().)  When a mirror failure occurs, the
kernel blocks all I/O to it.  If there is an LVM command that comes along
to do the repair (or a different operation that requires label reading), it
would normally avoid the mirror when it sees that it is blocked.  However,
if there is a snapshot or a thin-LV that is on a mirror, the above code
will not detect the mirror underneath and will issue label reading I/O.
This causes the command to hang.

Choosing #1 would mean that thin-LVs could never be used as PVs - even if
they are stacked on something other than mirrors.

Choosing #2 means that thinpools can never be placed on mirrors.  This is
probably better than we think, since it is preferred that people use the
"raid1" segment type in the first place.  However, RAID* cannot currently
be used in a cluster volume group - even in EX-only mode.  Thus, a complete
solution for option #2 must include the ability to activate RAID logical
volumes (and perform RAID operations) in a cluster volume group.  I've
already begun working on this.
2013-09-11 15:58:44 -05:00
Jonathan Brassow
2691f1d764 RAID: Make RAID single-machine-exclusive capable in a cluster
Creation, deletion, [de]activation, repair, conversion, scrubbing
and changing operations are all now available for RAID LVs in a
cluster - provided that they are activated exclusively.

The code has been changed to ensure that no LV or sub-LV activation
is attempted cluster-wide.  This includes the often overlooked
operations of activating metadata areas for the brief time it takes
to clear them.  Additionally, some 'resume_lv' operations were
replaced with 'activate_lv_excl_local' when sub-LVs were promoted
to top-level LVs for removal, clearing or extraction.  This was
necessary because it forces the appropriate renaming actions the
occur via resume in the single-machine case, but won't happen in
a cluster due to the necessity of acquiring a lock first.

The *raid* tests have been updated to allow testing in a cluster.
For the most part, this meant creating devices with '-aey' if they
were to be converted to RAID.  (RAID requires the converting LV to
be EX because it is a condition of activation for the RAID LV in
a cluster.)
2013-09-10 16:33:22 -05:00
Jonathan Brassow
848e8026d6 TEST: pvmove-all-segtypes.sh should not be run in a cluster 2013-09-03 10:54:42 -05:00
Petr Rockai
ea1e8166d5 test: Skip tests involving mirror recovery on known bad kernels. 2013-09-03 16:24:32 +02:00
Zdenek Kabelac
039585bb0d tests: test pvmove behavior after restart
Simulate crash of the system and restarted pvmove after next VG
activation.

Test is catching regression introduced in 2.02.99 for partial tree
creation changes.
2013-08-31 21:40:51 +02:00
David Teigland
eee3aeeb61 test: fix process-each-duplicate-vgnames
After enable_dev, the following commands were not
consistently seeing the pv on it.

Alasdair explained, "whenever enabling/disabling devs
outside the tools (and you aren't trying to test how
the tools cope with suddenly appearing/disappering
devices) use "vgscan""
2013-08-30 11:53:10 -05:00
Jonathan Brassow
e72b2d047d TEST: Add tests for lvchange actions of RAID under thin
Patch includes RAID1,4,5,6,10 tests for:
- setting writemostly/writebehind
* syncaction changes (i.e. scrubbing operations)
- refresh (i.e. reviving devices after transient failures)
- setting recovery rate (sync I/O throttling)
while the RAID LVs are under a thin-pool (both data and metadata)

* not fully tested because I haven't found a way to force bad
  blocks to be noticed in the testsuite yet.  Works just fine
  when dealing with "real" devices.
2013-08-27 16:46:40 -05:00
Jonathan Brassow
0799e81ee0 test: pvmove tests for all the different segment types.
Test moving linear, mirror, snapshot, RAID1,5,10, thinpool, thin
and thin on RAID.  Perform the moves along with a dummy LV and
also without the dummy LV by specifying a logical volume name as
an argument to pvmove.
2013-08-26 16:38:54 -05:00
David Teigland
7d6a125e97 test: add process-each-vg and process-each-lv
These test the toollib functions that select
vgs/lvs to process based on command line args:
empty, vg name(s), lv names(s), vg tag(s),
lv tags(s), and combinations of all.
2013-08-23 14:38:48 -05:00
David Teigland
506bc045b5 test: add process-each-duplicate-vgnames
Test that vgs shows both vgs when two vgs
exist with the same name but different uuids.
2013-08-23 14:19:59 -05:00
David Teigland
8c511122f4 test: add vg-name-from-env
vg name should come from env var LVM_VG_NAME
for commands that take vg name and lv name,
but vg name is not specified on command line.
2013-08-23 14:10:29 -05:00
Petr Rockai
0da72743ca vgck: Fix #894136, notice on-disk corruption in spite of lvmetad. 2013-08-13 23:25:49 +02:00
Jonathan Brassow
8615234c0f RAID: Fix bug making lvchange unable to change recovery rate for RAID
1) Since the min|maxrecoveryrate args are size_kb_ARGs and they
   are recorded (and sent to the kernel) in terms of kB/sec/disk,
   we must back out the factor multiple done by size_kb_arg.  This
   is already performed by 'lvcreate' for these arguments.
2) Allow all RAID types, not just RAID1, to change these values.
3) Add min|maxrecoveryrate_ARG to the list of 'update_partial_unsafe'
   commands so that lvchange will not complain about needing at
   least one of a certain set of arguments and failing.
4) Add tests that check that these values can be set via lvchange
   and lvcreate and that 'lvs' reports back the proper results.
2013-08-09 17:09:47 -05:00
Zdenek Kabelac
a1dc585fa6 test: can convert pool to external origin
Test for http://bugzilla.redhat.com/show_bug.cgi?id=983743
2013-08-09 23:17:15 +02:00
Jonathan Brassow
ea4c0ea34f TEST: Be explicit about which mirror segment type to use.
In those places where mirrors were being created while assuming
a default segment type of "mirror", we include the '--type mirror'
argument to explicitly set the segment type.  This will preserve
the mirror testing that is performed even though the default
mirroring segment type is now "raid1".
2013-08-07 15:48:31 -05:00
Peter Rajnoha
f50e8fb9b9 tests: add profiles.sh test 2013-08-07 12:17:36 +02:00
Zdenek Kabelac
ea605d1ec7 thin: metadata resize needs 1.9 version
Version 1.8 is not yet fully usable for metadata resize.
2013-07-31 15:29:27 +02:00
Zdenek Kabelac
da5284a500 thin: lvconvert cannot convert pool to mirror
Suggest to use _tdata and _tmeta devices for that.
This fixes regression from too relaxed change in
f1d5f6ae81

Without this patch there are some empty LVs created before
mirror code recognizes it cannot continue.

(in release fix)
2013-07-24 17:17:19 +02:00
Zdenek Kabelac
5597dc3652 thin: not zeroing for non-zeroed thin pool snaps
Do not zero initial 4KB of thin snapshot volume for thin pool with
disabled zeroing.
2013-07-24 01:15:31 +02:00
Zdenek Kabelac
f6ded62291 snapshot: fix merging
When the merging of snapshot is finished, we need to clean dm table
intries for snapshot and -cow device. So for merging snapshot
we have to activate_lv plain 'cow' LV and let the table
resolver to its work - shortly deactivation_lv() request
will follow - in cluster this needs LV lock to be held by clvmd.

Also update a test - add small wait - if lvremove is not 'fast enough'
and merging process has not been stopped and $lv1 removed in background.
Ortherwise the following lvcreate occasionally finds name $lv1 still in use.

(in release fix)
2013-07-22 16:26:00 +02:00
Peter Rajnoha
6ca81a091c tests: comment about pvscan --cache return value 2013-07-22 15:57:18 +02:00
Jonathan Brassow
081308af30 TEST: Support testing new RAID features in RHEL6 kernels
We check the version number of dm-raid before testing certain
features to make sure they are present.  However, this has
become somewhat complicated by the fact that the version #'s
in the upstream kernel and the REHL6 kernel have been diverging.
This has been a necessity because the upstream kernel has
undergone ABI changes that have necessitated a bump in the
'Y' component of the version #, while the RHEL6 kernel has not.
Thus, we need to know that the ABI has not changed but the
features have been added.  So, the current version #'ing stands
as follows:

RHEL6   Upstream   Comment
======|==========|========
** Same until version 1.3.1 **
------|----------|--------
 N/A  |   1.4.0  | Non-functional change.
      |          | Removes arg from mapping function.
------|----------|--------
1.3.2 |   1.4.1  | RAID10 fix redundancy validation checks.
------|----------|--------
1.3.5 |   1.4.2  | Add RAID10 "far" and "offset" algorithm support.
      |          | Note this feature came later in RHEL6 as part of
      |          | a separate update/feature.
------|----------|--------
1.3.3 |   1.5.0  | Add message interface to allow manipulation of
      |          | the sync_action.
      |          | New status (STATUSTYPE_INFO) fields: sync_action
      |          | and mismatch_cnt.
------|----------|--------
1.3.4 |   1.5.1  | Add ability to restore transiently failed devices
      |          | on resume.
------|----------|--------
1.3.5 |   1.5.2  | 'mismatch_cnt' is zero unless [last_]sync_action
      |          | is "check".
------|----------|--------

To simplify, writemostly/writebehind, scrubbing, and transient device
failure restoration are all tested based on the same version
requirements: (1.3.5 < V < 1.4.0) || (V > 1.5.2).  Since kernel
support for writemostly/writebehind has been around for some time,
this could mean a reduction in the scope of kernels tested for this
feature.  I don't view this as much of a problem, since support for
this feature was only recently added to LVM.  Thus, the user would
have to be using a very recent LVM version with an older kernel.
2013-07-22 08:50:27 -05:00
Petr Rockai
3fdb45d040 pvscan: Respect lvmetad (global) filter in --cache w/ a device. 2013-07-22 15:05:39 +02:00
Petr Rockai
bd60232d74 TEST: Add a regression test for the ondisk/orphan bug. 2013-07-22 11:57:23 +02:00
Jonathan Brassow
6aeb54c77c TEST: Update syncaction test to match latest kernel updates
The mismatch count reported by a dm-raid kernel target used
to be effectively random, unless it was checked after a
"check" scrubbing action had been performed.  Updates to the
kernel now mean that the mismatch count will be 0 unless a
check has been performed and discrepancies had been found.
This has been the intended behaviour all along.

This patch updates the test suite to handle the change.
2013-07-19 15:24:34 -05:00
Alasdair G Kergon
da79fe4c1d reporting: tidy recent new fields
Add underscores and prefixes to recently-added fields.
(Might add more alias functionality in future.)
2013-07-19 01:30:02 +01:00
Zdenek Kabelac
4e724f5f52 thin: for thin volumes properly list modules
thin volume needs   thin-pool and  thin kernel modules so print them
both for   lvs -o+modules
2013-07-18 18:22:43 +02:00
Zdenek Kabelac
63d09b75f8 tests: one missed automatic name
Avoid depending on auto-names lvol%d.
2013-07-15 16:38:55 +02:00
Zdenek Kabelac
255db4c4e4 tests: thin lvol0 updates 2013-07-15 16:01:29 +02:00
Zdenek Kabelac
3498575b20 tests: more thin external origin tests 2013-07-15 16:01:28 +02:00
Peter Rajnoha
4e680ff3ab tests: use lvcreate -s -K for thin snapshots
Thin snapshots are not activated now by default so this needs
to be explicitly overridden with -K now.
2013-07-12 20:54:17 +02:00
Peter Rajnoha
55d418fb20 tests: fix tests to cope with latest changes
- lvs -o lv_attr has now 10 indicator bits
- use '--ignoremonitoring' instead of the shortcut '--ig' used before (since
it would be ambiguous with new '--ignoreactivationskip')
2013-07-12 20:54:17 +02:00
Jonathan Brassow
bdcfe8c6de TEST: Test RAID syncaction, writemostly, & refresh under snapshots
Test the different RAID lvchange scenarios under snapshot as well.

This patch also updates calculations for where to write to an
underlying PV when testing various syncactions.
2013-06-20 11:48:15 -05:00
Jonathan Brassow
a6d13308ec RAID/MIRROR: Honor mirror_segtype_default when upconverting linear LVs
If the user would upconvert a linear LV to a mirror without specifying
the segment type ("--type mirror" vs "--type raid1"), the "mirror"
segment type would be chosen without consulting the 'default_mirror_segtype'
setting in lvm.conf.  This is now used as the basis for determining
which should be used if left unspecified.
2013-06-19 17:50:10 -05:00
Zdenek Kabelac
2562968864 vgcfgrestore: fix crash on restore of wrong vgname
When vgname has not existed in metadata, it has crashed on double free
in format_instance destroy() -  since VG was created, used FID and was
released - which also released FID, so further use was accessing bad
memory.

Fix it for this code path before release_vg() so FID will exists
when _vg_read_file_name() returns NULL.
2013-06-18 22:11:21 +02:00