| Commit message (Collapse) | Author | Age | Files | Lines |
|
|
|
|
|
| |
In contrast to ancestors and descendants fields, the *_full counterparts
also count with indirect origins in case thin snapshot LV was removed
from the middle of the snapshot chain.
|
|
|
|
| |
Wire it up.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
there's a gap
Thin snapshots can be chained. If we remove LVs in the middle of the
chain, we would still like to know what was the original chain and
hence we'd like to know from which thin LVs an LV descended.
Normally we track only direct origin through seg->origin pointer
(snapshot -> origin path) and through lv->segs_using_this_lv for
the other way round (origin -> snapshots path).
This patch add seg->indirect_origin and lv->indirect_segs_using_this_lv
to track the dependency even if the chain is broken somewhere in the
middle. Actual implementation of the removal and proper setting
of the new fields and structures will be subject to subsequent
patches - this patch adds only the infrastructure for making
this extended dependency tracking possible.
For example, let's consider this thin snapshot chain:
LV1 -- LV2 -- LV3 -- LV4
After removing LV 2, we end up with:
LV1 LV3 -- LV4
This patch adds support for recording the gap that resulted from
removing the LV in thin snapshot chain (removed LVs are prefixed
with '!' here):
____________
/ \
LV1 !LV2 LV3 -- LV4
The !LV2 is the removed LV - recorded in lv->removed_ancestors
list (LV3 holds this list in this situation). The LV3 also records
LV1 as its indirect origin.
After removing LV3, we end up with:
_____________________
/ \
LV1 !LV2 !LV3 LV4
In terms of the new fields/structures, we end up with:
LV4->removed_ancestor_lv_names = [ "LV2", "LV3" ]
first_seg(LV4)->origin = NULL
first_seg(LV4)->indirect_origin = LV1
LV1->indirect_segs_using_this_lv = [ first_seg(LV4) ]
====
A little bit more complex example:
LV1 -- LV2 -- LV3 -- LV4
\
--------------- LV5 -- LV6
Then after removing the LV2, we end up with:
_____________________
/__________ \
// \ \
LV1 !LV2 LV3 -- LV4 \
\
LV5 -- LV6
Then after removing the LV5, we end up with:
____________________________
/__________ \
// \ \
LV1 !LV2 LV3 -- LV4 \
\
!LV5 LV6
LV3->removed_ancestor_lv_names = [ "LV2" ]
first_seg(LV3)->origin = NULL
first_seg(LV3)->indirect_origin = LV1
LV6->removed_ancestor_lv_names = [ "LV5" ]
first_seg(LV6)->origin = NULL
first_seg(LV6)->indirect_origin = LV1
LV1->indirect_segs_using_this_lv = [ first_seg(LV3), first_seg(LV6) ]
|
|
|
|
| |
general
|
| |
|
|
|
|
| |
for string lists in general
|
|
|
|
| |
in general
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Improve the python unit test case to cover all of the properties of a LV and
the properties of a LV segment.
In addition we also add a 'tag' to the lv so that we can retrieve it
using the 'lv_tags' property to ensure that this works as expected.
Signed-off-by: Tony Asleson <tasleson@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Synopsis: STR_LIST needs to be treated as STR for properties.
For any lvm property that was internally 'typed' as a string list we were failing
to return a string in the property API. This was due to the fact that for the
properties to work the value needs to either be evaulated as a string or a
number. This change corrects the macro used to build the memory array of
structures so that the string bitfield is set as needed to ensure that the value
is a string.
https://bugzilla.redhat.com/show_bug.cgi?id=1139920
Signed-off-by: Tony Asleson <tasleson@redhat.com>
|
|
|
|
|
|
|
|
|
| |
When retrieving a property value that is a string, if the character pointer in C
was NULL, we would segfault. This change checks for non-null before creating a
python string representation. In the case where the character pointer is NULL
we will return a python 'None' for the value.
Signed-off-by: Tony Asleson <tasleson@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
With the lvm2app C API adding the ability to determine when a property is
signed we can then use this information to construct the correct representation
of the number for python which will maintain value and sign. Previously, we
only represented the numbers in python as positive integers.
Python long type exceeds the range for unsigned and signed integers, we just
need to use the appropriate parsing code to build correctly.
Python part of the fix for:
https://bugzilla.redhat.com/show_bug.cgi?id=838257
Signed-off-by: Tony Asleson <tasleson@redhat.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Currently lvm2app properties have the following structure:
typedef struct lvm_property_value {
uint32_t is_settable:1;
uint32_t is_string:1;
uint32_t is_integer:1;
uint32_t is_valid:1;
uint32_t padding:28;
union {
const char *string;
uint64_t integer;
} value;
} lvm_property_value_t;
which assumes that numerical values were in the range of 0 to 2**64-1. However,
some of the properties were 'signed', like LV major/minor numbers and some
reserved values for properties that represent percentages. Thus when the
values were retrieved they were in two's complement notation. So for a -1
major number the API user would get a value of 18446744073709551615. The
API user could cast the returned value to an int64_t to handle this, but that
requires the API developer to look at the source code and determine when it
should be done.
This change modifies the return property structure to:
typedef struct lvm_property_value {
uint32_t is_settable:1;
uint32_t is_string:1;
uint32_t is_integer:1;
uint32_t is_valid:1;
uint32_t is_signed:1;
uint32_t padding:27;
union {
const char *string;
uint64_t integer;
int64_t signed_integer;
} value;
} lvm_property_value_t;
With this addition the API user can interrogate that the value is numerical,
(is_integer = 1) and subsequently check if it's signed (is_signed = 1) too.
If signed, then the API developer should use the union's signed_integer to
avoid casting.
This change maintains backwards compatibility as the structure size remains
unchanged and integer value remains unchanged. Only the additional bit
taken from the pad is utilized.
Bugzilla reference:
https://bugzilla.redhat.com/show_bug.cgi?id=838257
Signed-off-by: Tony Asleson <tasleson@redhat.com>
|
|
|
|
| |
overlooked pvmove-restart test during cleanup
|
|
|
|
|
|
| |
commits:
- bda26acf70e92232b1ed644dba6b44ecbff2a058
- 76a0dffe6f4869de9ca457119c9d7ced837d4e0b
|
|
|
|
|
| |
referenced by new lvpoll command after lvmpolld
gets merged.
|
|
|
|
|
|
|
| |
querying future lvmpolld with zero wait time is highly undesirable
and can cause serious performance drop of the future daemon. The new
wrapper function may avoid immediate return from syscal by
introducing minimal wait time on demand.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
Routines responsible for polling of in-progress pvmove, snapshot merge
or mirror conversion each used custom lookup functions to find vg and
lv involved in polling.
Especially pvmove used pvname to lookup pvmove in-progress. The future
lvmpolld will poll each operation by vg/lv name (internally by lvid).
Also there're plans to make pvmove able to move non-overlaping ranges
of extents instead of single PVs as of now. This would also require
to identify the opertion in different manner.
The poll_operation_id structure together with daemon_parms structure they
identify unambiguously the polling task.
|
|
|
|
|
|
|
|
|
|
| |
Waiting even after _check_lv_status returned success and
'finished' flag was set to true doesn't make much sense.
Note that while we skip the wait() we also skip the
init_full_scan_done(0) inside the routine. This should
have no impact as long as the code after _wait_for_single_lv
doesn't presume anything about the state of the cache.
|
|
|
|
|
| |
with refactored code we take some VG locks as read-only.
Make the poll_get_copy_vg ready for the change.
|
|
|
|
|
|
| |
just a code cleanup and preparations for adding
new code required for polldaemon refactoring.
This commit should not have any functional impact.
|
|
|
|
|
|
|
|
|
| |
as a part of bigger effort to unify polling intefaces
poll_get_copy_lv should be able to look up LVs based
on theirs lv->status field.
Effective after pvmove starts using poll_get_copy_lv
fn as well.
|
|
|
|
|
| |
Moving lvconvert_get_copy_lv to polldaemon (poll_get_copy_lv).
Clear move and rename.
|
|
|
|
|
| |
Moving lvconvert_get_copy_vg to polldaemon (poll_get_copy_vg).
Clear move and rename.
|
|
|
|
| |
Manage mdadm devices on older distros is a challange.
|
|
|
|
|
|
|
|
|
| |
When kernel target reports sync status as 0% it might as well mean
it's 100% in sync, just the target is in some race inconsistent
state - so reread once again and take a more optimistic value ;)
Patch tries to work around:
https://bugzilla.redhat.com/show_bug.cgi?id=1210637
|
|
|
|
|
| |
Instead of checking /proc/mounts check for open_count of snap device.
Parallel umount has race, so check for open_count.
|
|
|
|
|
| |
Use first test also for checking the support is there -
avoid one extra unnecessary scsi_debug reload.
|
|
|
|
|
|
| |
Instead of checking just for pid file - rather check
for process - since there could be slight race, the
pid file is gone, but process still exists.
|
|
|
|
| |
Quit test early if passed LVM_TEST_DEVDIR dir does not exists.
|
|
|
|
| |
Continue with test as soon as device appear (avoid 2s delay)
|
| |
|
|
|
|
| |
Check for socket presence (hardcoded for now)
|
|
|
|
|
|
|
| |
Since this value magically worked for pvmove-abort*
use it here as well.
Also prepate_lvmetad has better kill&reload mechanism.
|
|
|
|
|
| |
Fill snaphot with odirect so we know data hits disk
before we test how full the snapshot is.
|
|
|
|
|
| |
lvm_quit() function should also close locking.
Fixes unclosed socket connecting clvmd.
|
|
|
|
| |
Access /run directly when system supports it.
|
|
|
|
| |
Print \n after listing included lock managers.
|
| |
|
| |
|
|
|
|
|
|
|
|
| |
Reinstate config settings matching the last release until every
case where the generator produces different output has been reviewed
and fresh decisions made about which defaults to expose as protection
against changes in newer releases. We should be trying to reduce, not
increase, this number.
|
|
|
|
| |
More take down more targets and use time-limited code.
|
| |
|
| |
|
|
|
|
| |
Related to it's role with lvmetad and auto-activation.
|
|
|
|
| |
Stay with -g and and ignore failure.
|
|
|
|
| |
minor updates
|
|
|
|
|
| |
Seems we captured problems with debug.log overwrite,
so avoid quite expensive usage of fuser tool with each lvm command.
|
| |
|
|
|
|
|
|
|
|
|
| |
Introduce LVM_TEST_LVMETAD_DEBUG_OPTS to allow to override
default debug opts for lvmetad.
However could be still overloaded on command line:
make check_lvmetad LVM_TEST_LVMETAD_DEBUG_OPTS="-l all"...
|