1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

metadata: optimize reading metadata copies in scan

While being in lockless scanning phase, we can avoid reading and checking
matching metadata copies if we already know them from other PV
and just rely on matching metadata header information.

These copies will be examined later during locked metadata read/write
access.

This patch may postpone discovering some read failures to locked phase.
This commit is contained in:
Zdenek Kabelac 2021-09-27 17:14:56 +02:00
parent 24e90f9594
commit 61a6f9905e
2 changed files with 7 additions and 2 deletions

View File

@ -1,5 +1,6 @@
Version 2.03.14 -
==================================
Reduce metadata readings during scanning phase.
Optimize computation of crc32 check sum with multiple PVs.
Enhance recover path on cache creation failure.
Filter out unsupported MQ/SMQ cache policy setting.

View File

@ -1570,7 +1570,11 @@ int read_metadata_location_summary(const struct format_type *fmt,
/* Keep track of largest metadata size we find. */
lvmcache_save_metadata_size(rlocn->size);
lvmcache_lookup_mda(vgsummary);
if (lvmcache_lookup_mda(vgsummary)) {
log_debug("Skipping read of already known VG metadata with matching mda checksum on %s.",
dev_name(dev_area->dev));
goto out;
}
if (!text_read_metadata_summary(fmt, dev_area->dev, MDA_CONTENT_REASON(primary_mda),
(off_t) (dev_area->start + rlocn->offset),
@ -1591,7 +1595,7 @@ int read_metadata_location_summary(const struct format_type *fmt,
(unsigned long long)(dev_area->start + rlocn->offset));
return 0;
}
out:
log_debug_metadata("Found metadata summary on %s at %llu size %llu for VG %s",
dev_name(dev_area->dev),
(unsigned long long)(dev_area->start + rlocn->offset),