Federico Simoncelli has uploaded a new change for review.
Change subject: upgrade: skip volume lease for faulty metadata offsets ......................................................................
upgrade: skip volume lease for faulty metadata offsets
This check has been added to overcome bz882276 (during the domain upgrade). Few vdsm releases (4.9 prior 496c0c3) generated metadata offsets higher than 2048 - 100 - 1 that would not permit sanlock to store the volume resource in the leases LV.
Bug-Url: https://bugzilla.redhat.com/show_bug.cgi?id=882276 Change-Id: Ic84108d4fbe0dfee9fe1d57c802f99dd937cd8ec Signed-off-by: Federico Simoncelli fsimonce@redhat.com --- M vdsm/storage/imageRepository/formatConverter.py 1 file changed, 23 insertions(+), 1 deletion(-)
git pull ssh://gerrit.ovirt.org:29418/vdsm refs/changes/00/9600/1
diff --git a/vdsm/storage/imageRepository/formatConverter.py b/vdsm/storage/imageRepository/formatConverter.py index cd32a62..a0edaab 100644 --- a/vdsm/storage/imageRepository/formatConverter.py +++ b/vdsm/storage/imageRepository/formatConverter.py @@ -18,7 +18,9 @@ # Refer to the README and COPYING files for full details of the license #
+import errno import logging +import sanlock
from vdsm import qemuImg
@@ -27,6 +29,10 @@ from storage import image from storage import safelease from storage import volume +from storage import blockVolume + + +BLKVOL_MAX_OFFSET = sd.LEASES_SIZE - blockVolume.RESERVED_LEASES - 1
def __convertDomainMetadataToTags(domain, targetVersion): @@ -153,7 +159,23 @@
log.debug("Creating the volume lease for %s", volUUID) metaId = vol.getMetadataId() - vol.newVolumeLease(metaId, domain.sdUUID, volUUID) + + try: + vol.newVolumeLease(metaId, domain.sdUUID, volUUID) + except sanlock.SanlockException, e: + metaOffset = (vol.getMetaOffset() + if hasattr(vol, "getMetaOffset") else 0 + # This check has been added to overcome BZ#882276 (during + # the domain upgrade). Few vdsm releases (4.9 prior 496c0c3) + # generated metadata offsets higher than 2048 - 100 - 1 that + # would not permit sanlock to store the volume resource in + # the leases LV. + if e.errno == errno.ENOSPC and metaOffset > BLKVOL_MAX_OFFSET: + log.error("The volume lease for %s has not been " + "initialized due bz882276, metadata offset " + "too high: %s", volUUID, metaOffset) + else: + raise
# If this volume is used as a template let's update the other # volume's permissions and share the volume lease (at the moment
-- To view, visit http://gerrit.ovirt.org/9600 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: newchange Gerrit-Change-Id: Ic84108d4fbe0dfee9fe1d57c802f99dd937cd8ec Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com
Federico Simoncelli has posted comments on this change.
Change subject: upgrade: skip volume lease for faulty metadata offsets ......................................................................
Patch Set 1: (1 inline comment)
.................................................... File vdsm/storage/imageRepository/formatConverter.py Line 169: # the domain upgrade). Few vdsm releases (4.9 prior 496c0c3) Line 170: # generated metadata offsets higher than 2048 - 100 - 1 that Line 171: # would not permit sanlock to store the volume resource in Line 172: # the leases LV. Line 173: if e.errno == errno.ENOSPC and metaOffset > BLKVOL_MAX_OFFSET: We could also try to tag the storage domain in some way to recognize it (faster/easier) later. Line 174: log.error("The volume lease for %s has not been " Line 175: "initialized due bz882276, metadata offset " Line 176: "too high: %s", volUUID, metaOffset) Line 177: else:
-- To view, visit http://gerrit.ovirt.org/9600 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: comment Gerrit-Change-Id: Ic84108d4fbe0dfee9fe1d57c802f99dd937cd8ec Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com
Federico Simoncelli has abandoned this change.
Change subject: upgrade: skip volume lease for faulty metadata offsets ......................................................................
Patch Set 1: Abandoned
Abandoned in favor of: http://gerrit.ovirt.org/#/c/9660/
-- To view, visit http://gerrit.ovirt.org/9600 To unsubscribe, visit http://gerrit.ovirt.org/settings
Gerrit-MessageType: abandon Gerrit-Change-Id: Ic84108d4fbe0dfee9fe1d57c802f99dd937cd8ec Gerrit-PatchSet: 1 Gerrit-Project: vdsm Gerrit-Branch: master Gerrit-Owner: Federico Simoncelli fsimonce@redhat.com Gerrit-Reviewer: Ayal Baron abaron@redhat.com Gerrit-Reviewer: Federico Simoncelli fsimonce@redhat.com
vdsm-patches@lists.fedorahosted.org