master - tests: add case for metadata checksum differences
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=fb96e9ab217641ec3a967d9aa2be01fc936ee038 Commit: fb96e9ab217641ec3a967d9aa2be01fc936ee038 Parent: df6f16c081ffca48f2c812e539851995b7563b68 Author: David Teigland <[email protected]> AuthorDate: Mon Sep 28 13:21:44 2020 -0500 Committer: David Teigland <[email protected]> CommitterDate: Mon Sep 28 13:25:57 2020 -0500
tests: add case for metadata checksum differences
Cover the case where two copies of metadata have the same seqno but different checksums. Also elaborate on an existing fixme in the code for this case, since we should be doing something better for this case.
This had been uncovering an issue with reopening fds in readwrite mode.
--- lib/cache/lvmcache.c | 3 +++ test/shell/metadata-old.sh | 45 +++++++++++++++++++++++++++++++++++++++++++++ test/shell/pvck-repair.sh | 2 -- 3 files changed, 48 insertions(+), 2 deletions(-)
lib/cache/lvmcache.c +3 -0
@@ -1663,6 +1663,9 @@ int lvmcache_update_vgname_and_id(struct cmd_context *cmd, struct lvmcache_info* second updated to seqno 4, first comes back and second goes * missing, first updated to seqno 4, second comes back, now * both are present with same seqno but different checksums. +* FIXME: we should check if the majority of mda copies have one +* checksum and if so use that copy of metadata, but if there's +* not a majority, don't allow the VG to be modified/activated. */ if ((vginfo->mda_size != vgsummary->mda_size) || (vginfo->mda_checksum != vgsummary->mda_checksum)) {
test/shell/metadata-old.sh +45 -0
48 lines not on this page · raw message
test/shell/pvck-repair.sh +0 -2
@@ -399,8 +399,6 @@ lvcreate -l1 -an $vg # One PV, one mda, pv_header zeroed, unmatching dev name requires specified uuid _clear_devs "$dev1" "$dev2" vgcreate $vg "$dev1" -#!!! FIXME: with this hits INTERNAL_ERROR -#!!! vgcreate $vg "$dev1" "$dev2" pvck --dump headers "$dev1" || true UUID1=`pvck --dump headers "$dev1" | grep pv_header.pv_uuid | awk '{print $2}'` echo $UUID1