1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2025-11-06 08:49:29 +02:00

Do not store references for zero-length files when bundling.

This appears to have been an oversight in 34d6495. Storing the reference is not really correct since the file is not stored in a prior backup. It also uses more space.

There is no real harm in storing the reference, since it is always ignored on restore, but the code is simpler if the zero-length files can be dealt with during the manifest and don't need additional handling later on. This is also an important part of some upcoming optimizations.
This commit is contained in:
David Steele
2022-10-04 13:22:31 -10:00
committed by GitHub
parent f0acc195c0
commit f981fb45d9
4 changed files with 26 additions and 6 deletions

View File

@@ -1943,6 +1943,13 @@ sub restoreCompare
foreach my $strName ($oActualManifest->keys(MANIFEST_SECTION_TARGET_FILE))
{
# When bundling zero-length files will not have a reference
if ($oExpectedManifestRef->{&MANIFEST_SECTION_BACKUP}{'backup-bundle'} &&
$oExpectedManifestRef->{&MANIFEST_SECTION_TARGET_FILE}{$strName}{&MANIFEST_SUBKEY_SIZE} == 0)
{
$oActualManifest->remove(MANIFEST_SECTION_TARGET_FILE, $strName, MANIFEST_SUBKEY_REFERENCE);
}
# If synthetic match checksum errors since they can't be verified here
if ($self->synthetic)
{