[NEW PATCH] BZ#723579 - Disown child procs so they wouldn't hold VDSM shutdown (via gerrit-bot)
by smizrahi@redhat.com
New patch submitted by Saggi Mizrahi (smizrahi(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/863
commit b705b2249e4635a1e3f3c4feeede53081c8a6a52
Author: Saggi Mizrahi <smizrahi(a)redhat.com>
Date: Mon Aug 29 16:13:24 2011 +0300
BZ#723579 - Disown child procs so they wouldn't hold VDSM shutdown
This patch touches a protected variable in the python multiprocessing
framework. This is not ideal but necessary to keep VDSM from getting
stuck waiting for a child.
Change-Id: I7b96b6ac5b35e28cb2f8232f580651a3a36db295
diff --git a/vdsm/storage/processPool.py b/vdsm/storage/processPool.py
index fc843c4..6c6632d 100644
--- a/vdsm/storage/processPool.py
+++ b/vdsm/storage/processPool.py
@@ -18,7 +18,7 @@
# Refer to the README and COPYING files for full details of the license
#
-from multiprocessing import Pipe, Process
+from multiprocessing import Pipe, Process, current_process
from threading import Lock
import os
import signal
@@ -111,6 +111,11 @@ class ProcessPool(object):
# The locks remain locked of purpose so no one will
# be able to run further commands
+def disown(proc):
+ # I know touching _children is wrong but there is no public API for
+ # disowning a child
+ current_process()._children.discard(proc)
+
class Helper(object):
def __init__(self):
self.lifeline, childsLifeline = os.pipe()
@@ -118,6 +123,8 @@ class Helper(object):
self.proc = Process(target=_helperMainLoop, args=(hisPipe, childsLifeline, self.lifeline))
self.proc.daemon = True
self.proc.start()
+ disown(self.proc)
+
os.close(childsLifeline)
def kill(self):
11 years, 6 months
[NEW PATCH] BZ#732416- Introducing deleteMultipleVolumes (via gerrit-bot)
by ewarszaw@redhat.com
New patch submitted by Eduardo Warszawski (ewarszaw(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/881
commit ff6df4423c30fb6507b1f6e864247e5a3c4262da
Author: Eduardo Warszawski <ewarszaw(a)redhat.com>
Date: Mon Aug 29 18:59:01 2011 +0300
BZ#732416- Introducing deleteMultipleVolumes
Change-Id: I0d8bbff8d364ef85d62237dd13caede1e60f3449
diff --git a/vdsm/storage/blockVolume.py b/vdsm/storage/blockVolume.py
index 9d2e0d7..9b51d99 100644
--- a/vdsm/storage/blockVolume.py
+++ b/vdsm/storage/blockVolume.py
@@ -648,3 +648,33 @@ def _getVolumeTag(sdUUID, volUUID, tagPrefix):
return tag[len(tagPrefix):]
raise se.MissingTagOnLogicalVolume(volUUID, tagPrefix)
+
+def _postZero(sdUUID, volumes):
+ #Assumed here that the volume is active.
+ #To activate all the volumes of an image at once get its resource.
+ #See http://gerrit.usersys.redhat.com/771
+ #Assert volumes are writable. (Don't do this at home.)
+ lvNames = (vol.volUUID for vol in volumes)
+ try:
+ lvm._lvminfo._changelv(sdUUID, lvNames, "--permission", "rw")
+ except se.StorageException, e:
+ #Hope this only means that some volumes were already writable
+ pass
+ for lv in lvm.getLV(sdUUID):
+ if lv.name in lvNames:
+ # wipe out the whole volume
+ try:
+ misc.ddWatchCopy("/dev/zero", lvm.lvPath(sdUUID, lv.name), vars.task.aborting, int(lv.size),
+ recoveryCallback=volume.baseAsyncTasksRollback)
+ except se.ActionStopped, e:
+ raise e
+ except Exception, e:
+ raise se.VolumesZeroingError(lv.name)
+
+def deleteMultipleVolumes(sdUUID, volumes, postZero):
+ "Delete multiple volumes (LVs) in the same domain (VG)."""
+ if postZero:
+ _postZero(sdUUID, volumes)
+ lvNames = (vol.volUUID for vol in volumes)
+ lvm.removeLVs(sdUUID, lvNames)
+
diff --git a/vdsm/storage/fileVolume.py b/vdsm/storage/fileVolume.py
index f6aae79..c16d68c 100644
--- a/vdsm/storage/fileVolume.py
+++ b/vdsm/storage/fileVolume.py
@@ -23,6 +23,7 @@ import uuid
import storage_exception as se
from sdf import StorageDomainFactory as SDF
+import outOfProcess as oop
import volume
import image
import sd
@@ -31,12 +32,25 @@ import misc
import task
from threadLocal import vars
-
def getDomUuidFromVolumePath(volPath):
# Volume path has pattern:
# /rhev/data-center/spUUID/sdUUID/images/imgUUID/volUUID
return volPath.split('/')[4]
+
+def deleteMultipleVolumes(sdUUID, volumes, postZero):
+ #Posix asserts that the blocks will be zeroed before reuse
+ volPaths = []
+ for vol in volumes:
+ vol.setLegality(volume.ILLEGAL_VOL)
+ volPaths.append(vol.getVolumePath())
+ try:
+ oop.fileUtils.cleanupfiles(volPaths)
+ except OSError:
+ volume.log.error("cannot delete some volumes at paths: %s",
+ volPaths, exc_info=True)
+
+
class FileVolume(volume.Volume):
""" Actually represents a single volume (i.e. part of virtual disk).
"""
diff --git a/vdsm/storage/image.py b/vdsm/storage/image.py
index b97c69f..a68f168 100644
--- a/vdsm/storage/image.py
+++ b/vdsm/storage/image.py
@@ -207,12 +207,13 @@ class Image:
volumes = [volclass(self.repoPath, sdUUID, imgUUID, volUUID) for volUUID in uuidlist]
# If we got here than go ahead and remove all of them without mercy
- for vol in volumes:
+ if volumes:
try:
- vol.delete(postZero=postZero, force=True)
- except Exception, ex:
- # Volume deletion failed, but we don't really care at this point
- self.log.warn("Problems during image %s deletion (%s). Continue...", imgUUID, str(ex))
+ #No, this is not a classmethod! No validations here
+ volclass.__module__.deleteMultipleVolumes(sdUUID, volumes, postZero)
+ except (se.CannotRemoveLogicalVolume, se.VolumeAccessError):
+ #Any volume deletion failed, but we don't really care at this point
+ self.log.warn("Problems during image %s deletion (%s). Continue...", exc_info=True)
# Now clean the image directory
removedImage = imageDir = self.getImageDir(sdUUID, imgUUID)
diff --git a/vdsm/storage/spm.py b/vdsm/storage/spm.py
index 112b69f..dd20909 100644
--- a/vdsm/storage/spm.py
+++ b/vdsm/storage/spm.py
@@ -1519,6 +1519,12 @@ class SPM:
hsm.HSM.getPool(spUUID) #Validates that the pool is connected. WHY?
hsm.HSM.validateSdUUID(sdUUID)
+ #Need this resource to induce all the LVs in the image to be active
+ #at once if zeroed.
+ #See http://gerrit.usersys.redhat.com/771
+ if postZero:
+ vars.task.getSharedLock(STORAGE, imgUUID)
+
vars.task.getSharedLock(STORAGE, sdUUID)
# Do not validate if forced.
repoPath = os.path.join(self.storage_repository, spUUID)
11 years, 6 months
[NEW PATCH] BZ#732245, BZ#732269 - Handle EAGAIN and EINTR in AsyncProc.communicate (via gerrit-bot)
by smizrahi@redhat.com
New patch submitted by Saggi Mizrahi (smizrahi(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/865
commit 77cbfcc06bc83280d21478a16c4a531de8491e2d
Author: Saggi Mizrahi <smizrahi(a)redhat.com>
Date: Tue Aug 30 11:14:25 2011 +0300
BZ#732245, BZ#732269 - Handle EAGAIN and EINTR in AsyncProc.communicate
Change-Id: I2e0f8494826e9cb0debf8a9d3c9a591ac883b376
diff --git a/vdsm/storage/misc.py b/vdsm/storage/misc.py
index b16df9b..79fc3cc 100644
--- a/vdsm/storage/misc.py
+++ b/vdsm/storage/misc.py
@@ -855,7 +855,16 @@ class AsyncProc(object):
# trun on only if data is waiting to be pushed
self._poller.modify(self._fdin, select.EPOLLOUT)
- for fd, event in self._poller.poll(1):
+ pollres = None
+ while pollres is None:
+ try:
+ pollres = self._poller.poll(1)
+ except OSError as e:
+ if e.errno in (errno.EINTR, errno.EAGAIN):
+ continue
+ raise
+
+ for fd, event in pollres:
stream = self._fdMap[fd]
if event & select.EPOLLOUT and self._stdin.len > 0:
buff = self._stdin.read(BUFFSIZE)
11 years, 6 months
[NEW PATCH] Don't include vdsClient in tarball (via gerrit-bot)
by smizrahi@redhat.com
New patch submitted by Saggi Mizrahi (smizrahi(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/868
commit e5f64d372cc802fae3b7d633f90701974ccd553a
Author: Saggi Mizrahi <smizrahi(a)redhat.com>
Date: Tue Aug 30 16:14:04 2011 +0300
Don't include vdsClient in tarball
Change-Id: Ia4996be04a14fcb54a5874556f3c19331aaf03a5
diff --git a/vdsm_cli/Makefile.am b/vdsm_cli/Makefile.am
index b9cf6a8..a8e9f87 100644
--- a/vdsm_cli/Makefile.am
+++ b/vdsm_cli/Makefile.am
@@ -6,7 +6,7 @@
# LICENSE_GPL_v2 which accompany this distribution.
#
-dist_bin_SCRIPTS = \
+nodist_bin_SCRIPTS = \
vdsClient
dist_vdsm_DATA = \
11 years, 6 months
[NEW PATCH] BZ#??????? - MD offset should be in MD_SIZE not in bytes (via gerrit-bot)
by smizrahi@redhat.com
New patch submitted by Saggi Mizrahi (smizrahi(a)redhat.com)
You can review this change at: http://gerrit.usersys.redhat.com/888
commit d89f68cec7b1570a14decc0829503410479fd07a
Author: Saggi Mizrahi <smizrahi(a)redhat.com>
Date: Thu Sep 1 14:48:59 2011 +0300
BZ#??????? - MD offset should be in MD_SIZE not in bytes
Change-Id: I381f510e23027a24e889d33042f7523ac383cd41
diff --git a/vdsm/storage/blockSD.py b/vdsm/storage/blockSD.py
index ab3241f..f5995e5 100644
--- a/vdsm/storage/blockSD.py
+++ b/vdsm/storage/blockSD.py
@@ -549,7 +549,7 @@ class BlockStorageDomain(sd.StorageDomain):
continue
if size is None:
- size = blockVolume.VOLUME_METASIZE
+ size = 1
occupiedSlots.append((offset, size))
@@ -565,7 +565,7 @@ class BlockStorageDomain(sd.StorageDomain):
# metadata look the same. The domain might get
# confused and think it has lv metadata if it
# finds something is written in that area.
- freeSlot = SD_METADATA_SIZE
+ freeSlot = 1
for offset, size in occupiedSlots:
if offset - freeSlot > slotSize:
break
11 years, 6 months
Change in vdsm[master]: BZ#732245, BZ#732269 - Handle EAGAIN and EINTR in AsyncProc....
by Haim Ateya
Haim Ateya has posted comments on this change.
Change subject: BZ#732245, BZ#732269 - Handle EAGAIN and EINTR in AsyncProc.communicate
......................................................................
Patch Set 3: Verified
ACK.
--
To view, visit http://10.35.18.144/865
To unsubscribe, visit http://10.35.18.144/settings
Gerrit-MessageType: comment
Gerrit-Change-Id: I2e0f8494826e9cb0debf8a9d3c9a591ac883b376
Gerrit-PatchSet: 3
Gerrit-Project: vdsm
Gerrit-Branch: master
Gerrit-Owner: Saggi Mizrahi <smizrahi(a)redhat.com>
Gerrit-Reviewer: Ayal Baron
Gerrit-Reviewer: Dan Kenigsberg <danken(a)redhat.com>
Gerrit-Reviewer: Eduardo Warszawski <ewarszaw(a)redhat.com>
Gerrit-Reviewer: Federico Simoncelli <fsimonce(a)redhat.com>
Gerrit-Reviewer: Haim Ateya <hateya(a)redhat.com>
Gerrit-Reviewer: Igor Lvovsky <ilvovsky(a)redhat.com>
Gerrit-Reviewer: Saggi Mizrahi <smizrahi(a)redhat.com>
11 years, 6 months