fix(vhd-lib/merge): delete merge state after cleanup

Related to https://xcp-ng.org/forum/post/51529

In case the clean-up fails, the merge will be retried in the future.
This commit is contained in:
Julien Fontanet 2022-07-28 17:59:37 +02:00
parent bb4504dd50
commit 9834632d59

View File

@ -203,11 +203,11 @@ module.exports.mergeVhd = limitConcurrency(2)(async function merge(
// creation
await parentVhd.writeFooter()
await cleanupVhds(parentHandler, parentPath, childPath, { logInfo, remove })
// should be a disposable
parentHandler.unlink(mergeStatePath).catch(warn)
await cleanupVhds(parentHandler, parentPath, childPath, { logInfo, remove })
return mergeState.mergedDataSize
})
})