fix(backups): handle incremental replication to multiple SRs (#6811)
Fix matching previous replications when multiple SRs. Fixes #6582
This commit is contained in:
@@ -16,6 +16,8 @@ export const TAG_BASE_DELTA = 'xo:base_delta'
|
|||||||
|
|
||||||
export const TAG_COPY_SRC = 'xo:copy_of'
|
export const TAG_COPY_SRC = 'xo:copy_of'
|
||||||
|
|
||||||
|
const TAG_BACKUP_SR = 'xo:backup:sr'
|
||||||
|
|
||||||
const ensureArray = value => (value === undefined ? [] : Array.isArray(value) ? value : [value])
|
const ensureArray = value => (value === undefined ? [] : Array.isArray(value) ? value : [value])
|
||||||
const resolveUuid = async (xapi, cache, uuid, type) => {
|
const resolveUuid = async (xapi, cache, uuid, type) => {
|
||||||
if (uuid == null) {
|
if (uuid == null) {
|
||||||
@@ -157,7 +159,10 @@ export const importIncrementalVm = defer(async function importIncrementalVm(
|
|||||||
if (detectBase) {
|
if (detectBase) {
|
||||||
const remoteBaseVmUuid = vmRecord.other_config[TAG_BASE_DELTA]
|
const remoteBaseVmUuid = vmRecord.other_config[TAG_BASE_DELTA]
|
||||||
if (remoteBaseVmUuid) {
|
if (remoteBaseVmUuid) {
|
||||||
baseVm = find(xapi.objects.all, obj => (obj = obj.other_config) && obj[TAG_COPY_SRC] === remoteBaseVmUuid)
|
baseVm = find(
|
||||||
|
xapi.objects.all,
|
||||||
|
obj => (obj = obj.other_config) && obj[TAG_COPY_SRC] === remoteBaseVmUuid && obj[TAG_BACKUP_SR] === sr.$id
|
||||||
|
)
|
||||||
|
|
||||||
if (!baseVm) {
|
if (!baseVm) {
|
||||||
throw new Error(`could not find the base VM (copy of ${remoteBaseVmUuid})`)
|
throw new Error(`could not find the base VM (copy of ${remoteBaseVmUuid})`)
|
||||||
|
|||||||
@@ -27,6 +27,7 @@
|
|||||||
- [Pool] Fix IPv6 handling when adding hosts
|
- [Pool] Fix IPv6 handling when adding hosts
|
||||||
- [New SR] Send provided NFS version to XAPI when probing a share
|
- [New SR] Send provided NFS version to XAPI when probing a share
|
||||||
- [Backup/exports] Show more information on error ` stream has ended with not enough data (actual: xxx, expected: 512)` (PR [#6940](https://github.com/vatesfr/xen-orchestra/pull/6940))
|
- [Backup/exports] Show more information on error ` stream has ended with not enough data (actual: xxx, expected: 512)` (PR [#6940](https://github.com/vatesfr/xen-orchestra/pull/6940))
|
||||||
|
- [Backup] Fix incremental replication with multiple SRs (PR [#6811](https://github.com/vatesfr/xen-orchestra/pull/6811))
|
||||||
|
|
||||||
### Packages to release
|
### Packages to release
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user