1
0
mirror of git://sourceware.org/git/lvm2.git synced 2025-02-06 01:58:01 +03:00

conf: add metadata/lvs_history_timeout configuration setting

This commit is contained in:
Peter Rajnoha 2016-03-01 15:29:27 +01:00
parent 74272e163d
commit ff6e124a33
3 changed files with 8 additions and 1 deletions

View File

@ -1367,6 +1367,11 @@ cfg(metadata_record_lvs_history_CFG, "record_lvs_history", metadata_CFG_SECTION,
"information kept in metadata for live LVs. Currently, this\n"
"feature is supported for thin and thin snapshot LVs only.\n")
cfg(metadata_lvs_history_retention_time_CFG, "lvs_history_retention_time", metadata_CFG_SECTION, CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_LVS_HISTORY_RETENTION_TIME, vsn(2, 2, 145), NULL, 0, NULL,
"Retention time in seconds after which a record about individual\n"
"historical logical volume is automatically destroyed.\n"
"A value of 0 disables this feature.\n")
cfg(metadata_pvmetadatacopies_CFG, "pvmetadatacopies", metadata_CFG_SECTION, CFG_ADVANCED | CFG_DEFAULT_COMMENTED, CFG_TYPE_INT, DEFAULT_PVMETADATACOPIES, vsn(1, 0, 0), NULL, 0, NULL,
"Number of copies of metadata to store on each PV.\n"
"The --pvmetadatacopies option overrides this setting.\n"

View File

@ -129,6 +129,7 @@
#define DEFAULT_STRIPESIZE 64 /* KB */
#define DEFAULT_RECORD_LVS_HISTORY 0
#define DEFAULT_LVS_HISTORY_RETENTION_TIME 0
#define DEFAULT_PVMETADATAIGNORE 0
#define DEFAULT_PVMETADATASIZE 255
#define DEFAULT_PVMETADATACOPIES 1

View File

@ -4460,6 +4460,7 @@ struct volume_group *vg_read_internal(struct cmd_context *cmd, const char *vgnam
goto out;
}
}
out:
if (!*consistent && (warn_flags & WARN_INCONSISTENT)) {
if (is_orphan_vg(vgname))
@ -6013,7 +6014,7 @@ int is_lockd_type(const char *lock_type)
int vg_strip_outdated_historical_lvs(struct volume_group *vg) {
struct glv_list *glvl, *tglvl;
time_t current_time = time(NULL);
uint64_t threshold = 0;
uint64_t threshold = find_config_tree_int(vg->cmd, metadata_lvs_history_retention_time_CFG, NULL);
if (!threshold)
return 1;