1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-10-28 11:55:55 +03:00
Commit Graph

834 Commits

Author SHA1 Message Date
Zdenek Kabelac
4d54400486 tests: extend harness with output of /var/log/messages
Add a very simple hack for embeding /var/log/messages into
the tests output - it's not ideal since it sometimes breaks lines,
but still gives valuable info.
2013-09-12 13:30:12 +02: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
Zdenek Kabelac
ac2de55d69 test: timeout when no write happens since last written line
Change current test abort after 3 minutes, to abort after 3 minutes
without written output line.
2013-09-09 12:17:11 +02:00
Petr Rockai
fe6b19a6a3 test: Add the 64b fc17 kernel to the mirror recovery blacklist. 2013-09-06 16:50:05 +02:00
Petr Rockai
374653f2b5 test: Include tests that timed out in the final summary. 2013-09-04 16:21:08 +02:00
Petr Rockai
7918217c75 test: Fix a spurious failure in skip_if_mirror_recovery_broken. 2013-09-03 20:06:24 +02: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
Zdenek Kabelac
7cc36a93f6 tests: add delay_dev
Function to create slower responsive device.

Useful for testing things which needs to happen something during on
going operation - with  'delayed' device - much smaller sizes of devices
are needed and its much more deterministic (though still not optimal)
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
Petr Rockai
8b3664dc8d test: Set the timeout to 3 minutes (was 5s accidentally). 2013-08-28 14:53:23 +02:00
Petr Rockai
64fe17dc94 test: Add a new "check_full" target, which also tests with real /dev.
The original "check" target stays confined to a local device directory, while
check_full does 6 flavours, 3 with a local device directory and 3 with the
global /dev directory (the latter are prefixed with "s" for
"system"). I.e.: normal, cluster, lvmetad, snormal, scluster, slvmetad.
2013-08-28 14:53:23 +02:00
Petr Rockai
b516a72b11 test: Check for flavoured variables earlier.
This is necessary to make LVM_TEST_DEVDIR flavourable, and in turn have flavours
that use the global /dev (which can in turn be managed by udev).
2013-08-28 14:53:23 +02:00
Petr Rockai
d07cf851e5 test: Remove a redundant drain() from the timeout path. 2013-08-28 14:53:23 +02:00
Petr Rockai
c1217e6881 test: Make timeouts a little more robust & verbose. 2013-08-28 14:53:23 +02:00
Petr Rockai
9a1da7b262 TEST: Add a timeout to the harness, killing tests after 2 minutes. 2013-08-28 14:53:23 +02: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
Marian Csontos
732e609fe2 test: Fix false positives due to open devices
Something is rather randomly keeping devices open. As it is a known udev
feature, waiting for transaction may (or may not) help.
2013-08-14 16:04:01 +02: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
5d9628475e libdm: add DM_ABORT_ON_INTERNAL_ERRORS
Support tests with abort when libdm encounters internal
error - i.e. for dmsetup tool.

Code execution will be aborted when
env var DM_ABORT_ON_INTERNAL_ERRORS is set to 1
2013-07-31 15:27:34 +02:00
Peter Rajnoha
ba1a8878d0 tests: add profileconf fn to generate profiles
profileconf <profile_name> <config> ...
2013-07-30 15:44:15 +02:00
Tony Asleson
9b28255aac python unit test: Limit PVs to use
When running in the context of the test framework
we need to limit our PVs to use to those created
in the framework.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-07-26 16:43:49 -05:00
Tony Asleson
df6f0f71b1 python unit test: White space/pep8 cleanup
pep8 compliant, except for using tabs instead of
spaces.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-07-26 10:24:08 -05:00
Tony Asleson
929d5f3563 python-lvm: Change exception back to LibLVMerror
This is an API exposed name and shouldn't be changed
to _LibLVMError.

Signed-off-by: Tony Asleson <tasleson@redhat.com>
2013-07-24 17:55:12 -05: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
eaa1f0eb15 api test: remove unused variable 2013-07-15 09:26:31 +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