1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00
Commit Graph

2699 Commits

Author SHA1 Message Date
David Teigland
240062a183 writecache: remove from an active lv 2020-06-10 12:13:31 -05:00
David Teigland
7b04ed07ba tests: integrity wait for sync
The test was using a raid+integrity LV without
first waiting for the integrity sync, which could
cause the test to fail (depending on init speed)
where it depends on integrity to work in uninitialized
areas.

Also use cmp instead of diff.
2020-05-29 10:57:56 -05:00
Marian Csontos
be61bd6ff5 test: Warn and exit on problematic integrity device behavior
The first leg of integrity enabled raid device sometimes does not get
recalculated.
2020-05-28 17:04:35 +02:00
David Teigland
74a211cfd3 lvconvert: error when using existing cachevol
Check if LV is an existing cachevol before attempting
to use it again as a cachevol or cachepool.
2020-05-22 14:12:34 -05:00
Zdenek Kabelac
bb41ca86fa tests: also udev wait on clean-up path 2020-05-21 16:03:41 +02:00
Marian Csontos
53803821de test: Use printf to generate data
...to avoid unnecessary dependency on python
2020-05-21 15:33:24 +02:00
Marian Csontos
b5811b7c9c tests: Use python single liner to generate data 2020-05-21 15:11:22 +02:00
Zdenek Kabelac
d3b515cea5 tests: add wait on udev processing
Trying to avoid collision with udev watch rule preventing to
succeed 'dmsetup remove' becuase it keeps device open.
2020-05-20 16:01:20 +02:00
David Teigland
d79afd4084 lvmcache: rework handling of VGs with duplicate vgnames
The previous method of managing duplicate vgnames prevented
vgreduce from working if a foreign vg with the same name
existed.
2020-04-21 14:40:34 -05:00
David Teigland
d9e8895a96 Allow dm-integrity to be used for raid images
dm-integrity stores checksums of the data written to an
LV, and returns an error if data read from the LV does
not match the previously saved checksum.  When used on
raid images, dm-raid will correct the error by reading
the block from another image, and the device user sees
no error.  The integrity metadata (checksums) are stored
on an internal LV allocated by lvm for each linear image.
The internal LV is allocated on the same PV as the image.

Create a raid LV with an integrity layer over each
raid image (for raid levels 1,4,5,6,10):

lvcreate --type raidN --raidintegrity y [options]

Add an integrity layer to images of an existing raid LV:

lvconvert --raidintegrity y LV

Remove the integrity layer from images of a raid LV:

lvconvert --raidintegrity n LV

Settings

Use --raidintegritymode journal|bitmap (journal is default)
to configure the method used by dm-integrity to ensure
crash consistency.

Initialization

When integrity is added to an LV, the kernel needs to
initialize the integrity metadata/checksums for all blocks
in the LV.  The data corruption checking performed by
dm-integrity will only operate on areas of the LV that
are already initialized.  The progress of integrity
initialization is reported by the "syncpercent" LV
reporting field (and under the Cpy%Sync lvs column.)

Example: create a raid1 LV with integrity:

$ lvcreate --type raid1 -m1 --raidintegrity y -n rr -L1G foo
  Creating integrity metadata LV rr_rimage_0_imeta with size 12.00 MiB.
  Logical volume "rr_rimage_0_imeta" created.
  Creating integrity metadata LV rr_rimage_1_imeta with size 12.00 MiB.
  Logical volume "rr_rimage_1_imeta" created.
  Logical volume "rr" created.
$ lvs -a foo
  LV                  VG  Attr       LSize  Origin              Cpy%Sync
  rr                  foo rwi-a-r---  1.00g                     4.93
  [rr_rimage_0]       foo gwi-aor---  1.00g [rr_rimage_0_iorig] 41.02
  [rr_rimage_0_imeta] foo ewi-ao---- 12.00m
  [rr_rimage_0_iorig] foo -wi-ao----  1.00g
  [rr_rimage_1]       foo gwi-aor---  1.00g [rr_rimage_1_iorig] 39.45
  [rr_rimage_1_imeta] foo ewi-ao---- 12.00m
  [rr_rimage_1_iorig] foo -wi-ao----  1.00g
  [rr_rmeta_0]        foo ewi-aor---  4.00m
  [rr_rmeta_1]        foo ewi-aor---  4.00m
2020-04-15 12:10:32 -05:00
Zdenek Kabelac
3dd11d9ea8 test: repair of thin-pool used by foreign apps 2020-04-08 15:37:24 +02:00
Marian Csontos
e6b93dc24e test: Fix previous commit 2020-03-18 18:03:12 +01:00
Marian Csontos
fc32787c1b test: Can not attach writecache to active volume 2020-03-18 14:35:58 +01:00
David Teigland
4b5bfa779a tests: reduce sizes in pvck-dump and improve checks
Smaller devs can be used so tests can be run on small vms.
Improve checks.
2020-03-04 11:30:50 -06:00
David Teigland
f6667f94cb tests: pvck dump from larger metadata areas 2020-03-03 13:47:07 -06:00
Zdenek Kabelac
9532bb577a tests: validate vdo slab_size
New vdoformat can print this size - so check we pass proper bit count
matching preset value.
2020-02-26 13:29:21 +01:00
David Teigland
4829f27b76 writecache: drop real dm suffix
fixes the problem of adding writecache to an active LV
2020-02-17 13:07:06 -06:00
David Teigland
2a6078f961 writecache: fix splitcache when origin is raid 2020-02-04 16:12:09 -06:00
Zdenek Kabelac
62ad12d0d0 tests: compatible with older kernels
Older kernels just show syscall stacktrace.
2020-02-04 17:22:06 +01:00
David Teigland
c0de37ab18 tests: move vgsplit writecache
to a different file
2020-02-04 10:20:19 -06:00
David Teigland
379a7e1288 vgsplit: handle cachevol
attached to a cache or writecache LV.
Ensure PVs in cachevol are moved with the main LV.
2020-02-03 15:33:58 -06:00
Zdenek Kabelac
bab3b70e3a tests: add corruption write on PV test
Test a case where PV is readable, but fails on write updating.
Check the failure is reported only for a single PV.
2020-01-23 10:32:15 +01:00
Zdenek Kabelac
ecb77e9db3 tests: writeerror_dev
Intruduce aux function for easy simulation of disk areas,
that are 'normally' readable, but will fail on write.
2020-01-23 10:32:15 +01:00
Heming Zhao
2f6d0a6408 fix corosync.conf: no interface error
systemctl status corosync (version: 2.4.5) report error:
  parse error in config: No interfaces defined

Signed-off-by: Zhao Heming <heming.zhao@suse.com>
2020-01-15 09:46:54 -06:00
Zdenek Kabelac
30f4d0fcd4 tests: update for readahead 2020-01-13 17:42:31 +01:00
Vojtech Trefny
c496ba6505 lvmdbusd: Add function to convert LV into a VDO pool 2020-01-09 13:07:55 -06:00
Vojtech Trefny
c3ef41f620 lvmdbusd: Add VDO enable/disable compress & dedup
Added methods to vdo pool interface to allow enabling and
disabling of VDO:
 * Compression
 * Deduplication
2020-01-09 13:07:47 -06:00
Marian Csontos
87e88078c9 tests: Some lvmdbus tests require larger PVs 2019-12-18 15:33:58 +01:00
Marian Csontos
a2a993d995 tests: VDO detection in dbus tests 2019-12-16 12:06:42 +01:00
Zdenek Kabelac
4a52855899 tests: improve secure test
Validate we capture core while original task sleeps.
2019-12-10 15:44:16 +01:00
Zdenek Kabelac
611d4107a4 test: fix missing waiting on udev
After device creation we need to wait for a cookie so it's not forgotten
in the system.
2019-12-10 15:44:16 +01:00
Zdenek Kabelac
3b6defcf1f test: fail on device create
Correct validation of prepared device and fail if the device can't
be created.
2019-12-10 15:44:16 +01:00
Zdenek Kabelac
8ab1d489f3 test: aux setup
Avoid endless loop if there was no 'remove' progress.
2019-12-10 15:44:16 +01:00
David Teigland
3145a85583 pvck: repair headers and metadata
To write a new/repaired pv_header and label_header:

  pvck --repairtype pv_header --file <file> <device>

This uses the metadata input file to find the PV UUID,
device size, and data offset.

To write new/repaired metadata text and mda_header:

  pvck --repairtype metadata --file <file> <device>

This requires a good pv_header which points to one or two
metadata areas.  Any metadata areas referenced by the
pv_header are updated with the specified metadata and
a new mda_header. "--settings mda_num=1|2" can be used
to select one mda to repair.

To combine all header and metadata repairs:

  pvck --repair --file <file> <device>

It's best to use a raw metadata file as input, that was
extracted from another PV in the same VG (or from another
metadata area on the same PV.)  pvck will also accept a
metadata backup file, but that will produce metadata that
is not identical to other metadata copies on other PVs
and other areas.  So, when using a backup file, consider
using it to update metadata on all PVs/areas.

To get a raw metadata file to use for the repair, see
pvck --dump metadata|metadata_search.

List all instances of metadata from the metadata area:
  pvck --dump metadata_search <device>

Save one instance of metadata at the given offset to
the specified file (this file can be used for repair):

  pvck --dump metadata_search --file <file>
    --settings "metadata_offset=<off>" <device>
2019-11-27 11:13:47 -06:00
David Teigland
b400353c71 tests hints: update check for io count
Running a reporting command on a VG now includes one
additional read to check the mda_header for any change
to the vg between scan and lock.
2019-11-26 16:52:28 -06:00
David Teigland
bbd8badaef tests: update to md dev name
Restore WAIT_MD_DEV in teardown.

NOTE: The name of MD device may have changed.

(cherry picked from commit c2ff8876f9)
2019-11-26 10:34:51 +01:00
Marian Csontos
b690258518 tests: Find md name using lsblk
After stopping MD device and rescanning the leg, it is created with
different name.
2019-11-26 09:13:17 +01:00
Marian Csontos
4757ce4c2a Partial revert "tests: update to md dev name"
This partially reverts commit c2ff8876f9.

Not all MD devices are stopped. Something is missing there...
2019-11-25 09:23:02 +01:00
Marian Csontos
1e669ab315 test: Fix handling leftovers from previous tests
teardown fails current PREFIX is prefix of previously failed test with
leftovers in dmtable.
2019-11-20 15:27:03 +01:00
Zdenek Kabelac
f88f7c0fdc tests: add more tracing info 2019-11-15 12:37:44 +01:00
Zdenek Kabelac
496c368528 tests: reduce amount of written date
Since we reduced created LV to 4M - dd also just 4M.
2019-11-15 12:37:44 +01:00
Zdenek Kabelac
91df257b53 tests: enusure lib is initilized 2019-11-14 18:06:42 +01:00
Zdenek Kabelac
38617213f0 tests: add test of resize of different segtypes 2019-11-11 22:44:25 +01:00
Zdenek Kabelac
3b05fd4d07 tests: add extra settle
To avoid removing, while 'add' might not have been processed yet.
(when emulating reboot in pvmove-restart)
2019-11-11 22:44:25 +01:00
Zdenek Kabelac
ba313ac84a tests: skip unneeded status check
If 'remove' was succesful - we can break loop immediatelly.
2019-11-11 22:44:25 +01:00
Marian Csontos
8263e62b00 test: Fix metadata-zero-space with long VG names 2019-11-06 16:20:27 +01:00
Zdenek Kabelac
c67a03727b tests: be happy with less then 90 percent
Thin metadata evolve between kernel version, so it's not always
precisely predictible its usage - so let's met test happy,
when it gets bellow 90%.
2019-11-01 16:31:12 +01:00
Zdenek Kabelac
dbaa4cdcdf tests: skip test if scsi_debug is not available 2019-11-01 16:31:12 +01:00
Zdenek Kabelac
5f064e2221 tests: slowdown delay of raid
Slowdown 'delay' more.
2019-11-01 16:31:12 +01:00
Zdenek Kabelac
c935f8a327 tests: conversion only of exclusive lv
We can 'cache' only exclusively active LV in cluster.
2019-11-01 16:27:21 +01:00