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

feat(backups/CBT): retry data_destroy when error is VDI_IN USE #7960

Merged
merged 4 commits into from
Sep 10, 2024
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
Original file line number Diff line number Diff line change
Expand Up @@ -290,7 +290,7 @@ export const AbstractXapi = class AbstractXapiVmBackupRunner extends Abstract {
for (const vdiRef of vdiRefs) {
try {
// data_destroy will fail with a VDI_NO_CBT_METADATA error if CBT is not enabled on this VDI
await this._xapi.call('VDI.data_destroy', vdiRef)
await this._xapi.VDI_dataDestroy(vdiRef)
Task.info(`Snapshot data has been deleted`, { vdiRef })
} catch (error) {
Task.warning(`Couldn't deleted snapshot data`, { error, vdiRef })
Expand Down
11 changes: 11 additions & 0 deletions @xen-orchestra/xapi/vdi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,10 @@ class Vdi {
)
}

async dataDestroy(vdiRef) {
julien-f marked this conversation as resolved.
Show resolved Hide resolved
await this.callAsync('VDI.data_destroy', vdiRef)
}

async create(
{
name_description,
Expand Down Expand Up @@ -290,5 +294,12 @@ decorateClass(Vdi, {
return this._vdiDestroyRetryWhenInUse
},
],
// same condition when destroying data of a VDI
dataDestroy: [
pRetry.wrap,
function () {
return this._vdiDestroyRetryWhenInUse
},
],
exportContent: defer,
})
4 changes: 4 additions & 0 deletions CHANGELOG.unreleased.md
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@

> Users must be able to say: “I had this issue, happy to know it's fixed”

- [Incremental Backup & Replication] Remove most of `Couldn't delete snapshot data` errors when using _Purge snapshot data when using CBT_ [#7826](https://github.com/vatesfr/xen-orchestra/pull/7826) (PR [#7960](https://github.com/vatesfr/xen-orchestra/pull/7960))

### Packages to release

> When modifying a package, add it here with its release type.
Expand All @@ -41,9 +43,11 @@

<!--packages-start-->

- @xen-orchestra/backups patch
- @xen-orchestra/lite minor
- @xen-orchestra/web minor
- @xen-orchestra/web-core minor
- @xen-orchestra/xapi minor
- xo-server minor
- xo-server-perf-alert minor
- xo-server-sdn-controller patch
Expand Down
Loading