Skip to content

Commit

Permalink
CA-328536: If we give up on leaf-coalesce make sure we do so until pr…
Browse files Browse the repository at this point in the history
…ocess exits

Signed-off-by: Mark Syms <mark.syms@citrix.com>
  • Loading branch information
MarkSymsCtx committed Oct 10, 2019
1 parent e83ef48 commit 02dd0b5
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 20 deletions.
29 changes: 17 additions & 12 deletions drivers/XE_SR_ERRORCODES.xml
Original file line number Diff line number Diff line change
Expand Up @@ -94,16 +94,16 @@
<description>Invalid local path</description>
<value>226</value>
</code>
<code>
<name>ISOInvalidSMBversion</name>
<description>Given SMB version is not allowed. Choose either 1.0 or 3.0</description>
<value>227</value>
</code>
<code>
<name>ISOInvalidXeMountOptions</name>
<description>Require "-o" along with xe-mount-isosr</description>
<value>228</value>
</code>
<code>
<name>ISOInvalidSMBversion</name>
<description>Given SMB version is not allowed. Choose either 1.0 or 3.0</description>
<value>227</value>
</code>
<code>
<name>ISOInvalidXeMountOptions</name>
<description>Require "-o" along with xe-mount-isosr</description>
<value>228</value>
</code>

<!-- generic invalid arguments -->
<code>
Expand Down Expand Up @@ -752,6 +752,11 @@
<description>An active FIST point was reached that causes the process to exit abnormally</description>
<value>203</value>
</code>
<code>
<name>LeafGCSkip</name>
<description>Gave up on leaf coalesce after leaf grew bigger than startbefore snapshot taken</description>
<value>204</value>
</code>

<code>
<name>XMLParse</name>
Expand Down Expand Up @@ -859,12 +864,12 @@
<description>Failed to calculate changed blocks for given VDIs.</description>
<value>460</value>
</code>


<code>
<name>GenericException</name>
<description>SM has thrown a generic python exception</description>
<value>1200</value>
</code>



</SM-errorcodes>
16 changes: 8 additions & 8 deletions drivers/cleanup.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
import fjournaler
import lock
import blktap2
import xs_errors
from refcounter import RefCounter
from ipc import IPCFlag
from lvmanager import LVActivator
Expand Down Expand Up @@ -1587,14 +1588,13 @@ def coalesceLeaf(self, vdi, dryRun):
vdi = self.getVDI(uuid)
if vdi:
vdi.delConfig(vdi.DB_LEAFCLSC)
except AbortException:
self.cleanup()
raise
except (util.SMException, XenAPI.Failure), e:
if isinstance(e, AbortException):
self.cleanup()
raise
else:
self._failedCoalesceTargets.append(vdi)
Util.logException("leaf-coalesce")
Util.log("Leaf-coalesce failed, skipping")
self._failedCoalesceTargets.append(vdi)
Util.logException("leaf-coalesce")
Util.log("Leaf-coalesce failed on %s, skipping" % vdi)
self.cleanup()

def garbageCollect(self, dryRun = False):
Expand Down Expand Up @@ -1786,7 +1786,7 @@ def _coalesceLeaf(self, vdi):
"current %s. Abandoning attempts" %
(prevSizeVHD, vdi.getSizeVHD()))
vdi.setConfig(vdi.DB_LEAFCLSC, vdi.LEAFCLSC_OFFLINE)
return False
raise xs_errors.XenError('LeafGCSkip', opterr='VDI=%s' % vdi)
return self._liveLeafCoalesce(vdi)

def _snapshotCoalesce(self, vdi):
Expand Down

0 comments on commit 02dd0b5

Please sign in to comment.