fix(backups): failing replication of qcow2 disks (#10319)

* fix(backups):  task label NBT->NBD

* fix: still force a list block only call for NBD + stream scenario , that was failing to transfer disk on fallback
This commit is contained in:
Florent BEAUCHAMP
2026-09-01 15:28:47 +02:00
committed by GitHub
parent a67dd73304
commit 1004edb51f
3 changed files with 9 additions and 3 deletions

View File

@@ -263,6 +263,7 @@ export class IncrementalXapiWriter extends MixinXapiWriter(AbstractIncrementalWr
vdiRef: activeVdi.$ref,
baseRef: snapshot.$ref,
onlyListChangedBlocks: true,
preferNbd: this._settings.preferNbd,
})
await diffDisk.init()
if (diffDisk.getBlockIndexes().length === 0) {

View File

@@ -98,6 +98,7 @@ export class XapiDiskSource extends DiskPassthrough {
let source
let streamSource
try {
// we will only use the stream for bloc list
streamSource = await this.#openExportStream({ onlyListChangedBlocks: true })
if (streamSource === undefined) {
throw new Error(`Can't open stream source`)
@@ -111,7 +112,7 @@ export class XapiDiskSource extends DiskPassthrough {
await source.init()
this.#useNbd = true
return await this.#formatSourceDisk(source, 'NBT')
return await this.#formatSourceDisk(source, 'NBD')
} catch (err) {
// init probaby failed, so nothing to close , but better safe than sorry
await source?.close().catch(warn)
@@ -163,7 +164,7 @@ export class XapiDiskSource extends DiskPassthrough {
*
* @returns {Promise<Disk>}
*/
async #openExportStream({ onlyListChangedBlocks = false } = {}) {
async #openExportStream({ onlyListChangedBlocks = this.#onlyListChangedBlocks } = {}) {
const xapi = this.#xapi
const baseRef = this.#baseRef
const vdiRef = this.#vdiRef
@@ -263,7 +264,7 @@ export class XapiDiskSource extends DiskPassthrough {
await source.init()
this.#useNbd = true
this.#useCbt = true
return await this.#formatSourceDisk(source, 'NBT+CBT')
return await this.#formatSourceDisk(source, 'NBD+CBT')
} catch (error) {
if (/** @type {NodeJS.ErrnoException} */ (error).code !== 'CBT_DISABLED') {
info('Error in openNbdCBT', error)

View File

@@ -17,6 +17,8 @@
> Users must be able to say: "I had this issue, happy to know it's fixed"
- [Backups] Fix slow replication startup and fallback to full on qcow2 (PR [#10319](https://github.com/vatesfr/xen-orchestra/pull/10319))
### Packages to release
> When modifying a package, add it here with its release type.
@@ -33,4 +35,6 @@
<!--packages-start-->
- @xen-orchestra/backups patch
- @xen-orchestra/xapi patch
<!--packages-end-->