mirror of
git://sourceware.org/git/lvm2.git
synced 2025-08-23 05:49:28 +03:00
Compare commits
9 Commits
dev-mcsont
...
v2_02_134
Author | SHA1 | Date | |
---|---|---|---|
a3f77ed4ba | |||
b9341e36f1 | |||
8096f2224c | |||
16780f6faa | |||
4103896ca0 | |||
d30105f471 | |||
19feda2c95 | |||
4e6377f5ba | |||
4b47ee5296 |
@ -1 +1 @@
|
||||
1.02.111-git (2015-10-30)
|
||||
1.02.110-git (2015-11-09)
|
||||
|
@ -1,5 +1,8 @@
|
||||
Version 2.02.134 -
|
||||
Version 2.02.134 - 9th November 2015
|
||||
====================================
|
||||
Refactor some lvmetad code and adjust some duplicate PV messages.
|
||||
No longer repair/wipe VG/PVs if inaccessible because foreign or shared.
|
||||
Pass correct data size to mirror log calc so log can be bigger than 1 extent.
|
||||
|
||||
Version 2.02.133 - 30th October 2015
|
||||
====================================
|
||||
|
@ -1,6 +1,3 @@
|
||||
Version 1.02.111 -
|
||||
====================================
|
||||
|
||||
Version 1.02.110 - 30th October 2015
|
||||
====================================
|
||||
Disable thin monitoring plugin when it fails too often (>10 times).
|
||||
|
File diff suppressed because it is too large
Load Diff
6
lib/cache/lvmcache.c
vendored
6
lib/cache/lvmcache.c
vendored
@ -1784,9 +1784,9 @@ struct lvmcache_info *lvmcache_add(struct labeller *labeller, const char *pvid,
|
||||
* been chosen during a previous populating of
|
||||
* lvmcache, so just use the existing preferences.
|
||||
*/
|
||||
log_verbose("Found duplicate PV %s: using existing dev %s",
|
||||
pvid_s,
|
||||
dev_name(existing->dev));
|
||||
log_warn("Found duplicate PV %s: using existing dev %s",
|
||||
pvid_s,
|
||||
dev_name(existing->dev));
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
11
lib/cache/lvmetad.c
vendored
11
lib/cache/lvmetad.c
vendored
@ -439,6 +439,14 @@ static int _pv_populate_lvmcache(struct cmd_context *cmd,
|
||||
|
||||
while (alt_device) {
|
||||
dev_alternate = dev_cache_get_by_devt(alt_device->v.i, cmd->filter);
|
||||
|
||||
log_verbose("PV on device %s (%d:%d %d) is also on device %s (%d:%d %d) %s",
|
||||
dev_name(dev),
|
||||
(int)MAJOR(devt), (int)MINOR(devt), (int)devt,
|
||||
dev_alternate ? dev_name(dev_alternate) : "unknown",
|
||||
(int)MAJOR(alt_device->v.i), (int)MINOR(alt_device->v.i), (int)alt_device->v.i,
|
||||
pvid_txt);
|
||||
|
||||
if (dev_alternate) {
|
||||
if ((info_alternate = lvmcache_add(fmt->labeller, (const char *)&pvid, dev_alternate,
|
||||
vgname, (const char *)&vgid, 0))) {
|
||||
@ -446,9 +454,6 @@ static int _pv_populate_lvmcache(struct cmd_context *cmd,
|
||||
info = info_alternate;
|
||||
lvmcache_get_label(info)->dev = dev_alternate;
|
||||
}
|
||||
} else {
|
||||
log_warn("Duplicate of PV %s dev %s exists on unknown device %"PRId64 ":%" PRId64,
|
||||
pvid_txt, dev_name(dev), MAJOR(alt_device->v.i), MINOR(alt_device->v.i));
|
||||
}
|
||||
alt_device = alt_device->next;
|
||||
}
|
||||
|
@ -1066,9 +1066,9 @@ cfg_array(activation_volume_list_CFG, "volume_list", activation_CFG_SECTION, CFG
|
||||
" or VG.\n"
|
||||
" @*\n"
|
||||
" Selects an LV if a tag defined on the host is also set on the LV\n"
|
||||
" or VG. See tags/hosttags. If any host tags exist but volume_list\n"
|
||||
" is not defined, a default single-entry list containing '@*' is\n"
|
||||
" assumed.\n"
|
||||
" or VG. See tags/hosttags. If any host tags exist but the volume\n"
|
||||
" list is not defined, a default single-entry list containing '@*'\n"
|
||||
" is assumed.\n"
|
||||
"#\n"
|
||||
"Example\n"
|
||||
"volume_list = [ \"vg1\", \"vg2/lvol1\", \"@tag1\", \"@*\" ]\n"
|
||||
@ -1102,12 +1102,12 @@ cfg_array(activation_auto_activation_volume_list_CFG, "auto_activation_volume_li
|
||||
" or VG.\n"
|
||||
" @*\n"
|
||||
" Selects an LV if a tag defined on the host is also set on the LV\n"
|
||||
" or VG. See tags/hosttags. If any host tags exist but volume_list\n"
|
||||
" is not defined, a default single-entry list containing '@*' is\n"
|
||||
" assumed.\n"
|
||||
" or VG. See tags/hosttags. If any host tags exist but the volume\n"
|
||||
" list is not defined, a default single-entry list containing '@*'\n"
|
||||
" is assumed.\n"
|
||||
"#\n"
|
||||
"Example\n"
|
||||
"volume_list = [ \"vg1\", \"vg2/lvol1\", \"@tag1\", \"@*\" ]\n"
|
||||
"auto_activation_volume_list = [ \"vg1\", \"vg2/lvol1\", \"@tag1\", \"@*\" ]\n"
|
||||
"#\n")
|
||||
|
||||
cfg_array(activation_read_only_volume_list_CFG, "read_only_volume_list", activation_CFG_SECTION, CFG_ALLOW_EMPTY | CFG_DEFAULT_UNDEFINED, CFG_TYPE_STRING, NULL, vsn(2, 2, 89), NULL, 0, NULL,
|
||||
@ -1127,12 +1127,12 @@ cfg_array(activation_read_only_volume_list_CFG, "read_only_volume_list", activat
|
||||
" or VG.\n"
|
||||
" @*\n"
|
||||
" Selects an LV if a tag defined on the host is also set on the LV\n"
|
||||
" or VG. See tags/hosttags. If any host tags exist but volume_list\n"
|
||||
" is not defined, a default single-entry list containing '@*' is\n"
|
||||
" assumed.\n"
|
||||
" or VG. See tags/hosttags. If any host tags exist but the volume\n"
|
||||
" list is not defined, a default single-entry list containing '@*'\n"
|
||||
" is assumed.\n"
|
||||
"#\n"
|
||||
"Example\n"
|
||||
"volume_list = [ \"vg1\", \"vg2/lvol1\", \"@tag1\", \"@*\" ]\n"
|
||||
"read_only_volume_list = [ \"vg1\", \"vg2/lvol1\", \"@tag1\", \"@*\" ]\n"
|
||||
"#\n")
|
||||
|
||||
cfg(activation_mirror_region_size_CFG, "mirror_region_size", activation_CFG_SECTION, 0, CFG_TYPE_INT, DEFAULT_RAID_REGION_SIZE, vsn(1, 0, 0), NULL, vsn(2, 2, 99),
|
||||
|
@ -1579,7 +1579,7 @@ struct alloc_handle {
|
||||
* Returns log device size in extents, algorithm from kernel code
|
||||
*/
|
||||
#define BYTE_SHIFT 3
|
||||
static uint32_t mirror_log_extents(uint32_t region_size, uint32_t pe_size, uint32_t area_len)
|
||||
static uint32_t _mirror_log_extents(uint32_t region_size, uint32_t pe_size, uint32_t area_len)
|
||||
{
|
||||
size_t area_size, bitset_size, log_size, region_count;
|
||||
|
||||
@ -3281,12 +3281,15 @@ static struct alloc_handle *_alloc_init(struct cmd_context *cmd,
|
||||
} else {
|
||||
ah->log_area_count = metadata_area_count;
|
||||
ah->log_len = !metadata_area_count ? 0 :
|
||||
mirror_log_extents(ah->region_size, extent_size,
|
||||
(existing_extents + total_extents) / ah->area_multiple);
|
||||
_mirror_log_extents(ah->region_size, extent_size,
|
||||
(existing_extents + new_extents) / ah->area_multiple);
|
||||
}
|
||||
|
||||
log_debug("Adjusted allocation request to %" PRIu32 " logical extents. Existing size %" PRIu32 ". New size %" PRIu32 ".",
|
||||
total_extents, existing_extents, total_extents + existing_extents);
|
||||
if (ah->log_len)
|
||||
log_debug("Mirror log of %" PRIu32 " extents of size %" PRIu32 "sectors needed for region size %" PRIu32 ".",
|
||||
ah->log_len, extent_size, ah->region_size);
|
||||
|
||||
if (mirrors || stripes)
|
||||
total_extents += existing_extents;
|
||||
|
@ -3428,6 +3428,18 @@ static int _repair_inconsistent_vg(struct volume_group *vg)
|
||||
{
|
||||
unsigned saved_handles_missing_pvs = vg->cmd->handles_missing_pvs;
|
||||
|
||||
/* Cannot write foreign VGs, the owner will repair it. */
|
||||
if (vg->cmd->system_id && strcmp(vg->system_id, vg->cmd->system_id)) {
|
||||
log_verbose("Skip metadata repair for foreign VG.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/* FIXME: do this at higher level where lvmlockd lock can be changed. */
|
||||
if (is_lockd_type(vg->lock_type)) {
|
||||
log_verbose("Skip metadata repair for shared VG.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
vg->cmd->handles_missing_pvs = 1;
|
||||
if (!vg_write(vg)) {
|
||||
log_error("Automatic metadata correction failed");
|
||||
@ -3457,6 +3469,30 @@ static int _wipe_outdated_pvs(struct cmd_context *cmd, struct volume_group *vg,
|
||||
{
|
||||
struct pv_list *pvl, *pvl2;
|
||||
char uuid[64] __attribute__((aligned(8)));
|
||||
|
||||
/*
|
||||
* Cannot write foreign VGs, the owner will repair it.
|
||||
* Also, if another host is updating its VG, we may read
|
||||
* the PVs while some are written but not others, making
|
||||
* some PVs look outdated to us just because we're reading
|
||||
* the VG while it's only partially written out.
|
||||
*/
|
||||
if (cmd->system_id && strcmp(vg->system_id, cmd->system_id)) {
|
||||
log_verbose("Skip wiping outdated PVs for foreign VG.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
/*
|
||||
* FIXME: do this at higher level where lvmlockd lock can be changed.
|
||||
* Also if we're reading the VG with the --shared option (not using
|
||||
* lvmlockd), we can see a VG while it's being written by another
|
||||
* host, same as the foreign VG case.
|
||||
*/
|
||||
if (is_lockd_type(vg->lock_type)) {
|
||||
log_verbose("Skip wiping outdated PVs for shared VG.");
|
||||
return 0;
|
||||
}
|
||||
|
||||
dm_list_iterate_items(pvl, to_check) {
|
||||
dm_list_iterate_items(pvl2, &vg->pvs) {
|
||||
if (pvl->pv->dev == pvl2->pv->dev)
|
||||
|
@ -7,6 +7,7 @@
|
||||
|
||||
test_description='Test vgs with duplicate vg names'
|
||||
SKIP_WITH_LVMPOLLD=1
|
||||
SKIP_WITH_LVMETAD=1
|
||||
|
||||
. lib/inittest
|
||||
|
||||
|
@ -41,6 +41,18 @@ vgcreate $vg2 "$dev2"
|
||||
not vgrename $vg1 $vg2
|
||||
vgremove $vg1 $vg2
|
||||
|
||||
# FIXME: decide how lvmetad should handle
|
||||
# duplicate VG names. lvmetad now ignores
|
||||
# the VG on device B if it already knows
|
||||
# about the same VG name on device A.
|
||||
# This lets you vgrename the VG on device A
|
||||
# which allows the VG on device B to reappear
|
||||
# once it's rescanned.
|
||||
# It's not yet known how we want lvmetad to
|
||||
# handle duplicate VG names.
|
||||
|
||||
test -e LOCAL_LVMETAD && exit 0
|
||||
|
||||
# vgrename duplicate name
|
||||
vgcreate $vg1 "$dev1"
|
||||
aux disable_dev "$dev1"
|
||||
|
Reference in New Issue
Block a user