Re: Delta patch not working on incremental restores

Denis Corbin <[email protected]> Sun, 6 Aug 2023 18:44:34 +0200
Newsgroups gmane.comp.sysutils.backup.dar.support
Message-ID <[email protected]>
On 05/08/2023 20:26, Denis Corbin wrote:
> On 05/08/2023 16:40, Minh Van Le wrote:
>> Hello dar-support,
> 
> Hello Minh Van Le,
> 
>>
>> Delta patches do not appear to restore for incremental backups.
>>
[...]

Problem found and fixed. Version 2.7.12 will be able to read such 
wrongly built backup, you can get the release candidate 1 for this 
version on github (tag v2.7.12.RC1) or here:

https://dar.edrusb.org/dar.linux.free.fr/Interim_releases/


Fore more details of the root cause, find below an extract from the git 
commit:
---
since format 11.2 the patch base checksum evaluation has been moved 
earlier in the backup process of each file and this information has been 
moved from the cat_delta_signature to the cat_file class which is one of 
the first metadata wrote to backup. Having the patch base crc in 
cat_delta_signature, which is wrote to disk after the data/patch,
was breaking the restoration in sequential read mode, as before applying 
a patch (and reading the data/patch bits) the patch base crc (located 
after) was not yet available and validation that we are about to apply 
the patch to the correct file, failed.

However during this change of holding class and archive backup location, 
the base crc was not properly setup when the reference data was already 
a patch. Instead of using the CRC of the previously patched data (stored 
in the bakup of reference for validation after patching),
the value used was the CRC of the patch itself as also stored in the 
backup, leading dar to fail patching the file (even if it was in the 
expected data to apply the patch on)

to use of already existing backup in format 11.2, even if this fix does 
not change the archive format, we increment to version 11.3 and will add 
workaround code to bypass this check when format is 11.2
---

Cheers,
Denis
OpenPGP_signature (application/pgp-signature, 840 B) - not displayed