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

7250 Commits

Author SHA1 Message Date
Zdenek Kabelac
ca09c9ab4c thin: support non power of 2 chunk size
Support thin chunk size with multiple of 64KiB if user has
thin-pool target version at least 1.2.
2012-10-10 21:21:00 +02:00
Jonathan Brassow
b296e30f98 TEST: Add lvchange-partial.sh and vgchange-partial.sh to the test suite
Commit 3501f17fd0 enables a limited set
of metadata updates for partial LV/VGs when issuing lvchange or vgchange.
These tests verify those changes operate as intended.
2012-10-10 11:47:04 -05:00
Jonathan Brassow
3501f17fd0 [lv|vg]change: Allow limited metadata changes when PVs are missing
A while back, the behavior of LVM changed from allowing metadata changes
when PVs were missing to not allowing changes.  Until recently, this
change was tolerated by HA-LVM by forcing a 'vgreduce --removemissing'
before trying (again) to add tags to an LV and then activate it.  LVM
mirroring requires that failed devices are removed anyway, so this was
largely harmless.  However, RAID LVs do not require devices to be removed
from the array in order to be activated.  In fact, in an HA-LVM
environment this would be very undesirable.  Device failures in such an
environment can often be transient and it would be much better to restore
the device to the array than synchronize an entirely new device.

There are two methods that can be used to setup an HA-LVM environment:
"clvm" or "tagging".  For RAID LVs, "clvm" is out of the question because
RAID LVs are not supported in clustered VGs - not even in an exclusively
activated manner.  That leaves "tagging".  HA-LVM uses tagging - coupled
with 'volume_list' - to ensure that only one machine can have an LV active
at a time.  If updates are not allowed when a PV is missing, it is
impossible to add or remove tags to allow for activation.  This removes
one of the most basic functionalities of HA-LVM - site redundancy.  If
mirroring or RAID is used to replicate the storage in two data centers
and one of them goes down, a server and a storage device are lost.  When
the service fails-over to the alternate site, the VG will be "partial".
Unable to add a tag to the VG/LV, the RAID device will be unable to
activate.

The solution is to allow vgchange and lvchange to alter the LVM metadata
for a limited set of options - --[add|del]tag included.  The set of
allowable options are ones that do not cause changes to the DM kernel
target (like --resync would) or could alter the structure of the LV
(like allocation or conversion).
2012-10-10 11:33:10 -05:00
Peter Rajnoha
3af43af493 WHATS_NEW: update 2012-10-10 17:36:37 +02:00
Peter Rajnoha
a5306421dd man: dmsetup mangle also processes UUIDs now 2012-10-10 17:16:15 +02:00
Peter Rajnoha
470d1a2f54 dmsetup: also apply 'mangle' command for UUIDs
Compared to names, UUIDs can't be renamed once they are created
for a device. The 'mangle' command will just issue an error message
about a need for manual intervention in this case - reactivating the
device (remove + create) does the job as the defualt mangling mode
used is "auto" and that will assign a correct mangled form the UUID.
2012-10-10 17:16:15 +02:00
Peter Rajnoha
788b7a6a2b dmsetup: add mangled/unmangled_uuid to for info -c
Following the same logic already used for name mangling.
2012-10-10 17:16:15 +02:00
Peter Rajnoha
842167eb17 libdm: introduce and use DEV_UUID macro
To automatically prefer mangled UUID over unmangled UUID. The same
logic that is already used for dm name mangling...
2012-10-10 17:16:15 +02:00
Peter Rajnoha
8dccbae35e libdm: unmangle dm UUIDs on dm ioctl return 2012-10-10 17:16:15 +02:00
Peter Rajnoha
7e71ecbaf6 libdm: add mangling support for dm_task_set_newuuid 2012-10-10 17:16:14 +02:00
Peter Rajnoha
a621795a3c libdm: add mangling support for dm_task_set_uuid
Also, add a new field to struct dm_task called "mangled_uuid" that
will store mangled form of uuid if it differs from original uuid.
2012-10-10 17:16:13 +02:00
Peter Rajnoha
12f5c3f726 libdm: add dm_task_get_uuid_mangled/unmangled
Just like we already have existing mangling support for
device-mapper names, we need exactly the same for device-mapper
UUIDs as their character whitelist is wider than what udev supports.

In case udev is used to create entries in /dev based on UUIDs
and these UUIDs contain characters not supported by udev,
we'll end up with incorrect /dev content for such devices.
So we need to mangle them to a form that is supported by udev.

The mangling used for UUIDs follows the mangling used for names
(that is already supported and used throughout). That means,
setting the name mangling mode via dm_set_name_mangling_mode
affects mangling used for UUIDs in exactly the same manner.
It would be useless to add a new and separate
dm_set_uuid_mangling_mode fn, we'll reuse existing interface.
2012-10-10 16:59:47 +02:00
Peter Rajnoha
b0f48b9533 libdm: refactor internal mangling functions
(un)mangle_name -> (un)mangle_string
check_multiple_mangled_name_allowed -> check_multiple_mangled_string_allowed

Just for clarity as the same functions will be reused to (un)mangle dm UUIDs.
2012-10-10 16:59:11 +02:00
Petr Rockai
f65754e6fc test: Check that lvmetad is refreshed correctly on restart. 2012-10-10 13:54:36 +02:00
Petr Rockai
71d718a4a4 lvmetad: Warn if lvmetad is running but disabled. 2012-10-10 13:54:29 +02:00
Petr Rockai
622fb968a2 lvmetad: Fix the -f pidfile (non-)creation logic. 2012-10-10 13:53:21 +02:00
Petr Rockai
6e523f01d0 test: Skip thin tests if thin support is configured out. 2012-10-10 00:20:22 +02:00
Petr Rockai
d760669e80 configure: Use pkg-config to look for valgrind/memcheck.h. 2012-10-09 20:54:41 +02:00
Petr Rockai
1997149263 lvmetad: Only create pidfile when running as a daemon (no -f).
Additionally, -f now makes -s mandatory, so the foreground (debugging) lvmetad
does not steal the system-wide socket accidentally.
2012-10-09 20:37:34 +02:00
Petr Rockai
329d10268c libdaemon-server: Do not create pidfile if NULL. 2012-10-09 20:37:34 +02:00
Petr Rockai
ff752c60df TEST: Avoid building unit tests with --disable-testing. 2012-10-09 20:37:34 +02:00
Zdenek Kabelac
439989adab test: more thin tests 2012-10-09 16:38:42 +02:00
Zdenek Kabelac
d7b3179669 test: move raid10 test into separate test files
New features tested in new files.
2012-10-09 16:38:12 +02:00
Zdenek Kabelac
93d7d3ed2c test: split raid tests
Separate original raid test and new raid10 test,
so the old could be tested on platforms without raid10 support.

Replace test-unfriendly `ls /dev/mapper`   with  dmsetup ls
2012-10-09 12:22:26 +02:00
Zdenek Kabelac
cdb7502e54 lvchange: do not start dmevent for resyn
If monitoring is disabled in lvm.conf, avoid its starting and preserve
DMEVENTD_MONITOR_IGNORE settings internally.
2012-10-09 12:22:26 +02:00
Petr Rockai
d414fe28fa example.conf: Warn about running lvmetad with use_lvmetad = 0. 2012-10-09 10:49:26 +02:00
Zdenek Kabelac
f0d34f383d test: ignore modprobe failure
If the system doesn't have modprobe but happens to have modules
loaded, allow version testing.
2012-10-09 10:37:37 +02:00
Petr Rockai
9ff2f1a3db TEST: Check that LVM1 VGs work when using lvmetad (BZ 863401). 2012-10-09 07:59:53 +02:00
Petr Rockai
06243be91b lvmetad: Fix a leak on duplicated PVs (same PVID, different device). 2012-10-09 01:38:58 +02:00
Petr Rockai
665b6b308e lvmetad: Fix a leak in an error path in update_metadata. 2012-10-08 23:52:44 +02:00
Petr Rockai
556d2c920a TEST: Give lvmetad a chance to exit gracefully upon teardown. 2012-10-08 20:35:29 +02:00
Petr Rockai
39468b73a3 TEST: Wait for lvmetad socket to appear in "aux prepare_lvmetad". 2012-10-08 20:35:29 +02:00
Petr Rockai
d5f2e6223f TEST: When INTERACTIVE=1, allow scripts to control a TTY. 2012-10-08 20:35:29 +02:00
Petr Rockai
138b4e1719 lvmetad: Fix a typo-induced leak in destroy_metadata_hashes. 2012-10-08 20:35:29 +02:00
Petr Rockai
a19a595343 libdaemon-client: Fix a memory leak in daemon_send. 2012-10-08 20:35:29 +02:00
Petr Rockai
4b4c2833d9 libdaemon-server: Optimize logging for a fast no-output path. 2012-10-08 20:35:29 +02:00
Petr Rockai
cc9c02fe68 libdaemon-server: Fix a memory leak in daemon_log_multi. 2012-10-08 20:35:29 +02:00
Peter Rajnoha
7a64fff948 systemd: remove ExecStartPost from lvm2-lvmetad.service.
The ExecStartPost with pvscan --cache in lvm2-lvmetad.service
is not needed now as this is called transparently within the
first LVM command that queries lvmetad.
2012-10-08 16:49:54 +02:00
Petr Rockai
ee4c75c8b7 dev-cache: Make dev_iter_create work with a NULL filter. 2012-10-08 16:18:10 +02:00
Zdenek Kabelac
3877ccfe1b test: move raid test to separate tests
Revert changes to origin lvcreate-large test and use separate
test scripts for raid  - so they can be properly skipped when
kernel doesn't support raid targets.
2012-10-08 14:49:21 +02:00
Petr Rockai
582a344cd6 lvmetad: In pvscan --cache, update the token directly. 2012-10-08 14:38:22 +02:00
Zdenek Kabelac
40182cbd82 test: check snap_percent returns invalid
For thin_volumes snap_percent is meaningless.
2012-10-08 12:16:54 +02:00
Zdenek Kabelac
ff13206c7e report: call snapshot percent with cow only
Ensure lv_snapshot_percent is used only with snapshot LVs.
2012-10-08 12:16:53 +02:00
Zdenek Kabelac
5b07bd3f91 lvconvert: disable convertion of thin to mirrors
For now this convertions is not supported, thus disabled.
The only supported conversion for now is to create mirrored thin pools
from mirrored devices.
2012-10-08 12:16:53 +02:00
Petr Rockai
6e312c56ad lvmetad: Avoid overlapping locks that could cause a deadlock (BZ 862253). 2012-10-08 09:12:51 +02:00
Petr Rockai
0dfafd77d4 TEST: Only run the pvscan --cache test with lvmetad active. 2012-10-08 07:23:13 +02:00
Petr Rockai
e702073235 TEST: Add lvmetad-pvscan-cache to check that pvscan --cache works. 2012-10-07 22:32:32 +02:00
Zdenek Kabelac
7f4f7f70ce test: lvm2api thin data_percent 2012-10-05 10:37:41 +02:00
Zdenek Kabelac
39f3c9de0b test: check data_percent is equal to snap_percent 2012-10-05 10:37:41 +02:00
Zdenek Kabelac
1da6c1495a lvm2api: fix data percent reporting for thin, snap
Use same logic for lvm2api as we use lvs reporting.
data_percent is meant to be superset for snap_percent.
2012-10-05 10:37:09 +02:00