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

1487 Commits

Author SHA1 Message Date
Zdenek Kabelac
a0e40bad1d tests: used cache_pool adds _cpool 2019-10-21 15:32:35 +02:00
David Teigland
5714c8c9cc pvck: dump metadata search
Improve the implementation of extracting all text metadata
copies from the metadata area.  Use this for the existing
metadata_all dump option.

Add a new metadata_search dump option which does not use
lvm headers to find metadata, but looks in standard
locations.  This is useful if headers are damaged and
can't be used to locate metadata.

Adding '-v' to metadata_all or metadata_search will add
the description and creation_time to the printed list of
metadata instances that are found.
2019-10-18 12:26:29 -05:00
Zdenek Kabelac
4f860f79ff tests: cachevol needs FORMAT2
FORMAT2 is mandatory with cachevols...
2019-10-17 13:03:50 +02:00
Zdenek Kabelac
f07e5c1fe4 tests: skip when raid is not present 2019-10-17 13:03:50 +02:00
David Teigland
55bf692bff tests: metadata-zero-space long vgnames
In the hex dump output, grep for the vgname
followed by one space.  This allows for test pids
with up to seven digits, which are used to contruct
the variable vgname used by the test.  Otherwise
the long vgname wraps to the next line and fails to
match in grep.
2019-10-16 09:46:48 -05:00
David Teigland
998e7b1075 writecache: add cvol suffix to attached cachevol
When an LV is used as a writecache cachevol, give
it the LV name a _cvol suffix.  Remove the suffix
when the cachevol is detached, restoring the
original LV name.
2019-10-15 16:03:34 -05:00
Zdenek Kabelac
6666c39346 tests: cvol 2019-10-14 15:20:25 +02:00
Zdenek Kabelac
c70bab7531 tests: drop manipulation with 'internal' LV
Cachevol LV is 'internal' LV and should not be 'maintained'  this way
while it's being used as cachevol.
2019-10-14 15:20:25 +02:00
Zdenek Kabelac
e6691aa04b tests: disable caching of VDO
Disable until vdo gets fixed, then require fixed version.
Otherwise test kills kernel
2019-10-14 15:13:47 +02:00
Marian Csontos
df26b73b8e test: Minimize data written by metadata-zero-space
The test is checking only 2 megabytes, but is rewriting much more. Bad
for limited ramdisk.
2019-10-09 15:11:03 +02:00
David Teigland
d693041149 tests: add wipefs wrapper
which falls back to using dd on old systems without
the wipefs command
2019-10-02 14:11:08 -05:00
David Teigland
c2ff8876f9 tests: update to md dev name
Use /dev/md33 instead of /dev/md0 to reduce chances of
conflicting with an existing name.

Only call 'mdadm --stop /dev/md33' for cleanup and don't
use 'mdadm --stop --scan' to avoid stopping other md devs.
2019-10-02 14:09:51 -05:00
Heinz Mauelshagen
b138a87f43 test: increase size of raid10 LV allowing tests to succeed on fast storage
Also add health char check.
2019-10-02 15:25:43 +02:00
Heinz Mauelshagen
242e2dccc3 test: add RAID lvextend resynchronization test
Due to a dm-raid target flaw fixed in target version 1.15.0,
extents of raid sets don't get resynchronized when new MD bitmp
pages have to be allocated due to the extension.

Introduce lvextend-raid.sh to test this flaw.

Related: rhbz1671964
2019-10-02 15:25:41 +02:00
Heinz Mauelshagen
c4aba47dd0 test: add checks for not 100% sync ratio after initiation of check/repair
Related: rhbz1640630
2019-10-02 15:25:30 +02:00
David Teigland
7368cf8e7d pvck: handle PVs with zero metadata copies 2019-09-30 16:20:17 -05:00
David Teigland
1bfae5bf8e tests: update duplicate md tests
adjust to recent improvements in duplicate handling
2019-09-30 11:38:10 -05:00
David Teigland
9680fd6d78 tests: skip md tests if system not clean 2019-09-27 12:40:42 -05:00
David Teigland
0673d13518 tests: writecache-split check have_writecache 2019-09-26 10:45:53 -05:00
David Teigland
3b36de573e tests: update cache-single-split
add some uncache commands
2019-09-24 15:51:05 -05:00
David Teigland
e35cf0f623 tests: add writecache-split 2019-09-23 16:35:01 -05:00
David Teigland
a353bfdd9f tests: update cache-single-split
enable splitting while LV is active which works
again since the cvol suffix was dropped.
2019-09-23 14:21:09 -05:00
David Teigland
338a60bb41 tests: update cache-single-split
the new use of uuid suffixes on internal dm devs
has impacted splitting when an LV is active,
so temporarily disable that until fixed.
2019-09-20 16:36:14 -05:00
David Teigland
8d8b5e4f75 tests: add cache-single-split 2019-09-20 09:59:37 -05:00
Zdenek Kabelac
38a3da532f tests: check vdo 2019-09-17 13:17:21 +02:00
Zdenek Kabelac
ee6b9b78ec tests: pool conversion
Test conversion of cached LV.
2019-09-17 13:13:49 +02:00
David Teigland
196a9ed59f tests: metadata-zero-space more debugging 2019-09-12 14:38:20 -05:00
David Teigland
585db87274 tests: skip some without wipefs 2019-09-12 11:23:30 -05:00
David Teigland
82b887a4cf tests: more debug in metadata-zero-space 2019-09-12 11:19:44 -05:00
David Teigland
1fe04f89ef tests: use standard md devices 2019-09-12 10:11:27 -05:00
David Teigland
772dbb1e39 tests: metadata-zero-space add info for debugging 2019-09-11 14:20:59 -05:00
David Teigland
447ba5f1c2 tests: skip without xxd 2019-09-11 14:01:55 -05:00
David Teigland
31b6a04e4c tests: open-file-limit skip without prlimit 2019-09-11 14:01:55 -05:00
David Teigland
69b7c00a77 tests: allow-mixed-block-sizes skip with older losetup 2019-09-11 14:01:55 -05:00
David Teigland
715d2c778f tests: cache-single tests require version 1 10 2019-09-11 14:01:55 -05:00
David Teigland
acb8050a30 tests: metadata-bad-text.sh with lvmlockd
skip part of test that doesn't apply
2019-09-05 15:27:52 -05:00
David Teigland
25b58310e3 pvscan: avoid full scan for activation
When an online PV completed a VG, the standard
activation functions were used to activate the VG.
These functions use a full scan of all devs.
When many pvscans are run during startup and need
to activate many VGs, scanning all devs from all
the pvscans can take a long time.

Optimize VG activation in pvscan to scan only the
devs in the VG being activated.  This makes use of
the online file info that was used to determine
the VG was complete.

The downside of this approach is that pvscan activation
will not detect duplicate PVs and block activation,
where a normal activation command (which scans all
devices) would.
2019-09-03 10:11:16 -05:00
David Teigland
987f2733c7 tests: duplicate-pvs-md
Testing duplicate PV handling for various md device setups/states.
2019-08-16 13:26:12 -05:00
Zdenek Kabelac
e653f43732 tests: simplify some var settings
scan_lvs now automatically comes with extend_filter_LVMTEST
2019-08-09 12:57:21 +02:00
Zdenek Kabelac
05c7e09e71 tests: for cluster testing we always need exclusive mirrors
Cluster test would fail without exlusively activated mirror.
FIXME: test is still broken, since LV2 is not active after split.
2019-08-09 12:57:21 +02:00
Zdenek Kabelac
505c1d56e8 tests: accept also value 512
Older kernels provide fixed value 512 instead of 0.
2019-08-09 12:57:21 +02:00
Zdenek Kabelac
1e553159d5 tests: add settle wait before issue remove
Some older BB with older cryptsetup tool do not 'retry' on remove
and when  remove is issued right after 'fsck'  - it might be
rejected with:

Device @PREFIX@-tcrypt2 is busy.

Try to use udevadm settle.
2019-08-09 12:57:21 +02:00
Zdenek Kabelac
d3903d94e9 tests: fix ra checking
Since with some installed package like 'tuned' the value of 'RA' on
PV origin device can be different, adapting tests to count with this.
2019-08-09 12:57:21 +02:00
David Teigland
3fcb4697f6 tests: open-file-limit 2019-08-08 15:45:03 -05:00
David Teigland
cd8a0133fa tests: allow-mixed-block-sizes 2019-08-01 10:13:41 -05:00
David Teigland
e3ba8561fa tests: large-physical-sector-size 2019-07-30 15:59:11 -05:00
David Teigland
aa58f9bd9b tests: lvm-on-md use variable run dir
for hints file
2019-07-12 16:51:49 -05:00
David Teigland
bbca70a0b7 tests: metadata-zero-space
Test zero padding between copies of metadata.
2019-07-12 15:03:47 -05:00
David Teigland
7230aa891c tests: pvscan-autoactivate test unmatching dev and PV size 2019-07-11 11:38:12 -05:00
David Teigland
4eb0e65693 tests: extend lvm-on-md 2019-07-11 11:20:06 -05:00
David Teigland
f938545687 cache: warn and prompt for writeback with cachevol
The cache repair utility does not yet work with a cachevol
(where metadata and data exist on the same LV.)  So, warn
and prompt if writeback is specified with a cachevol.
2019-07-02 11:03:03 -05:00
Marian Csontos
ba9d152aa5 test: Remove now useless clvmd test 2019-06-27 11:14:00 +02:00
David Teigland
9ba45d824a tests: add exported.sh
to test how commands work with exported VGs/PVs.
2019-06-25 15:45:47 -05:00
David Teigland
8fecd9c14e metadata: include description with command in metadata areas
Previously the VG metadata description field (which contains
the command line) was only included in backup/archive copies
of the metadata.  Now also include it in the metadata written
to the metadata areas.
2019-06-20 16:09:05 -05:00
David Teigland
d7c1168c6a tests: add metadata-bad-mdaheader.sh
needs xxd command
2019-06-07 15:54:04 -05:00
David Teigland
878741502a tests: add metadata-bad-text.sh 2019-06-07 15:54:04 -05:00
David Teigland
4fa1638301 tests: add outdated-pv.sh 2019-06-07 15:54:04 -05:00
David Teigland
9156640b60 tests: add metadata-old.sh 2019-06-07 15:54:04 -05:00
David Teigland
d3636ff832 tests: add missing-pv missing-pv-unused 2019-06-07 15:54:04 -05:00
David Teigland
ba7ff96faf improve reading and repairing vg metadata
The fact that vg repair is implemented as a part of vg read
has led to a messy and complicated implementation of vg_read,
and limited and uncontrolled repair capability.  This splits
read and repair apart.

Summary
-------

- take all kinds of various repairs out of vg_read
- vg_read no longer writes anything
- vg_read now simply reads and returns vg metadata
- vg_read ignores bad or old copies of metadata
- vg_read proceeds with a single good copy of metadata
- improve error checks and handling when reading
- keep track of bad (corrupt) copies of metadata in lvmcache
- keep track of old (seqno) copies of metadata in lvmcache
- keep track of outdated PVs in lvmcache
- vg_write will do basic repairs
- new command vgck --updatemetdata will do all repairs

Details
-------

- In scan, do not delete dev from lvmcache if reading/processing fails;
  the dev is still present, and removing it makes it look like the dev
  is not there.  Records are now kept about the problems with each PV
  so they be fixed/repaired in the appropriate places.

- In scan, record a bad mda on failure, and delete the mda from
  mda in use list so it will not be used by vg_read or vg_write,
  only by repair.

- In scan, succeed if any good mda on a device is found, instead of
  failing if any is bad.  The bad/old copies of metadata should not
  interfere with normal usage while good copies can be used.

- In scan, add a record of old mdas in lvmcache for later, do not repair
  them while reading, and do not let them prevent us from finding and
  using a good copy of metadata from elsewhere.  One result is that
  "inconsistent metadata" is no longer a read error, but instead a
  record in lvmcache that can be addressed separate from the read.

- Treat a dev with no good mdas like a dev with no mdas, which is an
  existing case we already handle.

- Don't use a fake vg "handle" for returning an error from vg_read,
  or the vg_read_error function for getting that error number;
  just return null if the vg cannot be read or used, and an error_flags
  arg with flags set for the specific kind of error (which can be used
  later for determining the kind of repair.)

- Saving an original copy of the vg metadata, for purposes of reverting
  a write, is now done explicitly in vg_read instead of being hidden in
  the vg_make_handle function.

- When a vg is not accessible due to "access restrictions" but is
  otherwise fine, return the vg through the new error_vg arg so that
  process_each_pv can skip the PVs in the VG while processing.
  (This is a temporary accomodation for the way process_each_pv
  tracks which devs have been looked at, and can be dropped later
  when process_each_pv implementation dev tracking is changed.)

- vg_read does not try to fix or recover a vg, but now just reads the
  metadata, checks access restrictions and returns it.
  (Checking access restrictions might be better done outside of vg_read,
   but this is a later improvement.)

- _vg_read now simply makes one attempt to read metadata from
  each mda, and uses the most recent copy to return to the caller
  in the form of a 'vg' struct.
  (bad mdas were excluded during the scan and are not retried)
  (old mdas were not excluded during scan and are retried here)

- vg_read uses _vg_read to get the latest copy of metadata from mdas,
  and then makes various checks against it to produce warnings,
  and to check if VG access is allowed (access restrictions include:
  writable, foreign, shared, clustered, missing pvs).

- Things that were previously silently/automatically written by vg_read
  that are now done by vg_write, based on the records made in lvmcache
  during the scan and read:
  . clearing the missing flag
  . updating old copies of metadata
  . clearing outdated pvs
  . updating pv header flags

- Bad/corrupt metadata are now repaired; they were not before.

Test changes
------------

- A read command no longer writes the VG to repair it, so add a write
  command to do a repair.
  (inconsistent-metadata, unlost-pv)

- When a missing PV is removed from a VG, and then the device is
  enabled again, vgck --updatemetadata is needed to clear the
  outdated PV before it can be used again, where it wasn't before.
  (lvconvert-repair-policy, lvconvert-repair-raid, lvconvert-repair,
   mirror-vgreduce-removemissing, pv-ext-flags, unlost-pv)

Reading bad/old metadata
------------------------

- "bad metadata": the mda_header or metadata text has invalid fields
  or can't be parsed by lvm.  This is a form of corruption that would
  not be caused by known failure scenarios.  A checksum error is
  typically included among the errors reported.

- "old metadata": a valid copy of the metadata that has a smaller seqno
  than other copies of the metadata.  This can happen if the device
  failed, or io failed, or lvm failed while commiting new metadata
  to all the metadata areas.  Old metadata on a PV that has been
  removed from the VG is the "outdated" case below.

When a VG has some PVs with bad/old metadata, lvm can simply ignore
the bad/old copies, and use a good copy.  This is why there are
multiple copies of the metadata -- so it's available even when some
of the copies cannot be used.  The bad/old copies do not have to be
repaired before the VG can be used (the repair can happen later.)

A PV with no good copies of the metadata simply falls back to being
treated like a PV with no mdas; a common and harmless configuration.

When bad/old metadata exists, lvm warns the user about it, and
suggests repairing it using a new metadata repair command.
Bad metadata in particular is something that users will want to
investigate and repair themselves, since it should not happen and
may indicate some other problem that needs to be fixed.

PVs with bad/old metadata are not the same as missing devices.
Missing devices will block various kinds of VG modification or
activation, but bad/old metadata will not.

Previously, lvm would attempt to repair bad/old metadata whenever
it was read.  This was unnecessary since lvm does not require every
copy of the metadata to be used.  It would also hide potential
problems that should be investigated by the user.  It was also
dangerous in cases where the VG was on shared storage.  The user
is now allowed to investigate potential problems and decide how
and when to repair them.

Repairing bad/old metadata
--------------------------

When label scan sees bad metadata in an mda, that mda is removed
from the lvmcache info->mdas list.  This means that vg_read will
skip it, and not attempt to read/process it again.  If it was
the only in-use mda on a PV, that PV is treated like a PV with
no mdas.  It also means that vg_write will also skip the bad mda,
and not attempt to write new metadata to it.  The only way to
repair bad metadata is with the metadata repair command.

When label scan sees old metadata in an mda, that mda is kept
in the lvmcache info->mdas list.  This means that vg_read will
read/process it again, and likely see the same mismatch with
the other copies of the metadata.  Like the label_scan, the
vg_read will simply ignore the old copy of the metadata and
use the latest copy.  If the command is modifying the vg
(e.g. lvcreate), then vg_write, which writes new metadata to
every mda on info->mdas, will write the new metadata to the
mda that had the old version.  If successful, this will resolve
the old metadata problem (without needing to run a metadata
repair command.)

Outdated PVs
------------

An outdated PV is a PV that has an old copy of VG metadata
that shows it is a member of the VG, but the latest copy of
the VG metadata does not include this PV.  This happens if
the PV is disconnected, vgreduce --removemissing is run to
remove the PV from the VG, then the PV is reconnected.
In this case, the outdated PV needs have its outdated metadata
removed and the PV used flag needs to be cleared.  This repair
will be done by the subsequent repair command.  It is also done
if vgremove is run on the VG.

MISSING PVs
-----------

When a device is missing, most commands will refuse to modify
the VG.  This is the simple case.  More complicated is when
a command is allowed to modify the VG while it is missing a
device.

When a VG is written while a device is missing for one of it's PVs,
the VG metadata is written to disk with the MISSING flag on the PV
with the missing device.  When the VG is next used, it is treated
as if the PV with the MISSING flag still has a missing device, even
if that device has reappeared.

If all LVs that were using a PV with the MISSING flag are removed
or repaired so that the MISSING PV is no longer used, then the
next time the VG metadata is written, the MISSING flag will be
dropped.

Alternative methods of clearing the MISSING flag are:

vgreduce --removemissing will remove PVs with missing devices,
or PVs with the MISSING flag where the device has reappeared.

vgextend --restoremissing will clear the MISSING flag on PVs
where the device has reappeared, allowing the VG to be used
normally.  This must be done with caution since the reappeared
device may have old data that is inconsistent with data on other PVs.

Bad mda repair
--------------

The new command:
vgck --updatemetadata VG

first uses vg_write to repair old metadata, and other basic
issues mentioned above (old metadata, outdated PVs, pv_header
flags, MISSING_PV flags).  It will also go further and repair
bad metadata:

. text metadata that has a bad checksum
. text metadata that is not parsable
. corrupt mda_header checksum and version fields

(To keep a clean diff, #if 0 is added around functions that
are replaced by new code.  These commented functions are
removed by the following commit.)
2019-06-07 15:54:04 -05:00
David Teigland
db98a6e362 Additional MD component checking
If udev info is missing for a device, (which would indicate
if it's an MD component), then do an end-of-device read to
check if a PV is an MD component.  (This is skipped when
using hints since we already know devs in hints are good.)

A new config setting md_component_checks can be used to
disable the additional end-of-device MD checks, or to
always enable end-of-device MD checks.

When both hints and udev info are disabled/unavailable,
the end of PVs will now be scanned by default.  If md
devices with end-of-device superblocks are not being
used, the extra I/O overhead can be avoided by setting
md_component_checks="start".
2019-06-07 13:27:16 -05:00
David Teigland
c315112a3b tests: pvscan-autoactivate check for machine-id 2019-06-06 15:32:42 -05:00
David Teigland
356ea897cc tests: pvck-dump 2019-06-05 13:58:26 -05:00
Zdenek Kabelac
4d9f41b119 tests: check no_discard_passdown
Check reporting works
2019-06-05 15:48:44 +02:00
Marian Csontos
669a834981 test: Increase latency in pvmove-resume-multiseg
The test was failing consistently on some VMs (F25), and inconsistently
on Rawhide.

With increased latency these failures are no longer reproducible.

Reproducer:

    make check_lvmpolld T=pvmove-resume-multiseg.sh
2019-06-03 16:57:49 +02:00
David Teigland
eebb5e9fff tests: add debug to pvscan-cache deactivation 2019-05-23 15:32:46 -05:00
David Teigland
e055b89d28 tests: pvscan-cache more attempts to fix 2019-05-23 14:55:57 -05:00
David Teigland
1022b88a66 tests: change mkfs usage in lvconvert raid tests
The "echo y | mkfs" was failing at times from echo y.
Remove echo y and replace with wipefs -a prior to mkfs.
2019-05-23 11:45:26 -05:00
David Teigland
6169c0a51b tests: fix error detection in lvconvert-raid-takeover.sh 2019-05-23 10:29:52 -05:00
David Teigland
2036608423 tests: pvscan-cache try to fix teardown problems
teardown after the test was failing, probably because
of uncoordinated udev actions running on the test
system.  Try to avoid this by doing some work before
teardown.
2019-05-22 11:55:48 -05:00
David Teigland
78afe75b08 tests: fsadm-crypt.sh update mkfs parameter
mkfs.xfs was rejecting previously working value
2019-05-21 14:46:01 -05:00
David Teigland
cf3f463929 tests: pvscan-autoactivate.sh switch system_id_source
to machineid instead of uname which would break if
the test system had no proper uname set.
2019-05-21 14:37:55 -05:00
David Teigland
99ca06ca46 tests: hints check if strace exists
avoid test failure if test system does not
have strace
2019-05-21 14:24:57 -05:00
Zdenek Kabelac
0c26aa13ca tests: check accepting out-of-range creation_time 2019-05-10 15:00:21 +02:00
Zdenek Kabelac
1f7c9da554 tests: split args
Here we want args to be splited into individual strings.
2019-05-06 13:02:45 +02:00
Zdenek Kabelac
4ff472b907 tests: drop call of wipefs
wipefs might not be present on test system.
Devices are also already zeroed by cleanup_md_dev
(which 'fakes' missing wipefs eventually)
2019-05-04 19:11:00 +02:00
David Teigland
6ff1583c1b tests: expand lvm-on-md
test both md raid0 and raid1
2019-05-03 14:39:42 -05:00
Zdenek Kabelac
ac627fd1ce tests: use luks1 for test
Since we do not need anywhere luks2 - pick older format
which does not require password for resize to keep
the rest of test unmodified.
2019-05-03 13:17:22 +02:00
Zdenek Kabelac
8c56e31134 tests: update resize value
Since we now properly extend also _pmspare - there was not enough free
space to add 8extents to both volumes.
2019-05-03 13:17:22 +02:00
David Teigland
8c87dda195 locking: unify global lock for flock and lockd
There have been two file locks used to protect lvm
"global state": "ORPHANS" and "GLOBAL".

Commands that used the ORPHAN flock in exclusive mode:
  pvcreate, pvremove, vgcreate, vgextend, vgremove,
  vgcfgrestore

Commands that used the ORPHAN flock in shared mode:
  vgimportclone, pvs, pvscan, pvresize, pvmove,
  pvdisplay, pvchange, fullreport

Commands that used the GLOBAL flock in exclusive mode:
  pvchange, pvscan, vgimportclone, vgscan

Commands that used the GLOBAL flock in shared mode:
  pvscan --cache, pvs

The ORPHAN lock covers the important cases of serializing
the use of orphan PVs.  It also partially covers the
reporting of orphan PVs (although not correctly as
explained below.)

The GLOBAL lock doesn't seem to have a clear purpose
(it may have eroded over time.)

Neither lock correctly protects the VG namespace, or
orphan PV properties.

To simplify and correct these issues, the two separate
flocks are combined into the one GLOBAL flock, and this flock
is used from the locking sites that are in place for the
lvmlockd global lock.

The logic behind the lvmlockd (distributed) global lock is
that any command that changes "global state" needs to take
the global lock in ex mode.  Global state in lvm is: the list
of VG names, the set of orphan PVs, and any properties of
orphan PVs.  Reading this global state can use the global lock
in sh mode to ensure it doesn't change while being reported.

The locking of global state now looks like:

lockd_global()
  previously named lockd_gl(), acquires the distributed
  global lock through lvmlockd.  This is unchanged.
  It serializes distributed lvm commands that are changing
  global state.  This is a no-op when lvmlockd is not in use.

lockf_global()
  acquires an flock on a local file.  It serializes local lvm
  commands that are changing global state.

lock_global()
  first calls lockf_global() to acquire the local flock for
  global state, and if this succeeds, it calls lockd_global()
  to acquire the distributed lock for global state.

Replace instances of lockd_gl() with lock_global(), so that the
existing sites for lvmlockd global state locking are now also
used for local file locking of global state.  Remove the previous
file locking calls lock_vol(GLOBAL) and lock_vol(ORPHAN).

The following commands which change global state are now
serialized with the exclusive global flock:

pvchange (of orphan), pvresize (of orphan), pvcreate, pvremove,
vgcreate, vgextend, vgremove, vgreduce, vgrename,
vgcfgrestore, vgimportclone, vgmerge, vgsplit

Commands that use a shared flock to read global state (and will
be serialized against the prior list) are those that use
process_each functions that are based on processing a list of
all VG names, or all PVs.  The list of all VGs or all PVs is
global state and the shared lock prevents those lists from
changing while the command is processing them.

The ORPHAN lock previously attempted to produce an accurate
listing of orphan PVs, but it was only acquired at the end of
the command during the fake vg_read of the fake orphan vg.
This is not when orphan PVs were determined; they were
determined by elimination beforehand by processing all real
VGs, and subtracting the PVs in the real VGs from the list
of all PVs that had been identified during the initial scan.
This is fixed by holding the single global lock in shared mode
while processing all VGs to determine the list of orphan PVs.
2019-04-29 13:01:05 -05:00
David Teigland
aa75b31db5 pvscan: handle case of scanning PV without metadata last
Handle the case where pvscan --cache -aay (with no dev args)
gets to the final PV, completing the VG, but that final PV does not
have VG metadata.  In this case, we need to use VG metadata from a
previously scanned PV in the same VG, which we saved for this
possibility.  Using this saved metadata, we can find which VG
this PVID belongs to, and then check if that VG is now complete,
and if so add the VG name to the list of complete VGs to be
autoactivated.
2019-04-15 11:27:49 -05:00
David Teigland
41ba2b568b tests: disable unworking pvscan case
and add corresponding fixme in the code
2019-04-12 15:40:38 -05:00
David Teigland
48e9f116ae tests: update pvscan-autoactivate for init change 2019-04-05 14:04:42 -05:00
Zdenek Kabelac
5d6fe796bd tests: check auto-growth of thin-pool meta 2019-04-03 13:28:56 +02:00
Zdenek Kabelac
7f757ab616 tests: vdo caching tests 2019-03-20 14:39:11 +01:00
Zdenek Kabelac
5139e5f1b3 tests: vdo dmevent autoresize 2019-03-20 14:39:11 +01:00
Zdenek Kabelac
ac31bfd6fd tests: check vgsplit works with cache 2019-03-20 14:38:05 +01:00
David Teigland
d84134c75b pvscan: fix ignoring foreign PVs
Fix to previous commit
  "pvscan: ignore online for shared and foreign PVs"

which was incorrectly considering a PV foreign if its
VG had no system ID when the host did have a system ID.
2019-03-13 16:03:02 -05:00
David Teigland
98b7a3a42d tests: check that pvscan --cache ignores certain PVs 2019-03-06 12:17:47 -06:00
David Teigland
a9eaab6beb Use "cachevol" to refer to cache on a single LV
and "cachepool" to refer to a cache on a cache pool object.

The problem was that the --cachepool option was being used
to refer to both a cache pool object, and to a standard LV
used for caching.  This could be somewhat confusing, and it
made it less clear when each kind would be used.  By
separating them, it's clear when a cachepool or a cachevol
should be used.

Previously:

- lvm would use the cache pool approach when the user passed
  a cache-pool LV to the --cachepool option.

- lvm would use the cache vol approach when the user passed
  a standard LV in the --cachepool option.

Now:

- lvm will always use the cache pool approach when the user
  uses the --cachepool option.

- lvm will always use the cache vol approach when the user
  uses the --cachevol option.
2019-02-27 08:52:34 -06:00
David Teigland
74a388cca1 pvscan: autoactivate a VG once
When a VG has multiple PVs, and all those PVs come online
at the same time, concurrent pvscans for each PV will all
create the individual pvid files, and all will often see
the VG is now complete.  This causes each of the pvscan
commands to think it should activate the VG, so there
are multiple activations of the same VG.  The vg lock
serializes them, and only the first pvscan actually does
the activation, but there is still a lot of extra overhead
and time used by the other pvscans that attempt to
activate the already active VG.  This can lead to a backlog
of pvscans and timeouts.

To fix this, this adds a new /run/lvm/vgs_online/ dir that
works like the existing /run/lvm/pvs_online/ dir.  Each pvscan
that wants to activate a VG will first try to exlusively create
the file vgs_online/<vgname>.  Only the first pvscan will
succeed, and that one will do the VG activation. The other
pvscans will find the vgname file exists and will not do the
activation step.

When a PV goes offline, the vgs_online file for the corresponding
VG is removed.  This allows the VG to be autoactivated again
when the PV comes online again.  This requires that the vgname be
stored in the pvid files.
2019-02-21 15:17:41 -06:00
David Teigland
fedeab28c3 tests: set scan_lvs=1 in tests that stack PVs on LVs 2019-02-20 13:52:35 -06:00
Zdenek Kabelac
ab1fd0cb37 tests: rounding for pools changed to power of 2
Even with 64K chunk support, lvm2 will target power-of-2 chunks.
2019-01-28 22:17:27 +01:00
David Teigland
cbf62b9262 tests: use pvscan after enable_dev in process-each-duplicate-vgnames
instead of vgscan, so that new dev is recognized with hints
2019-01-28 11:38:05 -06:00
Zdenek Kabelac
fc02343eff tests: vdo dmeventd resize 2019-01-21 12:53:16 +01:00
Zdenek Kabelac
cbadf3d370 tests: initial test for vdo resize 2019-01-21 12:53:16 +01:00
Zdenek Kabelac
2cac4bfc15 tests: update cache test
Since migration_threshold is now protected to not be smaller
then 8*chunk_size - update tests to count with this modification.
2019-01-21 12:53:16 +01:00
David Teigland
5f102b3421 hints: invalidate when pvscan --cache sees a new PV
An idea from Zdenek for better ensuring valid hints by invalidating
them when pvscan --cache <device> sees a new PV, which is a case
where we know that hints should be invalidated.  This is triggered
from systemd/udev logic, and there may be some cases where it would
invalidate hints that the existing methods wouldn't detect.
2019-01-16 15:34:20 -06:00
David Teigland
6620dc9475 add device hints to reduce scanning
Save the list of PVs in /run/lvm/hints.  These hints
are used to reduce scanning in a number of commands
to only the PVs on the system, or only the PVs in a
requested VG (rather than all devices on the system.)
2019-01-15 10:23:47 -06:00
David Teigland
938b6b8253 writecache: prompt before using an LV to hold cache 2019-01-02 11:44:03 -06:00
Zdenek Kabelac
1dee4b4ffc tests: testing mirrorred mirror log
Enable mirrorlog creation for test.
2018-12-23 01:07:05 +01:00
Marian Csontos
93c7bca08f Revert "tests: Remove unsupported mirrored mirrorlog"
Incorrect cherry pick from another branch.

This reverts commit 07fc4866f0.
2018-12-18 10:55:35 +01:00
Marian Csontos
07fc4866f0 tests: Remove unsupported mirrored mirrorlog 2018-12-18 09:54:42 +01:00
Heinz Mauelshagen
e82303fd6a lvcreate/lvconvert: optionally reenable mirrored mirror log for testing purposes only
This is a followup patch to commit edb72cb70c
to support related lvm2 test suite tests.

A 'global/support_mirrored_mirror_log' bool configuration variable gets
introduced allowing the creation of, or conversion to mirrored 'mirror'
logs if set.  The capability to create these in turn allows the rest of
the tests to perform activation of such existing LVs and their conversions
to disk/core 'mirror' logs.

Display a disclaimer warning if enabled that this is not for regular use.

Add definition of the enabled config option to respective test scripts.

Related: rhbz1643562
2018-12-17 19:28:54 +01:00
David Teigland
73687b7b75 tests: lvm-on-md udev issues 2018-12-05 12:14:17 -06:00
Zdenek Kabelac
c0c318e4f2 tests: extend sleep 2018-11-30 13:03:09 +01:00
Zdenek Kabelac
e940293c33 tests: reduce memory footprint 2018-11-29 23:10:09 +01:00
Zdenek Kabelac
7da75f41ed tests: updates 2018-11-29 23:10:09 +01:00
Zdenek Kabelac
217d647a46 tests: requires at least 2 iterations 2018-11-29 23:10:09 +01:00
Zdenek Kabelac
5f87ba68d4 tests: use select with dmsetup
Use 'dmsetup -S' to greatly simplify such loops.
2018-11-29 23:10:09 +01:00
Zdenek Kabelac
74731a5277 tests: add mising udev_wait
mdadm does not handle udev waiting so it may exit earlier,
while devices are still 'running'.
2018-11-29 23:10:08 +01:00
David Teigland
904e1e3d26 Place the first PE at 1 MiB for all defaults
. When using default settings, this commit should change
  nothing.  The first PE continues to be placed at 1 MiB
  resulting in a metadata area size of 1020 KiB (for
  4K page sizes; slightly smaller for larger page sizes.)

. When default_data_alignment is disabled in lvm.conf,
  align pe_start at 1 MiB, based on a default metadata area
  size that adapts to the page size.  Previously, disabling
  this option would result in mda_size that was too small
  for common use, and produced a 64 KiB aligned pe_start.

. Customized pe_start and mda_size values continue to be
  set as before in lvm.conf and command line.

. Remove the configure option for setting default_data_alignment
  at build time.

. Improve alignment related option descriptions.

. Add section about alignment to pvcreate man page.

Previously, DEFAULT_PVMETADATASIZE was 255 sectors.
However, the fact that the config setting named
"default_data_alignment" has a default value of 1 (MiB)
meant that DEFAULT_PVMETADATASIZE was having no effect.

The metadata area size is the space between the start of
the metadata area (page size offset from the start of the
device) and the first PE (1 MiB by default due to
default_data_alignment 1.)  The result is a 1020 KiB metadata
area on machines with 4KiB page size (1024 KiB - 4 KiB),
and smaller on machines with larger page size.

If default_data_alignment was set to 0 (disabled), then
DEFAULT_PVMETADATASIZE 255 would take effect, and produce a
metadata area that was 188 KiB and pe_start of 192 KiB.
This was too small for common use.

This is fixed by making the default metadata area size a
computed value that matches the value produced by
default_data_alignment.
2018-11-26 16:36:50 -06:00
Zdenek Kabelac
b1e9fe9505 tests: update required raid target
For embeded reshaping operation require higher driver version.
(otherwise we get:

Converting vg/LV1 from raid6 (same as raid6_zr) is directly possible to the following layouts:
 raid6_nc
 raid6_nr
 raid6_la_6
 raid6_ls_6
 raid6_ra_6
 raid6_rs_6
 raid6_n_6
2018-11-19 18:08:54 +01:00
Zdenek Kabelac
b2261b5d81 tests: generate slightly less volumes 2018-11-19 13:42:23 +01:00
Zdenek Kabelac
54de0d829b tests: speed-up testing full of lvm2 metadata
Generate faster full metadata condition.

FIXME: vgremove is extremaly slow with larger set of LVs.
2018-11-19 13:16:03 +01:00
Zdenek Kabelac
a53024cafc tests: update parm for new kernel 2018-11-18 22:21:24 +01:00
Zdenek Kabelac
6d2609a232 tests: skip part of test
On kernel 4.8 this test piece oopses machine (fc23).
2018-11-18 22:03:50 +01:00
Zdenek Kabelac
0747a6d0de tests: create whole path with mkdir
Create also 'lvm' upper this if such one is missing in /run dir
and use '-p' with mkdir.
2018-11-18 22:03:50 +01:00
Zdenek Kabelac
f7adcb5f6d tests: skip portion of test for lvmpolld
lvmpolld ATM is not desingned to preserve interval checking
in the same way the 'lvconvert' tool is doing - so the passed
'-i 40' is not respected and lvmpolld autonomously checks
state of conversion and updates lvm2 metadata and dm tables
when needed.

So skip portion of test that relayed on this and preserve this logic
only for command line invocation and forking of polling process
where the interval of checking is under full control.
2018-11-18 22:03:50 +01:00
Zdenek Kabelac
14f24c2175 tests: skip when gcore from gdb package is missing
gcore is needed for gathering all userspace mappings.
2018-11-18 22:03:50 +01:00
Zdenek Kabelac
a23ed35f6c tests: drop unwanted backup 2018-11-17 00:30:50 +01:00
Zdenek Kabelac
97a95f9648 tests: raise minsize of xfs
mkfs.xfs now needs at least ~1600...
2018-11-17 00:30:50 +01:00
Zdenek Kabelac
fd8001a9fc tests: extend 2018-11-17 00:30:50 +01:00
Zdenek Kabelac
83d9ea7348 tests: secure data erase 2018-11-17 00:30:50 +01:00
Zdenek Kabelac
517332e78d tests: add wait loop
Add a little wait loop - since lvconvert started background process
and we need to wait till this bg task initiate its work -
adding ~1s loop should give reasonable enough time to start mirroring.
2018-11-12 15:30:40 +01:00
David Teigland
2f02e8d33a tests: specify m1 for raid1 in cache-single-types 2018-11-08 14:12:42 -06:00
Zdenek Kabelac
73132bc254 tests: futher test tunning 2018-11-08 17:19:39 +01:00
David Teigland
025332edc2 tests: add lvchange cachemode passthrough in cache-single-options 2018-11-08 10:08:38 -06:00
David Teigland
8794fb71db tests: enable cachepolicy cleaner in cache-single-options 2018-11-08 09:43:23 -06:00
David Teigland
e1e33e75e7 tests: enable writeback in cache-single-options 2018-11-08 09:40:41 -06:00
David Teigland
8c5fbd5fac tests: fix dd option in cache-single-options 2018-11-08 09:33:09 -06:00
Zdenek Kabelac
d4de3cfa4d tests: updates 2018-11-08 12:22:18 +01:00
David Teigland
3ae5569570 Add dm-writecache support
dm-writecache is used like dm-cache with a standard LV
as the cache.

$ lvcreate -n main -L 128M -an foo /dev/loop0

$ lvcreate -n fast -L 32M -an foo /dev/pmem0

$ lvconvert --type writecache --cachepool fast foo/main

$ lvs -a foo -o+devices
  LV            VG  Attr       LSize   Origin        Devices
  [fast]        foo -wi-------  32.00m               /dev/pmem0(0)
  main          foo Cwi------- 128.00m [main_wcorig] main_wcorig(0)
  [main_wcorig] foo -wi------- 128.00m               /dev/loop0(0)

$ lvchange -ay foo/main

$ dmsetup table
foo-main_wcorig: 0 262144 linear 7:0 2048
foo-main: 0 262144 writecache p 253:4 253:3 4096 0
foo-fast: 0 65536 linear 259:0 2048

$ lvchange -an foo/main

$ lvconvert --splitcache foo/main

$ lvs -a foo -o+devices
  LV   VG  Attr       LSize   Devices
  fast foo -wi-------  32.00m /dev/pmem0(0)
  main foo -wi------- 128.00m /dev/loop0(0)
2018-11-06 14:18:41 -06:00
David Teigland
cac4a9743a Allow dm-cache cache device to be standard LV
If a single, standard LV is specified as the cache, use
it directly instead of converting it into a cache-pool
object with two separate LVs (for data and metadata).

With a single LV as the cache, lvm will use blocks at the
beginning for metadata, and the rest for data.  Separate
dm linear devices are set up to point at the metadata and
data areas of the LV.  These dm devs are given to the
dm-cache target to use.

The single LV cache cannot be resized without recreating it.

If the --poolmetadata option is used to specify an LV for
metadata, then a cache pool will be created (with separate
LVs for data and metadata.)

Usage:

$ lvcreate -n main -L 128M vg /dev/loop0

$ lvcreate -n fast -L 64M vg /dev/loop1

$ lvs -a vg
  LV   VG Attr       LSize   Type   Devices
  main vg -wi-a----- 128.00m linear /dev/loop0(0)
  fast vg -wi-a-----  64.00m linear /dev/loop1(0)

$ lvconvert --type cache --cachepool fast vg/main

$ lvs -a vg
  LV           VG Attr       LSize   Origin       Pool  Type   Devices
  [fast]       vg Cwi---C---  64.00m                     linear /dev/loop1(0)
  main         vg Cwi---C--- 128.00m [main_corig] [fast] cache  main_corig(0)
  [main_corig] vg owi---C--- 128.00m                     linear /dev/loop0(0)

$ lvchange -ay vg/main

$ dmsetup ls
vg-fast_cdata   (253:4)
vg-fast_cmeta   (253:5)
vg-main_corig   (253:6)
vg-main (253:24)
vg-fast (253:3)

$ dmsetup table
vg-fast_cdata: 0 98304 linear 253:3 32768
vg-fast_cmeta: 0 32768 linear 253:3 0
vg-main_corig: 0 262144 linear 7:0 2048
vg-main: 0 262144 cache 253:5 253:4 253:6 128 2 metadata2 writethrough mq 0
vg-fast: 0 131072 linear 7:1 2048

$ lvchange -an vg/min

$ lvconvert --splitcache vg/main

$ lvs -a vg
  LV   VG Attr       LSize   Type   Devices
  fast vg -wi-------  64.00m linear /dev/loop1(0)
  main vg -wi------- 128.00m linear /dev/loop0(0)
2018-11-06 13:44:54 -06:00
Zdenek Kabelac
a427a93549 tests: fix shell quoting 2018-11-06 17:26:15 +01:00
Zdenek Kabelac
ad0268e239 tests: add wait for udev
Since the test is currently directly working with live directory,
which can be getting updates from system's udev - add wait
for settling so removal of all known PVs happens after that.
But still this has major influce on behavior of running system,
so the test should never be executed on a user used box.
2018-11-06 15:05:44 +01:00
David Teigland
7498f83833 tests: add new test for lvm on md devices 2018-10-18 13:06:42 -05:00
Zdenek Kabelac
015231b11f tests: better support for /var/run 2018-10-16 23:49:35 +02:00
Zdenek Kabelac
32f1afbe36 tests: add raid target presence check 2018-10-16 23:49:35 +02:00
Zdenek Kabelac
f1ac72c848 tests: properly enforce v1
Since with smq policy we can still pick format v2 - enforce
format v1 explicitely.
2018-10-16 21:56:00 +02:00
Zdenek Kabelac
4db228b907 tests: timing without /usr/bin/time
Use just 'date' so the 'time' package doesn't need to be installed
just for this purpose.
2018-10-16 21:56:00 +02:00
Zdenek Kabelac
c15ac326cc tests: fix tested targeted
Fix cut&paste bug.
2018-10-16 21:56:00 +02:00
Zdenek Kabelac
5c36ad06a1 tests: check activation of many thin-pool
Artifitical testing of monitoring of many thin-pools with low number
of resources in use (need only few pools to actually hit the race).
2018-10-10 09:54:08 +02:00
Heinz Mauelshagen
945d13541e tests: fix lvconvert-raid-reshape-linear_to_striped-single-type.sh
Add errouneously removed VG creation back in.
2018-09-19 14:53:41 +02:00
David Teigland
17bd91e33e tests: add metadata-full 2018-09-11 12:05:46 -05:00
Heinz Mauelshagen
3832329a6b tests: bump dm-raid version to 1.14.0
Commit 989626926c
introduced 2 new tests
lvconvert-raid-takeover-linear_to_raid4.sh and
lvconvert-raid-takeover-raid4_to_linear.sh
which involve raid reshaping.

Bump the checked dm-raid target version to 1.14.0
which has reshape kernel fixes to avoid test suite
runs to hang.
2018-09-11 16:05:48 +02:00
Heinz Mauelshagen
df67b1da4d tests: adjust target version to enable reshape tests
Bump target version to 1.14.0 which contains fixes
for reshape deadlock/corruption to allow tests to
run once the respective fixes show up in kernels.

Remove now superfluous multi-core checks.

Resolves: rhbz1501145
Related: rhbz1514539
Related: rhbz1586123
Related: rhbz1613039
2018-09-11 15:53:25 +02:00
David Teigland
07d2794a16 tests: remove lvmetad variation 2018-09-10 14:26:57 -05:00
David Teigland
b070c14a8b tests: drop lvmetad parts of system_id test 2018-09-10 14:08:27 -05:00
David Teigland
3bcc6c7e60 tests: drop lvmetad bits 2018-09-10 11:49:11 -05:00
Heinz Mauelshagen
989626926c lvconvert: allow raid4 -> linear conversion request
Allow "lvconvert --type linear RaidLV" on a raid4 LV
providing convenient interim steps to convert to linear.

Add respective new test
   lvconvert-raid-takeover-raid4_to_linear.sh
and
   lvconvert-raid-takeover-linear_to_raid4.sh
for linear to raid4 once on it.
2018-09-10 18:43:21 +02:00
Heinz Mauelshagen
e2e30a64ab lvconvert: fix interim segtype regression on raid6 conversions
When converting from striped/raid0/raid0_meta
to raid6 with > 2 stripes, allow possible
direct conversion (to raid6_n_6).

In case of 2 stripes, first convert to raid5_n to restripe
to at least 3 data stripes (the raid6 minimum in lvm2) in
a second conversion before finally converting to raid6_n_6.

As before, raid6_n_6 then can be converted
to any other raid6 layout.

Enhance lvconvert-raid-takeover.sh to test the
2 stripes conversions to raid6.

Resolves: rhbz1624038
2018-09-07 13:48:19 +02:00
Heinz Mauelshagen
61600f8fa7 test: comment fixes
Fix comments in

   test/shell/lvconvert-raid-reshape-stripes-load-fail.sh
   test/shell/lvconvert-raid-reshape-stripes-load-reload.sh
   test/shell/lvconvert-raid-reshape-stripes-load.sh
2018-08-31 15:09:55 +02:00
David Teigland
fa0a04236c tests: add scan-lvs 2018-08-30 10:00:36 -05:00
Heinz Mauelshagen
3c966e637f test: add striped -> raid0 test script 2018-08-22 17:12:44 +02:00
Heinz Mauelshagen
e83c4f07ca lvconvert: fix conversion attempts to linear
"lvconvert --type linear RaidLV" on striped and raid4/5/6/10
have to provide the convenient interim layouts.  Fix involves
a cleanup to the convenience type function.

As a result of testing, add missing sync waits to
lvconvert-raid-reshape-linear_to_raid6-single-type.sh.

Resolves: rhbz1447809
2018-08-22 17:12:43 +02:00
Heinz Mauelshagen
4578411633 lvconvert: fix regression preventing direct striped conversion
Conversion to striped from raid0/raid0_meta is directly possible.

Fix a regression setting superfluous interim raid5_n conversion type
introduced by commit bd7cdd0b09.

Add new test script lvconvert-raid0-striped.sh.

Resolves: rhbz1608067
2018-08-21 17:28:56 +02:00
Zdenek Kabelac
54668feaab tests: check policy mq can be used with format2 2018-08-07 17:59:50 +02:00
Zdenek Kabelac
d131024255 tests: splitmirror for mirror type 2018-08-07 17:59:50 +02:00
Heinz Mauelshagen
a004bb07f1 lvconvert: reject conversions on raid1 split trackchanges LVs
Prohibit, because the tracking can't continue and
further conversions may fail with bogus error messages.

Resolves: rhbz1579072
2018-07-26 02:05:54 +02:00
Heinz Mauelshagen
8b0729af0f lvconvert: reject conversions on raid1 split trackchanges SubLVs
Prohibit conversions of raid1 split trackchanges SubLVs
because they will fail to get merged back into the RaidLV.

Resolves: rhbz1579438
2018-07-26 02:05:49 +02:00
Heinz Mauelshagen
2f43f0393e test: new lvcreate-raid1-error-read.sh
Test for MD RAID kernel bug in read_balance() preventing
reads of failed sectors to get rescheduled to another leg.
2018-07-24 20:41:26 +02:00
David Teigland
63ec42f428 tests: remove lvmetad tests 2018-07-11 11:27:54 -05:00
David Teigland
edf3f86184 tests: fix mkdir pvs_online 2018-07-10 14:19:46 -05:00
David Teigland
06439a2562 tests: autoactivation tests for use without lvmetad
Adjust a few lvmetad pvscan/autoactivation tests to be
used without lvmetad, and add a test to cover some cases
that have not been tested before.
2018-07-10 10:49:34 -05:00
Zdenek Kabelac
c47655f231 tests: initial vdo tests
Basic functionality of lvcreate, lvchange.
2018-07-09 15:29:16 +02:00
Zdenek Kabelac
333eb8667e tests: check how thin-pool allocation works
Check allocation of thin-pool works on 2PVs, when one is so full,
that even metadata do not fit there (as they need at least 2M,
while 99% of 63MB fills >62MB)
2018-07-09 00:23:35 +02:00
Zdenek Kabelac
19b92ae3f3 tests: update with --yes
vgcfgrestore needs to confirm restore while LVs from VG are present.
2018-06-25 15:07:55 +02:00
David Teigland
3fd75d1bcd scan: use full md filter when md 1.0 devices are present
The md filter can operate in two native modes:
- normal: reads only the start of each device
- full: reads both the start and end of each device

md 1.0 devices place the superblock at the end of the device,
so components of this version will only be identified and
excluded when lvm uses the full md filter.

Previously, the full md filter was only used in commands
that could write to the device.  Now, the full md filter
is also applied when there is an md 1.0 device present
on the system.  This means the 'pvs' command can avoid
displaying md 1.0 components (at the cost of doubling
the i/o to every device on the system.)

(The md filter can operate in a third mode, using udev,
but this is disabled by default because there have been
problems with reliability of the info returned from udev.)
2018-06-15 12:21:25 -05:00
Zdenek Kabelac
b1729dbcdd tests: bigger lv
Although throttling slows down things considerable, it still could
reach the end before next test so use bigger LV.
2018-06-14 22:02:01 +02:00
David Teigland
a163d5341a tests: remove vgconvert usage 2018-06-13 14:16:28 -05:00
David Teigland
d067263f51 tests: remove metadata-dirs
metadata dirs are removed
2018-06-13 14:14:23 -05:00
David Teigland
885e57cb27 tests: lvmetad-pvscan-cache expect command to fail 2018-06-12 12:44:23 -05:00
David Teigland
7824bb710d tests: lvconvert-repair remove cluster test 2018-06-12 11:35:45 -05:00
David Teigland
4ce9579099 tests: remove vgsplit-usage cluster test 2018-06-08 14:01:05 -05:00
David Teigland
8266b7e951 tests: remove use of vgcreate -c option 2018-06-08 10:51:07 -05:00
Zdenek Kabelac
0e2a358da9 tests: check pvresize with metadata size
Test new size of a PV can keep also metadata.
2018-06-08 14:37:31 +02:00
Zdenek Kabelac
59dc9b445d tests: updates test for raid scanning 2018-06-08 14:37:31 +02:00
Zdenek Kabelac
bb7c064b23 tests: initial testing code for lvs while pvmove runs 2018-06-08 14:37:31 +02:00
Zdenek Kabelac
c93e0932e8 tests: check proper support of fmt2 with cleaner policy 2018-06-08 14:37:31 +02:00
David Teigland
e966752b86 tests: system_id remove clustered vg test 2018-06-07 16:17:04 +01:00
David Teigland
229582c97c tests: remove -cn option from some commands 2018-06-07 16:17:04 +01:00
Heinz Mauelshagen
3810fd8d0d test: add convcenience conversion tests linear <-> striped
Add tests for linear <-> striped|raid* conversions.

Add region_size config to reshape tests to avoid test
failures in case of it being defined unexpectedly in lvm.conf.

Related: rhbz1439925
Related: rhbz1447809
2018-06-05 16:23:18 +02:00
David Teigland
885eb2024f tests: enable non-working tests with lvmlockd
Those that are failing for reasons other than lvmlockd
restrictions.
2018-05-31 16:18:53 -05:00
David Teigland
00f6a8466e tests: enable more working tests with lvmlockd 2018-05-31 16:13:58 -05:00
David Teigland
caa600a409 tests: enable lvcreate-pvtags with lvmlockd 2018-05-31 15:37:25 -05:00
David Teigland
4a01e4f389 tests: enable metadata-balance with lvmlockd 2018-05-31 15:12:34 -05:00
David Teigland
08771bbbbf tests: enable lvmlockd with tests using lvcreate -H -L LV 2018-05-31 14:49:16 -05:00
David Teigland
2beb3009bd tests: change lvcreate syntax to allow lvmlockd
Using the less ambiguous lvcreate syntax for creating a
cache LV allows more tests to run with lvmlockd.
2018-05-30 16:40:03 -05:00
David Teigland
214235367b tests: enable lvcreate cache tests with lvmlockd
Tests that want to use lvcreate to create a new
origin LV and then combine it with an existing
cache pool to create a cache LV.
2018-05-30 15:56:08 -05:00
David Teigland
27495a3555 tests: enable pvmove-restart with lvmlockd 2018-05-30 13:56:06 -05:00
David Teigland
05ee83579b tests: enable vg repair tests with lvmlockd 2018-05-30 12:57:46 -05:00
David Teigland
abba06fb3b tests: process-each-duplicate-pvs update for lvmlockd 2018-05-30 09:25:45 -05:00
David Teigland
5c5e449dc5 lvmlockd: fix vgimportclone of a shared VG
The new VG from the duplicate PV is imported
as a local VG.
2018-05-30 09:25:45 -05:00
David Teigland
a40d447a02 tests: vgchange-usage update for lvmlockd 2018-05-30 09:25:45 -05:00
David Teigland
95cf127134 tests: vgcreate-usage update for lvmlockd 2018-05-30 09:25:45 -05:00
David Teigland
595196bc29 tests: enable lvmlockd for passing tests 2018-05-30 09:25:45 -05:00
David Teigland
6a44dceb48 tests: some missed skip with lvmlockd 2018-05-30 09:25:45 -05:00
David Teigland
28c8e95d19 scan: refresh paths and retry open
If scanning fails to open any devices, refresh the
device paths in dev cache, and retry the opens.
2018-05-25 13:09:07 -05:00
Zdenek Kabelac
3702f39ef3 tests: improve usability on older systems 2018-05-24 16:02:31 +02:00
Zdenek Kabelac
a90de76fd8 tests: checking scanning correctness 2018-05-24 11:22:32 +02:00
Zdenek Kabelac
f865e1bf87 tests: passthrough args with extend_filter_LVMTEST
Don't rebuild config twice.
2018-05-24 11:22:59 +02:00
Zdenek Kabelac
89f34eaf0c tests: correcting symlink manipulation
Fix symlink and add 'verbose' pvs for a while for checking
scanning correctness.
2018-05-24 11:22:32 +02:00
David Teigland
3c9ed33f83 scan: move warnings about duplicate devices
We have been warning about duplicate devices (and disabling lvmetad)
immediately when the dup was detected (during label_scan).  Move the
warnings (and the disabling) to happen later, after label_scan is
finished.

This lets us avoid an unwanted warning message about duplicates
in the special case were md components are eliminated during the
duplicate device resolution.
2018-05-21 16:48:02 -05:00
Rick Elrod
8c453e2e5e cleanup: fix grammar in output - less then -> less than
This minor patch fixes grammar in a few messages which get
printed to users. It also fixes the same grammar mistake in
several comments.

Signed-off-by: Rick Elrod <relrod@redhat.com>
--
2018-05-17 10:37:45 +02:00
Zdenek Kabelac
3b3ee66b1f tests: time limit waiting on lvmetad kill 2018-05-15 22:02:41 +02:00
Zdenek Kabelac
b5da4fdfce tests: drop junk 2018-05-15 22:02:41 +02:00
Zdenek Kabelac
d25c135806 tests: fix size of COW
Needs to be changed to match 4K extent_size.
2018-05-15 16:49:53 +02:00
Zdenek Kabelac
0e56fa6892 tests: old systems do not have even throttling
When even throttling is not available, skip or use  should
with particular test piece.
2018-05-12 23:37:30 +02:00
Zdenek Kabelac
9640320aea tests: start to use 4k mkfs
While newer system can detect need for 4K mkfs, on older test machines
running test suite over 4k is reporting problems.
Some more generic solution is needed thought.
2018-05-12 23:22:20 +02:00
Zdenek Kabelac
edede1d20f tests: do not try to create 1K extents 2018-05-12 22:52:41 +02:00
Zdenek Kabelac
093428b067 tests: restore functionality
Forgotten revert of tracing patch. Restoring previous functinality.
2018-05-12 22:51:43 +02:00
Zdenek Kabelac
38b4354494 tests: again disable this raid test
Still kills testing machines even with 4.17-rc4 kernels
on reshaping.
2018-05-12 18:05:50 +02:00
Zdenek Kabelac
ec0f5c2bf6 tests: drop delaying
Here seem delaying dev has no use.
2018-05-12 18:05:50 +02:00
Zdenek Kabelac
86c8f0f01f tests: using throttling 2018-05-12 17:48:31 +02:00
Zdenek Kabelac
f5da325d70 tests: use throttle_dm_mirror
In this case it's better to use throttling of mirror sync,
that delay everything with dm_delay.
2018-05-12 17:48:31 +02:00
Zdenek Kabelac
842b3074b7 tests: crypt test cannot run on ramdisk
This test can't use brd (ramdisk) as backend since for some
weird reason  lsblk is not listing these device.

TODO: test could be probably rewritten to avoid using lsblk somehow??
2018-05-12 17:48:31 +02:00
Zdenek Kabelac
6f48741062 tests: happy using of 4K backend devices
When the backend device supports only 4K blocks (like ramdisk)
we cannot use for testing any smaller blocksize.

So recalc test for 4K extent size.

We may possibly introduce one list extra test that
can be executed on devices with 512b sectors to
check lvm2 support those min extent sizes...
2018-05-12 17:48:31 +02:00
Zdenek Kabelac
e2be14e2d5 tests: raise min size for XFS
Seems XFS now requires at least 1605 blocks.
2018-05-12 17:48:31 +02:00
Heinz Mauelshagen
c9729022bf tests: bump raid target version in reshape tests
Adjust to target version allowing tests to succeed.
2018-05-04 16:58:11 +02:00
Heinz Mauelshagen
8bf92875f7 tests: don't rely on cache target in component-raid.sh
Lead to unnecessary skips of the test.
2018-05-04 16:54:01 +02:00
Heinz Mauelshagen
4ebfd8e8eb lvconvert: don't return success on degraded -m raid1 conversion
In case "lvconvert -mN RaidLV" was used on a degraded
raid1 LV, success was returned instead of an error.

Provide message to inform about the need to repair first
before changing number of mirrors and exit with error.

Add new lvconvert-m-raid1-degraded.sh test.

Resolves: rhbz1573960
2018-05-03 18:48:00 +02:00
David Teigland
11436b00e0 tests: add gfs-pool test
Put back a test like the old one that was removed
in d709d8445f.

It verifies that lvm will ignore and not use a
gfs-pool device.
2018-05-01 15:24:42 -05:00
David Teigland
39f05855c0 tests: remove use of lvm1 metadatatype 2018-05-01 13:29:57 -05:00
David Teigland
d709d8445f tests: remove gfs pool test 2018-05-01 13:25:40 -05:00
David Teigland
9687ee2a74 tests: update lvmetad-disabled to not use lvm1 2018-05-01 11:33:39 -05:00
David Teigland
c1cd18f21e Remove lvm1 and pool disk formats
There are likely more bits of code that can be removed,
e.g. lvm1/pool-specific bits of code that were identified
using FMT flags.

The vgconvert command can likely be reduced further.

The lvm1-specific config settings should probably have
some other fields set for proper deprecation.
2018-04-30 16:55:02 -05:00
Zdenek Kabelac
b904d6653d tests: add also snapshot monitoring 2018-04-30 10:41:51 +02:00
David Teigland
138225a3a8 test: remove pv-duplicate
This wasn't testing duplicate PVs, which are tested by
process-each-duplicate-pvs.sh.
2018-04-27 16:25:41 -05:00
Zdenek Kabelac
dcb5434a7f tests: more zero usage
Another case where usage of zero backend for mirror legs is more
effective then using delayed_dev.
2018-04-23 22:42:18 +02:00
Zdenek Kabelac
fc3ed8856f tests: update testing to not use delay dev
Instead of using delayer device user 'zero' device and let mirror
do some real work which takes some time.

In case the test machine is too fast - mirror might need to be made bigger
to meet needed criteria.

Also move all test needed this 'zero' PV trick to the end of test
so  $dev2  and $dev4 are covered with 'zero' and can take any amount of
write without consuming any real space.
2018-04-23 22:42:18 +02:00
David Teigland
aee27dc7ba scan: skip device rescan in vg_read
For reporting commands (pvs,vgs,lvs,pvdisplay,vgdisplay,lvdisplay)
we do not need to repeat the label scan of devices in vg_read if
they all had matching metadata in the initial label scan.  The
data read by label scan can just be reused for the vg_read.
This cuts the amount of device i/o in half, from two reads of
each device to one.  We have to be careful to avoid repairing
the VG if we've skipped rescanning.  (The VG repair code is very
poor, and will be redone soon.)
2018-04-20 11:23:14 -05:00
David Teigland
a01a8d7172 tests: vgck now exits with error for bad vg 2018-04-20 11:22:48 -05:00
David Teigland
ae093df3f1 test: vgsplit-usage if LVM1 tests 2018-04-20 11:22:46 -05:00
Zdenek Kabelac
ac18005de9 tests: update mirror test
Since lvconvert again is able to wait on mirror synchronization,
drop 'should'.

Also add FIXME about  'lvreduce' and too big region size.
2018-04-20 12:17:01 +02:00
Heinz Mauelshagen
bc286910ec test: add lvcreate-raid-volume_list
Test that no (Sub)LV remnants persist if the volume group is
not listed in configuration variable activation/volume_list,
hence not activatable thus causing initialization of rmeta
SubLVs to fail.

Related: rhbz1161347
2018-04-06 15:26:38 +02:00
Zdenek Kabelac
8c02cc9e8f tests: update no tool test
Correct testing with format 1 and mq policy.

Add testing of 'smq'

Fix testing with clvmd - where logged message is part of clvmd log
and we can only check command status.
2018-03-19 12:08:04 +01:00
Zdenek Kabelac
08487a3098 tests: use 4k extents
Use 4K chunks since some older kernels are not capable
to create striped volumes with smaller size.

TODO: lvm2 should detect this ahead and avoid kernel
reporting "Invalid chunk".
2018-03-18 00:30:43 +01:00
Zdenek Kabelac
e5b40e0488 tests: check activation of cache without cache_check 2018-03-17 23:33:58 +01:00
Zdenek Kabelac
9e7b00a3b9 tests: test striped COW LV 2018-03-17 23:33:58 +01:00
Marian Csontos
eae54b67d8 test: Skip tests which require too much RAM
- Tests for RAID reshape under load require too much RAM
2018-03-13 13:42:45 +01:00
Heinz Mauelshagen
dd88a0f05c raid: support raid5_n convenience type on conversion to raid10
Fix requesting a conversion on raid5_{ls,rs,la,ra} -> raid10
not offering offering interim convenience type raid5_n.

Resolves: rhbz1468600
2018-03-09 21:23:16 +01:00
Zdenek Kabelac
15b6793528 tests: skipping test waiting for fixed kernel
Once working kernel is released, reenable me...
2018-03-06 15:42:49 +01:00
Zdenek Kabelac
b05caca77e tests: component activation 2018-03-06 15:42:49 +01:00
Zdenek Kabelac
cc4855acbe tests: check inactive extorig resize 2018-02-28 21:15:55 +01:00
Marian Csontos
32bcdd90ae tests: check vgsplit thin-data and ext.origin 2018-02-27 14:37:47 +01:00
Zdenek Kabelac
f5401fbd34 tests: update 2018-02-15 13:56:35 +01:00
Marian Csontos
dd6fbcbb69 test: mirrored mirrorlog is not supposed to work in cluster 2018-02-14 13:10:52 +01:00
Zdenek Kabelac
102926ed9f tests: update set of devices
Previous change added slighly more complex mapping so missed to update
few pieces.
2018-01-23 11:45:18 +01:00
Zdenek Kabelac
e16d309d56 tests: check pvmove is merging segments
pvmove was imporoved to properly merge consqutive segments after pvmove
so check it's working.
2018-01-17 14:45:48 +01:00