Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

CA-328536: If we give up on leaf-coalesce make sure we do so until pr… #458

Merged
merged 1 commit into from
Oct 10, 2019
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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