]> sourceware.org Git - lvm2.git/log
lvm2.git
9 years agotoollib: close connection to lvmetad after fork
Ondrej Kozina [Mon, 13 Apr 2015 14:29:15 +0000 (16:29 +0200)]
toollib: close connection to lvmetad after fork

sharing connection between parent command and background
processes spawned from parent could lead to occasional failures
due to unexpected corruption in daemon responses sent to either child
or a parent.

lvmetad issued warning about duplicate config values in request.
LVM commands occasionaly failed w/ internal error after receving
corrupted response.

lvmetad connection is renewed when needed after explicit disconnect
in child

9 years agotoollib: do not spawn polling in lv_change_activate
Ondrej Kozina [Wed, 8 Apr 2015 10:05:14 +0000 (12:05 +0200)]
toollib: do not spawn polling in lv_change_activate

spawning a background polling from within the lv_change_activate
fn went to two problems:

1) vgchange should not spawn any background polling until after
   the whole activation process for a VG is finished. Otherwise
   it could lead to a duplicite request for spawning background
   polling. This statement was alredy true with one exception of
   mirror up-conversion polling (fixed by this commit).

2) due to current conditions in lv_change_activate lvchange cmd
   couldn't start background polling for pvmove LVs if such LV was
   about to get activated by the command in the same time.

This commit however doesn't alter the lvchange cmd so that it works same as
vgchange with regard to not to spawn duplicate background pollings per
unique LV.

9 years agovgchange: remove redundant check
Ondrej Kozina [Wed, 8 Apr 2015 08:30:30 +0000 (10:30 +0200)]
vgchange: remove redundant check

pvmove LVs are invisible thus already skipped due to check
lv_is_visible() at the beginning of the cycle.

9 years agoconfig: fix description syntax errors
David Teigland [Mon, 13 Apr 2015 18:48:01 +0000 (13:48 -0500)]
config: fix description syntax errors

from previous commit

9 years agoconfig: update descriptions
David Teigland [Mon, 13 Apr 2015 18:39:30 +0000 (13:39 -0500)]
config: update descriptions

- filter, preferred_names

9 years agotests: update runner
Zdenek Kabelac [Mon, 13 Apr 2015 14:31:02 +0000 (16:31 +0200)]
tests: update runner

Reenable TESTDIR  & PREFIX replacement.
Since we need to replace string in proper order (1st. @TESTDIR@,
2nd. @PREFIX@), drop map and use plain string.

Drop timestamp logging when 'stacktracing'

9 years agotests: log parallel debug.log usage as problem
Zdenek Kabelac [Mon, 13 Apr 2015 14:30:36 +0000 (16:30 +0200)]
tests: log parallel debug.log usage as problem

9 years agotests: sections in test separated
Zdenek Kabelac [Mon, 13 Apr 2015 14:30:17 +0000 (16:30 +0200)]
tests: sections in test separated

Use  <========  to separate sections.
Use ##  to prefix these outputs.
Drop $top_srcdir from sed  (it's been replacing '..')
Hide more /dev  dirs.

9 years agotests: hide unwanted output
Zdenek Kabelac [Mon, 13 Apr 2015 12:19:54 +0000 (14:19 +0200)]
tests: hide unwanted output

9 years agotests: slowdown mirroring more
Zdenek Kabelac [Mon, 13 Apr 2015 09:01:10 +0000 (11:01 +0200)]
tests: slowdown mirroring more

Since some of test machines are very slow, slowdown mirroring
even more.

9 years agocleanup: put easier tests first
Zdenek Kabelac [Mon, 13 Apr 2015 09:39:23 +0000 (11:39 +0200)]
cleanup: put easier tests first

If we could 'break' before calling strcmp() do it.
Use fputc for single char output (\n).

9 years agocleanup: typo in comment
Zdenek Kabelac [Mon, 13 Apr 2015 09:00:07 +0000 (11:00 +0200)]
cleanup: typo in comment

9 years agoWHATS_NEW: previous commit f814d7wq
Peter Rajnoha [Mon, 13 Apr 2015 13:49:25 +0000 (15:49 +0200)]
WHATS_NEW: previous commit f814d7wq

9 years agolvmconf: add --enable-halvm, --disable-halvm, --services, --mirrorservice, --startsto...
Peter Rajnoha [Mon, 13 Apr 2015 13:27:17 +0000 (15:27 +0200)]
lvmconf: add --enable-halvm, --disable-halvm, --services, --mirrorservice, --startstopservices options and use proper global/use_lvmetad default value

This patch adds new options to lvmconf:

  --enable-halvm (just like --enable-cluster, but configure LVM
                  for use in HA LVM - meaning disabling lvmetad and
                  making sure we have locking_type=1)

  --disable-halvm (just like --disable-cluster, but configure LVM
                   back from HA LVM - meaning enabling lvmetad if
                   it's enabled by default and making sure we have
                   default locking type set)

  --services (causes clvmd and lvmetad services to be enabled or
              disabled appropriately and conforming to the changes
              in lvm configuration we've just made with lvmconf)

  --mirrorservice (in addition to clvmd and lvmetad services, also
                   enable or disable cmirrord service appropriately;
                   this is a separate option because cmirrord is
                   optional and it doesn't need to be always enabled
                   when clvmd is enabled)

  --startstopservices (in addition to enabling or disabling services,
                       start and stop these services immediately)

These options are supposed to help users to make their system ready
for cluster with clvmd (active-active) or HA LVM (active-passive) use
while lvmconf script can handle services as well so users don't need
to bother about setting them manually.

Also, before this patch, we hardcoded global/use_lvmetad=0 as default
value in lvmconf script. Howeverm this default may change by just
flipping the value in config_settings.h and we may forget to edit
the lvmconf. It's better to use lvm dumpconfig --type default global/use_lvmetad
to get the actual default value and use this one instead of hardcoded one.

9 years agoalloc: Respect cling_tag_list in contig alloc.
Alasdair G Kergon [Sat, 11 Apr 2015 00:55:24 +0000 (01:55 +0100)]
alloc: Respect cling_tag_list in contig alloc.

When performing initial allocation (so there is nothing yet to
cling to), use the list of tags in allocation/cling_tag_list to
partition the PVs.  We implement this by maintaining a list of
tags that have been "used up" as we proceed and ignoring further
devices that have a tag on the list.

https://bugzilla.redhat.com/983600

9 years agoconfig: editing descriptions
David Teigland [Fri, 10 Apr 2015 21:41:54 +0000 (16:41 -0500)]
config: editing descriptions

Update wording and formatting.

9 years agoalloc: Add A_PARTITION_BY_TAGS to avoid sharing.
Alasdair G Kergon [Fri, 10 Apr 2015 20:57:52 +0000 (21:57 +0100)]
alloc: Add A_PARTITION_BY_TAGS to avoid sharing.

Add A_PARTITION_BY_TAGS set when allocated areas should not share tags
with each other and allow _match_pv_tags to accept an alternative list
of tags.  (Not used yet.)

9 years agopython: Fix ws liblvm.c
Tony Asleson [Fri, 10 Apr 2015 16:01:46 +0000 (11:01 -0500)]
python: Fix ws liblvm.c

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agopython: Unit test ws fixes
Tony Asleson [Tue, 7 Apr 2015 20:36:11 +0000 (15:36 -0500)]
python: Unit test ws fixes

    pep8 corrections for:
    - mixed leading ws (tabs & spaces)
    - spacing around arithmetic operators

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agopython: Make lv addTag/removeTag persistent
Tony Asleson [Tue, 7 Apr 2015 20:25:20 +0000 (15:25 -0500)]
python: Make lv addTag/removeTag persistent

Added lvm_vg_write in the addTag/removeTag paths to make the
changes persist.  Added unit test to ensure functionality.

https://bugzilla.redhat.com/show_bug.cgi?id=1210020

Signed-off-by: Tony Asleson <tasleson@redhat.com>
9 years agoreport: lv_metadata_size, data_lv and metadata_lv also reports properties for cache...
Peter Rajnoha [Fri, 10 Apr 2015 12:55:28 +0000 (14:55 +0200)]
report: lv_metadata_size, data_lv and metadata_lv also reports properties for cache pools

9 years agoconfig: add note about 'vsn' macro use in config_settings.h
Peter Rajnoha [Fri, 10 Apr 2015 07:50:10 +0000 (09:50 +0200)]
config: add note about 'vsn' macro use in config_settings.h

9 years agoconfig: comments update
David Teigland [Thu, 9 Apr 2015 21:35:20 +0000 (16:35 -0500)]
config: comments update

missing \n

9 years agoconfig: update description
David Teigland [Thu, 9 Apr 2015 21:09:53 +0000 (16:09 -0500)]
config: update description

Remove examples that simply replicate the default shown.

9 years agoconfig: include full comments
David Teigland [Thu, 9 Apr 2015 20:26:21 +0000 (15:26 -0500)]
config: include full comments

Comments from the sample config files are copied into
the comment field of the config settings structure.
This includes only minimal changes to the text.

With this in place, the sample config files can
be generated from 'lvm dumpconfig', and content
for an lvm.conf man page can also be generated.

9 years agocache: Set correct vgid when changing PV header.
Alasdair G Kergon [Thu, 9 Apr 2015 20:13:55 +0000 (21:13 +0100)]
cache: Set correct vgid when changing PV header.

pv_write is called both to write orphans and to rewrite PV headers
of PVs in VGs.  It needs to select the correct VG id so that the
internal cache state gets updated correctly.

It only affected commands that involved further steps after
the pv_write and was often masked because the metadata would
be re-read off disk and correct itself.

"Incorrect metadata area header checksum" warnings appeared.

Example:
  Create vg1 containing dev1, dev2 and dev3.
  Hide dev1 and dev2 from the system.
  Fix up vg1 with vgreduce --removemissing.
  Bring back dev1 and dev2.
  In a single operation reinstate dev1 and dev2 into vg1 (vgextend).
Done as separate operations (automatically fix-up dev1 and dev2 as orphans,
then vgextend) it worked, but done all in one go the internal cache got
corrupted and warnings about checksum errors appeared.

9 years agotests: extend delay
Zdenek Kabelac [Thu, 9 Apr 2015 11:16:53 +0000 (13:16 +0200)]
tests: extend delay

400 was appeared to be good value in pvmove-abort.sh
so use also in abort-all.

9 years agotests: handle debug.log from clvmd
Zdenek Kabelac [Thu, 9 Apr 2015 11:13:36 +0000 (13:13 +0200)]
tests: handle debug.log from clvmd

When clvmd starts, it starts it's own command logging into debug.log.
This is interferring with our other command debug.log.
As as sideeffect we may experience log from command,
followed but lots of zeros and continued with clvmd log.

Fix it by renaming debug.log and now we could also print this trace
to get full list of clvmd activity nicely.

Also improve some post-mortem prints from udevadm and dmsetup to
make the output more usable.

9 years agotests: slowdown write on dev3 even more
Zdenek Kabelac [Wed, 8 Apr 2015 21:16:08 +0000 (23:16 +0200)]
tests: slowdown write on dev3 even more

9 years agotests: use single lvmconf call
Zdenek Kabelac [Wed, 8 Apr 2015 20:44:16 +0000 (22:44 +0200)]
tests: use single lvmconf call

9 years agotests: put "" around dev path
Zdenek Kabelac [Wed, 8 Apr 2015 20:43:52 +0000 (22:43 +0200)]
tests: put "" around dev path

9 years agoclvmd: singlenode signals only when lock changes
Zdenek Kabelac [Wed, 8 Apr 2015 21:12:29 +0000 (23:12 +0200)]
clvmd: singlenode signals only when lock changes

There is no benefit in waking-up all the waiters
when there is no actual change in lock state.
This avoid some unnecessarily ping-pong effects like:

 Resource V_LVMTEST15724vg retrying lock in mode:WRITE...
 Resource V_LVMTEST15724vg already locked lockid=40, mode:WRITE
 Resource V_LVMTEST15724vg retrying lock in mode:WRITE...
 Resource V_LVMTEST15724vg already locked lockid=40, mode:WRITE

9 years agoselect: mention { } use in lvm.8 man page and '-S help' properly
Peter Rajnoha [Wed, 8 Apr 2015 09:14:16 +0000 (11:14 +0200)]
select: mention { } use in lvm.8 man page and '-S help' properly

9 years agotests: check scsi_debug support opt_blks
Zdenek Kabelac [Tue, 7 Apr 2015 12:56:16 +0000 (14:56 +0200)]
tests: check scsi_debug support opt_blks

Some older kernels (i.e. lenny) do not have such options.

9 years agolvcreate: do not silently accept '-m #' with raid4/5/6
Heinz Mauelshagen [Tue, 7 Apr 2015 12:32:25 +0000 (14:32 +0200)]
lvcreate: do not silently accept '-m #' with raid4/5/6

If the user provides '-m #' (# > 0) with mappings
raid4/5/6, the command silently creates
'#mirrors * #stripes + #parity' image component pairs.

Patch rejects '-m #' altogether for those mappings
in order to avoid LV creation with unexpected layout.

- resolves bz#1209445

9 years agotests: when test fails collect more info
Zdenek Kabelac [Tue, 7 Apr 2015 11:40:15 +0000 (13:40 +0200)]
tests: when test fails collect more info

In some case it might be worth to know some more surrouding info
when command has crashed.

So collect  tables and some udev db content in this case.

9 years agotests: skip clvmd testing of mirrored LV vgsplit
Zdenek Kabelac [Fri, 3 Apr 2015 18:14:26 +0000 (20:14 +0200)]
tests: skip clvmd testing of mirrored LV vgsplit

There is something wrong when even inactive LV can't be splitted
without cmirrord being present for clustered VG.

9 years agotests: change default to 30s.
Zdenek Kabelac [Fri, 3 Apr 2015 17:35:18 +0000 (19:35 +0200)]
tests: change default to 30s.

Keep rather the default lower and avoid to pass it with every call.

9 years agotests: slow down devices in outer loop
Zdenek Kabelac [Fri, 3 Apr 2015 17:38:28 +0000 (19:38 +0200)]
tests: slow down devices in outer loop

Since now we have metadata parts running with normal speed,
we could avoid reinitilising delayed dev for every test.
(Saving seconds on cookie waits...)

9 years agopvmove: don't crash when name is not found
Zdenek Kabelac [Fri, 3 Apr 2015 15:14:50 +0000 (17:14 +0200)]
pvmove: don't crash when name is not found

If the device name is not found in our metadata,
we cannot call strdup few lines later with NULL name.

More intersting story goes behind how it happens -
pvmove removal is unfortunatelly 'multi-state' process
and at some point (for now)  we have in lvm2 metadata
LV  pvmove0 as stripe  and mirror image as error.

If such metadata are left - we fail with any further removal.

9 years agotests: delay only data portion of device
Zdenek Kabelac [Fri, 3 Apr 2015 14:39:19 +0000 (16:39 +0200)]
tests: delay only data portion of device

9 years agotests: better check for empty set
Zdenek Kabelac [Fri, 3 Apr 2015 14:38:05 +0000 (16:38 +0200)]
tests: better check for empty set

Even when no arg is passed - there is still one "" arg there...
So taky it easy and check for empty string instead.

9 years agotests: delay only data area
Zdenek Kabelac [Fri, 3 Apr 2015 12:39:05 +0000 (14:39 +0200)]
tests: delay only data area

9 years agotests: test update
Zdenek Kabelac [Fri, 3 Apr 2015 12:24:15 +0000 (14:24 +0200)]
tests: test update

Really wait till fsck is running (sleep 2 is not ideal)
Use new  'delay_dev'.

9 years agotests: hide unwanted output
Zdenek Kabelac [Fri, 3 Apr 2015 12:38:22 +0000 (14:38 +0200)]
tests: hide unwanted output

9 years agotests: enhance delay_dev
Zdenek Kabelac [Fri, 3 Apr 2015 12:22:29 +0000 (14:22 +0200)]
tests: enhance delay_dev

Use common code for error_dev & delay_dev.
Both functions now take list of sectors.

From now on we could delay just 'extent' section, while
keeping running  lvm commands fast (having native metadata area).

9 years agotests: add get first_extent_sector
Zdenek Kabelac [Fri, 3 Apr 2015 12:20:03 +0000 (14:20 +0200)]
tests: add  get first_extent_sector

Trvial function to figure out sector position of 1st. extent.

9 years agotests: simplify check sysfs_queue
Zdenek Kabelac [Fri, 3 Apr 2015 08:27:00 +0000 (10:27 +0200)]
tests: simplify check sysfs_queue

Pass just device name and let figure out
sysfs path inside the function.

9 years agotests: slowdown pvmove devs more
Zdenek Kabelac [Thu, 2 Apr 2015 14:02:06 +0000 (16:02 +0200)]
tests: slowdown pvmove devs more

Once pvmove is running - slow it even more
since some test machines tend to be very very slow.

9 years agotests: split bigger test
Zdenek Kabelac [Thu, 2 Apr 2015 14:01:01 +0000 (16:01 +0200)]
tests: split bigger test

Use separate new test and avoid teardown_devs
in the middle of single test.

9 years agotests: drop check for awk
Zdenek Kabelac [Fri, 27 Mar 2015 12:43:11 +0000 (13:43 +0100)]
tests: drop check for awk

9 years agotests: fix test warning
Zdenek Kabelac [Thu, 2 Apr 2015 10:37:56 +0000 (12:37 +0200)]
tests: fix test warning

We cannot print TEST WARNING within test shell script
(since it's running in debug mode and thus always prints it)

Use 'should false' trick let the string printed in this case.
So 'non cluster cases' should now end properly.

9 years agotests: deal with kernel and broken lcm
Zdenek Kabelac [Thu, 2 Apr 2015 10:22:59 +0000 (12:22 +0200)]
tests: deal with kernel and broken  lcm

If the kernel has 'new lcm()' (3.19) it provides wrong
optimal_io_size value for dm device so lvm2 command cannot
create properly aligned devices.

Use 'should' for this case - so test ends with 'TEST WARNING'.

9 years agotests: add check sysfs_queue
Zdenek Kabelac [Thu, 2 Apr 2015 10:21:55 +0000 (12:21 +0200)]
tests: add check sysfs_queue

Add check function for content of /sys/block/$1/queue/$2 == $3

9 years agotests: move exa test to separate file
Zdenek Kabelac [Fri, 27 Mar 2015 13:31:08 +0000 (14:31 +0100)]
tests: move exa test to separate file

Make it visible the 'exa' test passed on an arch.

9 years agotests: more duplicate testing
Zdenek Kabelac [Thu, 2 Apr 2015 10:42:56 +0000 (12:42 +0200)]
tests: more duplicate testing

9 years agodebug: log scanned value
Zdenek Kabelac [Fri, 27 Mar 2015 12:43:24 +0000 (13:43 +0100)]
debug: log scanned value

Fix verbose print of scanned value for topology attribute.
Result is set afterwards in sectors.

9 years agolvmcache: skip drop when vg_write lock is not held
Zdenek Kabelac [Thu, 2 Apr 2015 10:42:18 +0000 (12:42 +0200)]
lvmcache: skip drop when vg_write lock is not held

Commit 80f4b4b8039a88dfa2648a9b5bb5e16f41b81f87
introduced undesirable side-effects for lvm2app user
which happens to be our own python binding.

It appear obtaing pvs list keeps global lock.

So restricting this to VG_GLOBAL READ locks and skip
the drop skip if WRITE lock is held.

9 years agopolldaemon: alter few lines related to interval
Ondrej Kozina [Tue, 17 Mar 2015 17:44:25 +0000 (18:44 +0100)]
polldaemon: alter few lines related to interval

we do not allow 0 interval for pvmove command issued
without parameters with classical polldaemon. It would
query the kernel too often with possibly many pvmoves
in-progress.

9 years agopolldaemon: separate daemon_parms initialisation
Ondrej Kozina [Tue, 17 Mar 2015 17:40:43 +0000 (18:40 +0100)]
polldaemon: separate daemon_parms initialisation

9 years agopolldaemon: prepare wrapper poll_daemon function
Ondrej Kozina [Tue, 17 Mar 2015 17:31:41 +0000 (18:31 +0100)]
polldaemon: prepare wrapper poll_daemon function

with lvmpolld we'll have two polldaemon implementations

9 years agopvmove: split pvmove_update_metadata function
Ondrej Kozina [Mon, 16 Mar 2015 19:23:58 +0000 (20:23 +0100)]
pvmove: split pvmove_update_metadata function

So far pvmove_update_metadata (originaly _update_metadata) was
used for both initial and subsequent metadata updates during polling.
With a new polldaemon (lvmpolld) all operations that require polling
have to be split in two parts: The initiating one and the polling one.
The later step will be used from lvm command spawned by lvmpolld to
monitor and advance the mirror on next segment if required.

1) The initiation part is _update_metadata in pvmove.c which performs
only the first update, setting up the pvmove itself in metadata.

2) pvmove_update_metadata in pvmove_poll.c now handles all other
subsequent metadata updates except the last one.

Due to the split we could remove some code. Also some functions were
moved back to pvmove.c as they were suited for initialisation of pvmove
only.

9 years agolvconvert: move poll code in before refactoring
Ondrej Kozina [Thu, 12 Mar 2015 15:23:19 +0000 (16:23 +0100)]
lvconvert: move poll code in before refactoring

This commit has no impact on functionality. Code required to
be visible outside lvconvert.c is just moved into new file
lvconvert_poll.c and some calls are made non-static and
declared in new header file lvconvert.h

9 years agopvmove: move poll code in before refactoring
Ondrej Kozina [Thu, 12 Mar 2015 15:21:43 +0000 (16:21 +0100)]
pvmove: move poll code in before refactoring

This commit has no impact on functionality. Code required to
be visible outside pvmove.c is just moved into new file
pvmove_poll.c and some calls are made non-static and declared in
new header file pvmove.h

9 years agotests: add clvm case to system_id.sh
David Teigland [Tue, 31 Mar 2015 19:45:14 +0000 (14:45 -0500)]
tests: add clvm case to system_id.sh

9 years agosystemd: stop lvm2-monitor.service before dm-event.service
Peter Rajnoha [Tue, 31 Mar 2015 13:50:16 +0000 (15:50 +0200)]
systemd: stop lvm2-monitor.service before dm-event.service

9 years agosystemd: stop lvm2-pvscan@.service before lvm2-lvmetad.service
Michael Lass [Tue, 31 Mar 2015 13:47:01 +0000 (15:47 +0200)]
systemd: stop lvm2-pvscan@.service before lvm2-lvmetad.service

When lvm2-pvscan@.service and lvm2-lvmetad.service are scheduled to be
stopped lvm2-pvscan@.service should be stopped first since pvscan uses
lvmetad.

This is especially important if lvm2-lvmetad.socket is also scheduled to
be stopped as in this case connection requests are suppressed causing
pvscan to fail.

9 years agoREADME: fix link to lvm-devel mailing list
Michael Lass [Tue, 31 Mar 2015 13:44:00 +0000 (15:44 +0200)]
README: fix link to lvm-devel mailing list

9 years agolvm.conf: fix typo as -> is in read_only_volume_list comments
Peter Rajnoha [Tue, 31 Mar 2015 13:38:29 +0000 (15:38 +0200)]
lvm.conf: fix typo as -> is in read_only_volume_list comments

9 years agopolldaemon: fix indentation in _poll_vg fn
Ondrej Kozina [Tue, 31 Mar 2015 11:16:01 +0000 (13:16 +0200)]
polldaemon: fix indentation in _poll_vg fn

9 years agopolldaemon: proper error check in _poll_vg fn
Ondrej Kozina [Tue, 31 Mar 2015 09:26:53 +0000 (11:26 +0200)]
polldaemon: proper error check in _poll_vg fn

could theoretically cause NULL pointer dereference

9 years agotests: add pvmove --abort for all moves in progress
Ondrej Kozina [Mon, 30 Mar 2015 14:59:51 +0000 (16:59 +0200)]
tests: add pvmove --abort for all moves in progress

test for bug described in c282a66132063d702d1df1e342961f75a5ffcdd2

9 years agotests: add pvmove --abort test
Ondrej Kozina [Mon, 30 Mar 2015 14:59:06 +0000 (16:59 +0200)]
tests: add pvmove --abort test

test for bug described in c282a66132063d702d1df1e342961f75a5ffcdd2

9 years agopvmove: fix pvmove --abort or pvmove w/o parameters
Ondrej Kozina [Mon, 30 Mar 2015 14:25:04 +0000 (16:25 +0200)]
pvmove: fix pvmove --abort or pvmove w/o parameters

_check_lv_status was called from within dm_list_iterate_items cycle.
This was utterly wrong! _check_lv_status may remove more than one LV from
vg->lvs list we iterated in the same time.

In some scenarios this could lead to deadlock iterationg over same LV
indefinitely or segfault depending on the circumstances.

Fixed by moving the _check_lv_status outside iterating the vg->lvs
list.

Note that commit 6e7b24d34ff3da1c56718bb7def8a8ecd4258c43 was not enough
as _check_lv_status may result in removal of more than one LV from the list.

9 years agotests: add helper routine for pvmove status check
Ondrej Kozina [Fri, 27 Mar 2015 13:24:16 +0000 (14:24 +0100)]
tests: add helper routine for pvmove status check

9 years agotests: fix check for existence of a pvmove Lv
Ondrej Kozina [Fri, 27 Mar 2015 14:42:11 +0000 (15:42 +0100)]
tests: fix check for existence of a pvmove Lv

9 years agoalloc: Log PV tags when reserving areas.
Alasdair G Kergon [Thu, 26 Mar 2015 21:13:26 +0000 (21:13 +0000)]
alloc: Log PV tags when reserving areas.

9 years agoalloc: Pass alloc_handle through to _reserve_area.
Alasdair G Kergon [Thu, 26 Mar 2015 20:32:59 +0000 (20:32 +0000)]
alloc: Pass alloc_handle through to _reserve_area.

9 years agoalloc: Only report cling tag errors once.
Alasdair G Kergon [Thu, 26 Mar 2015 19:43:51 +0000 (19:43 +0000)]
alloc: Only report cling tag errors once.

9 years agometadata: Move alloc_handle init/destroy fns.
Alasdair G Kergon [Thu, 26 Mar 2015 18:44:24 +0000 (18:44 +0000)]
metadata: Move alloc_handle init/destroy fns.

9 years agodatastruct: Add str_list_add_list.
Alasdair G Kergon [Thu, 26 Mar 2015 18:30:37 +0000 (18:30 +0000)]
datastruct: Add str_list_add_list.

9 years agotests: drop vg2 at end of test
Zdenek Kabelac [Thu, 26 Mar 2015 15:11:29 +0000 (16:11 +0100)]
tests: drop vg2 at end of test

9 years agotests: skip system_id test in cluster
Zdenek Kabelac [Thu, 26 Mar 2015 15:10:48 +0000 (16:10 +0100)]
tests: skip system_id test in cluster

Let's see what we can do in cluster for system_id,
until resolved skip test for check_cluster.

9 years agotests: pvmove better delay check
Zdenek Kabelac [Thu, 26 Mar 2015 15:03:24 +0000 (16:03 +0100)]
tests: pvmove better delay check

Improve testing for condition that pvmove0 is already running in the
table (so we do not kill pvmove while it has loaded target, but
it's not yet Live).

Also delay_dev for 200ms.

9 years agotests: temporarily trace prepare_vg
Zdenek Kabelac [Thu, 26 Mar 2015 14:05:24 +0000 (15:05 +0100)]
tests: temporarily trace  prepare_vg

9 years agotests: update aux
Zdenek Kabelac [Thu, 26 Mar 2015 14:01:54 +0000 (15:01 +0100)]
tests: update aux

When we use /dev/loopX device - shift first PV1 sector by 1M
so /dev/loop0 and dm device do not appear as same device.

Also notify lvmetad once 'devs' are created - so in case this
command is called in the middle of test - lvmetad properly
drops its metadata for these devices.

Drop used test.img file between reuse so the 'prepare_vg'
always starts with zeroed disks.

When LVM_TEST_AUX_TRACE is set, allow shell tracing of aux commands.

9 years agotests: avoid multiple pids
Zdenek Kabelac [Thu, 26 Mar 2015 13:12:34 +0000 (14:12 +0100)]
tests: avoid multiple pids

On some systems (parisc) pgrep prints more then 1 pid
(all thread IDs are printed)
So print only leading pid and avoid 'kill' being confused.

9 years agotests: move thin-related test from select-tools.sh to select-tools-thin.sh
Peter Rajnoha [Tue, 24 Mar 2015 09:12:04 +0000 (10:12 +0100)]
tests: move thin-related test from select-tools.sh to select-tools-thin.sh

And skip this test if thin target is not available.

9 years agotests: select-tools.sh: add test for fix in commit c9f021de0b4d2c873ef5b97d17c602d038...
Peter Rajnoha [Tue, 24 Mar 2015 08:50:35 +0000 (09:50 +0100)]
tests: select-tools.sh: add test for fix in commit c9f021de0b4d2c873ef5b97d17c602d0380359fd

9 years agometadata: vg: add removed_lvs field to collect LVs which have been removed
Peter Rajnoha [Mon, 23 Mar 2015 12:32:00 +0000 (13:32 +0100)]
metadata: vg: add removed_lvs field to collect LVs which have been removed

Do not keep dangling LVs if they're removed from the vg->lvs list and
move them to vg->removed_lvs instead (this is actually similar to already
existing vg->removed_pvs list, just it's for LVs now).

Once we have this vg->removed_lvs list indexed so it's possible to
do lookups for LVs quickly, we can remove the LV_REMOVED flag as
that one won't be needed anymore - instead of checking the flag,
we can directly check the vg->removed_lvs list if the LV is present
there or not and to say if the LV is removed or not then. For now,
we don't have this index, but it may be implemented in the future.

9 years agometadata: process_each_lv_in_vg: get the list of LVs to process first, then do the...
Peter Rajnoha [Mon, 16 Mar 2015 16:10:21 +0000 (17:10 +0100)]
metadata: process_each_lv_in_vg: get the list of LVs to process first, then do the processing

This avoids a problem in which we're using selection on LV list - we
need to do the selection on initial state and not on any intermediary
state as we process LVs one by one - some of the relations among LVs
can be gone during this processing.

For example, processing one LV can cause the other LVs to lose the
relation to this LV and hence they're not selectable anymore with
the original selection criteria as it would be if we did selection
on inital state. A perfect example is with thin snapshots:

$ lvs -o lv_name,origin,layout,role vg
  LV    Origin Layout      Role
  lvol1        thin,sparse public,origin,thinorigin,multithinorigin
  lvol2 lvol1  thin,sparse public,snapshot,thinsnapshot
  lvol3 lvol1  thin,sparse public,snapshot,thinsnapshot
  pool         thin,pool   private

$ lvremove -ff -S 'lv_name=lvol1 || origin=lvol1'
  Logical volume "lvol1" successfully removed

The lvremove command above was supposed to remove lvol1 as well as
all its snapshots which have origin=lvol1. It failed to do so, because
once we removed the origin lvol1, the lvol2 and lvol3 which were
snapshots before are not snapshots anymore - the relations change
as we're processing these LVs one by one.

If we do the selection first and then execute any concrete actions on
these LVs (which is what this patch does), the behaviour is correct
then - the selection is done on the *initial state*:

$ lvremove -ff -S 'lv_name=lvol1 || origin=lvol1'
  Logical volume "lvol1" successfully removed
  Logical volume "lvol2" successfully removed
  Logical volume "lvol3" successfully removed

Similarly for all the other situations in which relations among
LVs are being changed by processing the LVs one by one.

This patch also introduces LV_REMOVED internal LV status flag
to mark removed LVs so they're not processed further when we
iterate over collected list of LVs to be processed.

Previously, when we iterated directly over vg->lvs list to
process the LVs, we relied on the fact that once the LV is removed,
it is also removed from the vg->lvs list we're iterating over.
But that was incorrect as we shouldn't remove LVs from the list
during one iteration while we're iterating over that exact list
(dm_list_iterate_items safe can handle only one removal at
one iteration anyway, so it can't be used here).

9 years agopost-release
Alasdair G Kergon [Tue, 24 Mar 2015 02:02:07 +0000 (02:02 +0000)]
post-release

9 years agopre-release v2_02_118
Alasdair G Kergon [Tue, 24 Mar 2015 01:59:35 +0000 (01:59 +0000)]
pre-release

9 years agotests: add omitted --atomic mode in pvmove-restart
Ondrej Kozina [Mon, 23 Mar 2015 13:55:13 +0000 (14:55 +0100)]
tests: add omitted --atomic mode in pvmove-restart

9 years agopvmove: use safe version of iteration when iterating over vg->lvs list in _poll_vg
Peter Rajnoha [Mon, 23 Mar 2015 12:33:57 +0000 (13:33 +0100)]
pvmove: use safe version of iteration when iterating over vg->lvs list in _poll_vg

When we're iterating over LVs in _poll_vg fn, we need to use the safe
version of iteration - the LV can be removed from the list which we're
just iterating over if we're finishing or aborting pvmove operation.

9 years agotests: revert should removal in mirror test
Zdenek Kabelac [Fri, 20 Mar 2015 10:08:44 +0000 (11:08 +0100)]
tests: revert should removal in mirror test

Since cluster test was actually not been working,
removal of should has been premature.
So restore 'should' back - bug in mirror code is still there.

9 years agotests: start clvmd without lib/
Zdenek Kabelac [Fri, 20 Mar 2015 10:08:21 +0000 (11:08 +0100)]
tests: start clvmd without lib/

9 years agoformat_text: Fix precommitted segfault.
Alasdair G Kergon [Thu, 19 Mar 2015 11:14:47 +0000 (11:14 +0000)]
format_text: Fix precommitted segfault.

The code never mixes reads of committed and precommitted metadata,
so there's no need to attempt to set PRECOMMITTED when
*use_previous_vg is being set.

9 years agotests: export shell vars
Zdenek Kabelac [Thu, 19 Mar 2015 10:23:44 +0000 (11:23 +0100)]
tests: export shell vars

Export vars so they are visible in  'aux' calls as well.
(reenables cluster testing)

9 years agomakefiles: add more dirs for lcov
Zdenek Kabelac [Thu, 19 Mar 2015 09:23:57 +0000 (10:23 +0100)]
makefiles: add more dirs for lcov

lvmetad lcovered.

This page took 0.076641 seconds and 5 git commands to generate.