Compare commits

..

1 Commits

Author SHA1 Message Date
Pierre Brunet
9829eb58f3 fix: add debug to better understand timeout error 2026-08-07 15:53:52 +02:00
2 changed files with 20 additions and 3 deletions

View File

@@ -1,10 +1,13 @@
import { asyncMap } from '@xen-orchestra/async-map'
import { createLogger } from '@xen-orchestra/log'
import { Task } from '@vates/task'
import { DIR_XO_POOL_METADATA_BACKUPS } from '../RemoteAdapter.mjs'
import { forkStreamUnpipe } from './_forkStreamUnpipe.mjs'
import { formatFilenameDate } from '../_filenameDate.mjs'
const { debug } = createLogger('xo:backups:PoolMetadataBackup')
export const PATH_DB_DUMP = '/pool/xmldbdump'
export class PoolMetadataBackup {
@@ -31,7 +34,22 @@ export class PoolMetadataBackup {
const poolDir = `${DIR_XO_POOL_METADATA_BACKUPS}/${schedule.id}/${pool.$id}`
const dir = `${poolDir}/${formatFilenameDate(timestamp)}`
const tasks = Object.values(pool.$xapi.objects.indexes.type.task ?? {})
const pendingTasks = tasks.filter(task => task.status === 'pending')
debug('pool tasks before export', {
total: tasks.length,
pending: pendingTasks.length,
oldestPendingCreated: pendingTasks.map(task => task.created).sort()[0],
})
const stream = (await this._exportPoolMetadata()).body
const startedAt = Date.now()
let bytes = 0
stream.once('data', () => debug('first byte received', { afterMs: Date.now() - startedAt }))
stream.on('data', chunk => (bytes += chunk.length))
stream.once('end', () => debug('stream ended', { bytes, durationMs: Date.now() - startedAt }))
stream.once('error', error => debug('stream errored', { error, bytes, durationMs: Date.now() - startedAt }))
const fileName = `${dir}/data`
const metadata = JSON.stringify(

View File

@@ -262,11 +262,10 @@ export class IncrementalXapiWriter extends MixinXapiWriter(AbstractIncrementalWr
xapi: sr.$xapi,
vdiRef: activeVdi.$ref,
baseRef: snapshot.$ref,
preferNbd: this._settings.preferNbd,
onlyListChangedBlocks: true,
})
await diffDisk.init()
if (diffDisk.getBlockIndexesCount() === 0) {
if (diffDisk.getBlockIndexes().length === 0) {
debug(' NO CHANGE , source detected ? ', !!sourceUuid)
// no block modification since the common snapshot, we can chain VM and disk
// the disk is chained with the active to keep the chain linear
@@ -282,7 +281,7 @@ export class IncrementalXapiWriter extends MixinXapiWriter(AbstractIncrementalWr
canChainToTargetVm = false
debug('checkBaseVdis, data between snapshot and active disk', {
vdiRef: snapshot.$ref,
nbBlocks: diffDisk.getBlockIndexesCount(),
nbBlocks: diffDisk.getBlockIndexes().length,
})
}
} catch (error) {