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

6815 Commits

Author SHA1 Message Date
Jonathan Earl Brassow
6a69a4472d 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
35e728ec8d 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
48511e9bd6 strcpy -> strncpy in common daemon code. 2012-04-10 12:55:37 +00:00
Peter Rajnoha
fb4f76a29c 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
2d6f57be7e 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
c44897abfc WHATS_NEW 2012-03-30 11:39:52 +00:00
Peter Rajnoha
667d681ce0 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
e1b9db7140 Minor fixes
Just small updates and remove <backtrace> after log_error.
2012-03-28 11:11:25 +00:00
Zdenek Kabelac
a5cffcdcf9 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
b798ea409d Fix tests to work with vgscan --cache fixing inconsistent metadata. 2012-03-28 07:46:35 +00:00
Milan Broz
7387343eab Avoid closing clvmd socket twice. 2012-03-27 16:59:28 +00:00
Milan Broz
53064420ff 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
c8d671b6ad There is no hotsname_tags but only hosttags... sigh, even docs is wrong :-) 2012-03-27 13:39:08 +00:00
Milan Broz
59a26019e0 Fail early if cmirror is not detected and pvmove requires it. 2012-03-27 12:01:22 +00:00
Milan Broz
195aa7699e Also skip pvmove for remotely active LVs. 2012-03-27 11:43:32 +00:00
Peter Rajnoha
c950126620 Add 'vgscan --cache' functionality for consistency with 'pvscan --cache'.
Calling vgscan alone should reuse information from the lvmetad (if running).
The --cache option should initiate direct device scan and update lvmetad
appropriately (if running).

This is mainly for vgscan to behave consistently compared to pvscan.
2012-03-27 11:04:46 +00:00
Alasdair Kergon
600a3810ea add make install_verity 2012-03-26 23:23:31 +00:00
Alasdair Kergon
749f4ae7cb Rename verity dir 2012-03-26 23:09:37 +00:00
Milan Broz
e674eb6a79 Keep exclusive activation in pvmove if LV is already active.
Pvmove should never try to downgrade exclusive lock
for LVs.

This allows pvmove to work again for exclusive activated LVs.
2012-03-26 20:33:40 +00:00
Milan Broz
ad7d4b6c56 Do not allow pvmove if some affected LVs are activated
locally or on more nodes while others are activated exclusively.

Current pvmove code can either use local mirror (for exclusive
activation) or cmirror (for clustered LVs).

Because the whole intenal pvmove LV is just segmented LV containing
segments of several top-level LVs, code cannot properly handle
situation if some segment need to be activated exclusively.

Previously, it wrongly activated exclusive LV on all nodes
(locing code allowed it) but now this is no lnger possible.

If there is exclusively activated LV, pvmove is only
possible if all affected LVs are aslo activated exclusively.

(Note that in non-exclusive mode pvmove still activates LVs
on other nodes during move.)

# lvchange -aly vg_test/lv1
# lvchange -aey vg_test/lv2
# pvmove -i 1 /dev/sdc
   Error locking on node bar-01: Device or resource busy
   Error locking on node bar-03: Volume is busy on another node
...
   Failed to activate lv2
2012-03-26 20:32:58 +00:00
Milan Broz
ef49063b27 Use new flag PVMOVE_EXCLUSIVE in update_metatada call.
There is no real functional change in this patch except it
avoids checking cluster cmirror module twice.

(Flag used in following patch.)
2012-03-26 20:31:01 +00:00
Milan Broz
0a3a88eb84 Remove unused and wrongly set cluster VG flag from clvmd lock query command. 2012-03-26 20:29:45 +00:00
Alasdair Kergon
23d0fddca5 fixes/improvements 2012-03-24 02:58:56 +00:00
Alasdair Kergon
7e27f33433 First veritysetup version using configure --with-veritysetup. 2012-03-24 01:59:59 +00:00
Milan Broz
9359753aab Fix pvmove if LV is activated exclusively but cmirror is not running.
In this case we should allow to use local mirror, check for cmirror
should apply only for lvconvert/lvcreate.

Introduced in 2.02.86 by removing !(lv->status & ACTIVATE_EXCL).

(Partially workaround, it is minimalistic patch for now.)
2012-03-23 16:28:40 +00:00
Zdenek Kabelac
4dd8a94a20 Add fixmes
There is missing some proper reaction when update fails ?
2012-03-23 10:34:51 +00:00
Zdenek Kabelac
963ccfd981 Always free hash table
also in error path
2012-03-23 10:33:26 +00:00
Zdenek Kabelac
8df1e265f8 Update and fix monitoring of thin pool devices
Code adds better support for monitoring of thin pool devices.
update_pool_lv uses DMEVENTD_MONITOR_IGNORE to not manipulate with monitoring.
vgchange & lvchange are checking real thin pool device for existance
as we are using   _tpool  real device and visible LV pool device might not
be even active (_tpool is activated implicitely for any thin volume).
monitor_dev_for_events is another _lv_postorder like code it might be worth
to think about reusing it here - for now update the code to properly
monitory thin volume deps.
For unmonitoring add extra code to check the usage of thin pool - in case it's in use
unmonitoring of thin volume is skipped.
2012-03-23 09:58:04 +00:00
Zdenek Kabelac
8b2fdb26e5 Return mem fail if hash insert fails 2012-03-23 09:48:17 +00:00
Zdenek Kabelac
4687bd1015 Make sure namelen fits into buffer allocated on stack 2012-03-23 09:43:44 +00:00
Zdenek Kabelac
0237724e17 Fix typo in config option check 2012-03-23 09:42:36 +00:00
Zdenek Kabelac
bc013bc21f Improve teardown_devs
Try to avoid start of dmeventd during vgremove if the code has any bug
inside.
2012-03-23 09:41:20 +00:00
Zdenek Kabelac
3ac8509b99 Update debug message
(compiled only with special debug define)
2012-03-23 09:39:59 +00:00
Zdenek Kabelac
f02892842b Update lcov target 2012-03-23 09:39:03 +00:00
Zdenek Kabelac
31a1a47ad5 Fix regression in thin monitoring
Patch https://www.redhat.com/archives/lvm-devel/2012-February/msg00118.html
removed initilization of thin volume monitoring, leaving it only for
thin pool - but missed the code move part for monitoring of thin pools.
Effectively making thin pools not monitorable.
2012-03-20 17:42:19 +00:00
Zdenek Kabelac
6e7d2724ba Fix check for passed in path for dmeventd startup
Check passed in executable path for dmeventd instead of predefined
compiled in path which is not the thing to be executed.
2012-03-20 17:38:47 +00:00
Zdenek Kabelac
adbf9a803a Sleep longer in the test so it really dies properly
and check for right exit code from pgrep
2012-03-20 13:35:46 +00:00
Zdenek Kabelac
7e7c9bb2f3 Update testing scripts
Make the teardown really usable - it will try down to remove all the left
devices even from previous test runs
(the only missing piece is probably proper mdadm teardown)
Add few more local vars
Try to setup PATH and LD_LIBRARY_PATH just once.
Try shorter sleeps.
2012-03-20 10:51:57 +00:00
Zdenek Kabelac
70d7a8ea41 Update test for dmevent restart
Actually restart was failing for different reason - so pass in proper
location of dmeventd for restart from lvm command and avoid using
the one from /sbin location.

Update pv create test with "" around path.
2012-03-20 10:48:59 +00:00
Zdenek Kabelac
c987c20bb3 Support improperly formated device numbers
There are kernel drivers (smblk) which set '-1' as their device major number.
This number is listed in /proc/devices then - but the kernel itself is using
just 12 bits - thus device is accessible via 4095 - there is posted patch
for 3.4 to fix this behavior (0 for auto allocation was mean to be used).

However to still allow using such devices with older kernels add some code
to use same behavior - so cut 12 bits from the major number from /proc/devices.

For now use log_warn() - maybe the severity of the message could be lowered
to just verbose level.
2012-03-20 10:47:02 +00:00
Peter Rajnoha
45d7997514 Do exit if LISTEN_PID environment variable not correct during systemd handover. 2012-03-16 21:30:53 +00:00
Zdenek Kabelac
d13c952ee4 Add comment about slow startup of dmeventd
Separat lvm dumpconfig on extra line, so the shell trace output
is not mixed with dump.
2012-03-16 19:13:09 +00:00
Zdenek Kabelac
4fd6aae7bf Skip dmeventd restart test
If dmevendt is not in /sbin, do not try to run restarting test.
FIXME: add some workaround for testing.
2012-03-16 19:11:29 +00:00
Zdenek Kabelac
2b6dee707a Regression fix kernel version check
got changed improperly with large update patch.
2012-03-16 19:09:49 +00:00
Zdenek Kabelac
124dec2880 Longer sleep after clvmd start 2012-03-16 19:08:09 +00:00
Peter Rajnoha
f4dd47242e Use pvscan --cache instead of vgscan in lvmetad init script and systemd unit. 2012-03-16 15:12:04 +00:00
Zdenek Kabelac
268ec5553e Switch condition for dmeventd check 2012-03-16 13:44:51 +00:00
Zdenek Kabelac
1238935a2d Update tests
Indent

Shell improvements - use internal function for checks

Use PVs in ""   (LV and VG cannot have spaces)

Several test very starting 'dmeventd' without annoucing
it via prepade_dmeventd.

Fix some of test actually.
2012-03-16 13:00:05 +00:00
Zdenek Kabelac
6ef0f403c7 Update test.sh check.sh utils.sh get.sh
Indent
Better shell usage
Function simplification
More usage of 'get' functions
Don't use valgrind tracing for check and get function (faster)
Update shell debugging (PS4, better stacktrace)
Support paths with spaces
Export SCRIPTNAME for external usage
Watch for dmeventd unexpectedly started during test
2012-03-16 12:59:43 +00:00
Zdenek Kabelac
523910032b Update aux.sh lvmwrapper
Indent

Add valgrind support:
 env LVM_TEST_VALGRIND={0123} (the higher level, more commands tested)
 env LVM_TEST_CLVMD=1   runs clvmd within valgrind.
 env VALGRIND  script name executed for each lvm command (def. is valg).

Smarted teardown - should minimize occurence of left dev entries
 (using dmsetup remove -f only as last resort)
 sort removed devices by open count before actual removal

Use "" around string that may contain spaces.

Set log/verbose and activation/retry_deactivation to defined value.

Remove  debug.log after successful lvm command (easier to check output).
2012-03-16 12:59:02 +00:00