Compare commits

..

3 Commits

Author SHA1 Message Date
Florent BEAUCHAMP
6fdf0a97e4 Simplify @xen-orchestra/backups/_runners/_writers/IncrementalRemoteWriter.mjs
Co-authored-by: Julien Fontanet <julien.fontanet@isonoe.net>
2024-02-14 07:46:39 +01:00
Florent Beauchamp
3a4bdd3b1e fix(backups): ensure vhd are chained with older vhd 2024-02-13 12:31:22 +00:00
Julien Fontanet
1023131828 chore: update dev deps 2024-02-12 20:47:05 +01:00
4 changed files with 1290 additions and 1176 deletions

View File

@@ -7,7 +7,7 @@ import { chainVhd, checkVhdChain, openVhd, VhdAbstract } from 'vhd-lib'
import { createLogger } from '@xen-orchestra/log'
import { decorateClass } from '@vates/decorate-with'
import { defer } from 'golike-defer'
import { dirname } from 'node:path'
import { dirname, basename as pathBasename } from 'node:path'
import { formatFilenameDate } from '../../_filenameDate.mjs'
import { getOldEntries } from '../../_getOldEntries.mjs'
@@ -199,7 +199,10 @@ export class IncrementalRemoteWriter extends MixinRemoteWriter(AbstractIncrement
undefined,
`missing parent of ${id} in ${dirname(path)}, looking for ${vdi.other_config[TAG_BASE_DELTA]}`
)
assert.ok(
pathBasename(parentPath) < pathBasename(path),
`vhd must be sorted to be chained`
)
parentPath = parentPath.slice(1) // remove leading slash
// TODO remove when this has been done before the export
@@ -218,16 +221,16 @@ export class IncrementalRemoteWriter extends MixinRemoteWriter(AbstractIncrement
})
transferSize += transferSizeOneDisk
if (isDifferencing) {
await chainVhd(handler, parentPath, handler, path)
}
// set the correct UUID in the VHD
await Disposable.use(openVhd(handler, path), async vhd => {
vhd.footer.uuid = packUuid(vdi.uuid)
await vhd.readBlockAllocationTable() // required by writeFooter()
await vhd.writeFooter()
})
if (isDifferencing) {
await chainVhd(handler, parentPath, handler, path)
}
},
{
concurrency: settings.diskPerVmConcurrency,

View File

@@ -33,6 +33,7 @@
<!--packages-start-->
- @xen-orchestra/backups patch
- xo-server patch
- xo-server-audit patch
- xo-web patch

View File

@@ -96,7 +96,7 @@
},
"private": true,
"scripts": {
"build": "turbo run build --scope xo-server --scope xo-server-'*' --scope xo-web",
"build": "TURBO_TELEMETRY_DISABLED=1 turbo run build --scope xo-server --scope xo-server-'*' --scope xo-web",
"build:xo-lite": "turbo run build --scope @xen-orchestra/lite",
"clean": "scripts/run-script.js --parallel clean",
"dev": "scripts/run-script.js --parallel --concurrency 0 --verbose dev",

2448
yarn.lock

File diff suppressed because it is too large Load Diff