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

thin: resize metadata with data

When data are growing, adapt also size of metadata.
As we get way too many reports from users doing huge growths of
data portion while keep metadata small and avoiding using monitoring.

So to enhance the user-experience in case user requests grown of
thin-pool (without passing PV list for growth) - lvm2 will automaticaly
grown also the metadata part of thin-pool (if possible).
This commit is contained in:
Zdenek Kabelac 2019-04-03 13:01:06 +02:00
parent 7c3de2fd93
commit e27d027155
2 changed files with 19 additions and 0 deletions

View File

@ -1,5 +1,6 @@
Version 2.03.02 - Version 2.03.02 -
=================================== ===================================
Automatically grow thin metadata, when thin data gets too big.
Add synchronization with udev before removing cached devices. Add synchronization with udev before removing cached devices.
Add support for caching VDO LVs and VDOPOOL LVs. Add support for caching VDO LVs and VDOPOOL LVs.
Add support for vgsplit with cached devices. Add support for vgsplit with cached devices.

View File

@ -5664,6 +5664,24 @@ int lv_resize(struct logical_volume *lv,
if (!_lvresize_prepare(&lv, lp, pvh)) if (!_lvresize_prepare(&lv, lp, pvh))
return_0; return_0;
if (lp->resize != LV_REDUCE && !aux_lv && !lp->poolmetadata_size &&
&lv->vg->pvs == pvh && lv_is_thin_pool_data(lv)) {
/* When thin-pool data part is extended, automatically extend also metadata part
* to have the metadata chunks for adressing all data blocks
* Do this only when PV list is not defined and --poolmetadatasize is unspecified */
aux_lp = *lp;
seg = get_only_segment_using_this_lv(lv);
aux_lp.size = estimate_thin_pool_metadata_size(lp->extents, lv->vg->extent_size, seg->chunk_size);
if (aux_lp.size > seg->metadata_lv->size) {
log_verbose("Also going to resize thin-pool metadata to match bigger data.");
aux_lv = _lvresize_setup_aux(seg->metadata_lv, &aux_lp);
aux_lp.sign = SIGN_NONE;
if (!_lvresize_prepare(&aux_lv, &aux_lp, pvh))
return_0;
} else
aux_lp.size = 0;
}
if (((lp->resize == LV_REDUCE) || if (((lp->resize == LV_REDUCE) ||
(aux_lv && aux_lp.resize == LV_REDUCE)) && (aux_lv && aux_lp.resize == LV_REDUCE)) &&
(pvh != &vg->pvs)) (pvh != &vg->pvs))