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

6802 Commits

Author SHA1 Message Date
Jonathan Earl Brassow
eb2d70293d Fix up-convert when mirror activation is controled by volume_list and tags.
When mirrors are up-converted, a transient mirror layer is put in so that
only the new devices are sync'ed.  That transient layer must carry the tags
of the original mirror LV, otherwise it will fail to activate when activation
is regulated by lvm.conf:activation/volume_list.  The conversion would then
fail.

The fix is to do exactly the same thing that is being done for linear ->
mirror converting (lib/metadata/mirror.c:_init_mirror_log()).  We copy the
tags temporarily for the new LV and remove them after the activation.
2012-05-05 02:08:46 +00:00
Jonathan Earl Brassow
1e4e9548b1 Disallow snapshots of mirror segment types.
Snapshots of RAID logical volumes are allowed (including "raid1").  However,
snapshots of "mirror" logical volumes has been disallowed due to unsolvable
issues inherent to the design.  The fact that mirroring (dm-raid1.c) must
stop all I/O as the result of a failure and wait for userspace intervention
can lead to a circular dependency if userspace is simultaneously waiting for
snapshots (on mirrors) to make an I/O update before proceeding.

Various snapshot on mirror tests have been removed as a result.
2012-05-01 19:21:24 +00:00
Jonathan Earl Brassow
b22835dd68 Make a note that "raid1" is not cluster-aware in the example lvm.conf.
In the description of the segment types for the 'mirror_segtype_default'
field, we mention that "raid1" is not cluster-aware.
2012-04-27 18:37:42 +00:00
Peter Rajnoha
bf29fa49d3 Use dm_strncpy instead of plain strncpy while setting the socket path.
Also check the return value as it meaningless to work with truncated strings.
2012-04-27 09:52:33 +00:00
Jonathan Earl Brassow
e5b9338ada Fix bug in cmirror that caused incorrect status info to print on some nodes.
Looking at the code in cmirrord/local.c, we can see the various different
request types handled in different ways.  Some information that is non-changing
does not need to go around the cluster and can be short-circuited.  For
example, once the cluster mirror is in-sync, it is pointless to continue
sending that query around the cluster.  We can save network bandwidth and reply
directly back to the kernel.  When it comes to status information, there are
two types 'TABLE' and 'INFO'.  The 'TABLE' information never changes and
belongs to the group of requests that can be safely short-circuited.  The
'STATUS' information can change - and will change if a device fails.  Thus it
cannot be short-circuited, but this is exactly what was found.  The 'STATUS'
information request was being short-circuited and therefore never reporting the
failure condition to anyone other than the "server" that experienced it
directly.
2012-04-26 17:30:49 +00:00
Alasdair Kergon
34fbbfe34e Remove statement that snapshots cannot be tagged from lvm man page. 2012-04-26 15:24:46 +00:00
Jonathan Earl Brassow
ac6e1e3e8d Disallow changing cluster attribute of VG while RAID LVs are active.
Mirror and snapshot LVs are already checked for when switching the cluster
attribute of a VG.  This patch adds RAID.
2012-04-25 13:38:41 +00:00
Peter Rajnoha
c70037445a WHATS_NEW 2012-04-25 09:32:36 +00:00
Jonathan Earl Brassow
dfd024d3a8 Allow a subset of failed devices to be replaced in RAID LVs.
If two devices in an array failed, it was previously impossible to replace
just one of them.  This patch allows for the replacement of some, but perhaps
not all, failed devices.
2012-04-24 20:05:31 +00:00
Jonathan Earl Brassow
2bfb3e519a Prevent resume from creating error devices that already exist from suspend.
Thanks to agk for providing the patch that prevents resume from attempting
(and then failing) to create error devices which already exist; having been
created by a corresponding suspend operation.
2012-04-24 20:00:03 +00:00
Zdenek Kabelac
d6f894edf8 Synchronize with self-destruction of dmeventd
In some occasional case dmevent restart was experiencing problems
with obtaining pid lockfile. So this patch tries to send several more kill
message until daemon kills itself so there is would reponse.
With this small loop the restart seems to work reliable,
although the loopsize and usleep are just randomly picked for now.
2012-04-24 12:25:12 +00:00
Zdenek Kabelac
dd11efb673 Expect failure if the reduction doesn't really happen 2012-04-24 12:17:49 +00:00
Zdenek Kabelac
e7a71d030a Add some lock comments 2012-04-24 12:17:12 +00:00
Zdenek Kabelac
8262a3f6ca Update singlenode locking
Support lock conversion
Work also with LCK_READ
TODO: do more validation.
2012-04-24 12:16:40 +00:00
Zdenek Kabelac
a326be8f48 Sort lvs options by alphabet 2012-04-24 12:14:17 +00:00
Zdenek Kabelac
a8f352fd56 Update some lvs column names
Fix thin_pool -> pool_lv
Add more fields supported by thin provisioning.
Keep fields alphabetically sorted for easier lookup.
2012-04-24 12:13:29 +00:00
Peter Rajnoha
d13f356bf5 Also rename DevNos header to DevNosUsed in dmsetup info -c output. 2012-04-24 08:24:36 +00:00
Peter Rajnoha
0be6c87a56 Rename (Blk)DevNames header to (Blk)DevNamesUsed in dmsetup info -c output.
Just to make it clearer since there is the "dmsetup info -c -o blkdevname"
as well that shows the "block device name for this mapping", having a
"BlkDevName" header on output.

It's a bit confusing then if the "dmsetup info -c -o devs_used,blkdevs_used"
is named with a plural "DevNames"/"BlkDevNames" but at the same time having
a totally different meaning than the singular form "BlkDevName".

  DevNames --> DevNamesUsed
  BlkDevNames --> BlkDevNamesUsed

...makes it much more comprehensible.
2012-04-24 08:00:55 +00:00
Alasdair Kergon
067184f32d Handle replacement of an active device that goes missing with an error device.
(E.g. lvchange --refresh --partial on striped LV if a PV disappeared.)
2012-04-24 00:51:26 +00:00
Jonathan Earl Brassow
c62f9f0b2f Unlike 'mirror' segtype, 'raid1' should perform flush on suspend.
The 'mirror' segtype and 'raid1' segtype both set the 'MIRRORED' flag.
However, due to differences in the way these device-mapper targets behave
'mirror' must be suspended with the 'noflush' option and 'raid1' does not
have to be.

This patch ensures that when the 'MIRRORED' flag is checked to see if
'noflush' is needed that it does not also set it for 'raid1' by mistake.
2012-04-20 14:17:44 +00:00
Jonathan Earl Brassow
1a53400723 Fix for bug 807776: invalid lvconvert --merge output should mention raid1 now
s/snapshot/mergeable volume/
2012-04-19 21:50:37 +00:00
Alasdair Kergon
0efcdc3ad9 . 2012-04-19 13:47:38 +00:00
Alasdair Kergon
8ae2ca5ff7 . 2012-04-19 13:47:11 +00:00
Peter Rajnoha
973cfb19b7 Add udev info and context to lvmdump.
--------------------------------------------------------------------
2012-04-18 15:26:02 +00:00
Petr Rockai
23957e16d5 Add a rudimentary lvmetad manpage. 2012-04-15 15:40:48 +00:00
Alasdair Kergon
e38e9e588e Remove 'up' from rounding message that sometimes rounds down.
Detect reduction of 0 after rounding for stripes and avoid warning of potential data loss.
2012-04-12 15:11:21 +00:00
Jonathan Earl Brassow
a7feae8a6e Fix code that performs RAID device replacement while under snapshot.
The code should have been calling [suspend|resume]_lv_origin() rather than
[suspend|resume]_lv.

This addresses bug 807069.
2012-04-12 03:16:37 +00:00
Jonathan Earl Brassow
187486c7bb Fix inability to split RAID1 image while specifying a particular PV.
The logic for resuming the original and newly split LVs was not properly
done to handle situations where anything but the last device in the array
was split.  It did not take into account the possible name collisions that
might occur when the original LV undergoes the shifting and renaming of its
sub-LVs.
2012-04-11 14:20:19 +00:00
Zdenek Kabelac
83eeeb59ed Update test 2012-04-11 12:53:46 +00:00
Alasdair Kergon
1c1487659e spacing 2012-04-11 12:49:10 +00:00
Zdenek Kabelac
c63b155d16 Update man pages
Use one style for man pages.
2012-04-11 12:42:10 +00:00
Zdenek Kabelac
5dc27b75eb Fix lvresize for thin pool
When resizing thin pool - we need to use strip info from  _tdata volume.
In future more generic solution will be necessary once we start to support
lvconvert (resize of stacked devices and stay properly aligned).
For now we just allow striped or linear LV so this code will work.
2012-04-11 12:40:03 +00:00
Zdenek Kabelac
6fc1f948c2 Lvresize rounds upward
When given lvresize new size - round upward for stripes - unless we use % and
we are at the border of free extents.

This patch is not a complete fix and few more cases will need special care.
2012-04-11 12:36:37 +00:00
Zdenek Kabelac
c6f3701a71 Support rounding downward for lvcreate and %
If specifying size with % and we are reaching number
of free extents - round downward with stripes.
2012-04-11 12:33:34 +00:00
Zdenek Kabelac
9bdff1ee5c Move check for min strip size
and remove few asigns that are not needed.
2012-04-11 12:30:48 +00:00
Peter Rajnoha
30bd294fc6 Change message severity to log_very_verbose for missing dev info in udev db.
Libudev does not provide transactions when querying udev database - once we
get the list of block devices (devices/obtain_device_list_from_udev=1) and
we iterate over the list to get more detailed information about device node
and symlink names used etc., the device could be removed just in between we
get the list and put a query for more info. In this case, libudev returns
NULL value as the device does not exist anymore.

Recently, we've added a warning message to reveal such situations. However,
this could be misleading if the device is not related to the LVM action
we're just processing - the non-related block device could be removed in
parallel and this is not an error but a possible and normal operation.

(N.B. This "missing info" should not happen when devices are related to
the LVM action we're just processing since all such processing should be
synchronized with udev and the udev db must always be in consistent state
after the sync point. But we can't filter this situation out from others,
non-related devices, so we have to lower the message verbosity here for a
general solution.)
2012-04-11 09:12:02 +00:00
Jonathan Earl Brassow
c0b5886f18 RAID LVs could not handle a down-convert if a device other than the last one
in the array was specified for removal.  This change addresses that (bz806111).
2012-04-11 01:23:29 +00:00
Jonathan Earl Brassow
bad8b5848f Commit ID 46a75dedb4 consolidated code from the
various dmeventd plug-ins into a new function called 'dmeventd_lvm2_command',
but the new function did not strip off the "_mlog" extentions that the
mirror plug-in had been doing.  This created bug 794904 - failure to replace
devices in a redundant log.

The test suite did catch this scenario because it performs repair tests (mainly)
through the CLI and not dmeventd.  It's also not easy to test because the test
itself will hang if the bug is encountered.
2012-04-10 23:34:41 +00:00
Jonathan Earl Brassow
68d84fa3eb Add a couple new functions to gdbinit file and decode a couple lv->status flags
New functions:
 - seg_pvs: Print a list of PVs in a seg_pvs list
 - pv_dev_name: print name of a PV
2012-04-10 23:24:00 +00:00
Peter Rajnoha
9a2b6bda59 strcpy -> strncpy in common daemon code. 2012-04-10 12:55:37 +00:00
Peter Rajnoha
cb08b8eb7e Check if info struct returned is not NULL.
Just some missing checks revealed by Coverity in recent code.
2012-04-10 12:26:27 +00:00
Zdenek Kabelac
6e826bb6a4 Fix unlocking in error path of vgreduce
When vg_read fails, it internally unlocks VG if it's been locked,
so in error path we should skip unlock_vg for this case.
(user would see ugly internal warning)
2012-03-30 14:59:35 +00:00
Peter Rajnoha
ebd9225245 WHATS_NEW 2012-03-30 11:39:52 +00:00
Peter Rajnoha
543eaed88c Detect VG name being part of the LV name in lvconvert --splitmirrors -n.
Before:
devel/~ # lvconvert --splitmirrors 1 -n vg/splitted_one vg/mirrored_one
  Internal error: LV name vg/splitted_one has invalid form.
  Intermediate VG metadata write failed.

After:
devel/~ # lvconvert --splitmirrors 1 -n vg/splitted_one vg/mirrored_one
  Logical volume mirrored_one converted.

devel/~ # lvconvert --splitmirrors 1 -n abc/splitted_one vg/mirrored_one
  Please use a single volume group name ("vg" or "abc")
  Run `lvconvert --help' for more information.
2012-03-30 08:58:02 +00:00
Zdenek Kabelac
8a81716325 Minor fixes
Just small updates and remove <backtrace> after log_error.
2012-03-28 11:11:25 +00:00
Zdenek Kabelac
a59c3731c3 Improve test suite
Add make help target.
Add LVM_TEST_PARALLEL to support parallel runs of tests
Work around the problem the dmsetup table/info may return error
by using dmtable and dminfo function that will use 'should'.
(Error happens when some concurently running process removes table
entry while dmsetup command resolves table entries inside the loop.)
2012-03-28 11:10:08 +00:00
Peter Rajnoha
9e072e7072 Fix tests to work with vgscan --cache fixing inconsistent metadata. 2012-03-28 07:46:35 +00:00
Milan Broz
61a1effcf1 Avoid closing clvmd socket twice. 2012-03-27 16:59:28 +00:00
Milan Broz
46e9aac160 Fix exclusive lvmchange -aey to fail if volume is active on different node.
Activation on remote node should be tried only if it is masked by tags
locally (like when hosttags enabled, IOW activate_lv_excl_local()
doesn't return error.)

Introduced change caused that lvchange -aey succeeded even if volume was
activated exclusively remotely.
2012-03-27 15:53:45 +00:00
Milan Broz
945058e844 There is no hotsname_tags but only hosttags... sigh, even docs is wrong :-) 2012-03-27 13:39:08 +00:00