This fixes an issue when delta backup fails during backup with the following error:
File "/usr/lib/python3.11/site-packages/pghoard/basebackup/delta.py", line 386, in _read_delta_sizes
snapshot_file.stored_file_size = self.tracked_snapshot_files[snapshot_file.hexdigest].stored_file_size
~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^
KeyError: '69217a3079908094e11121d042354a7c1f55b6482ca1a51e1b250dfd1ed0eef9'
The reason for that is when the uploaded delta file gets truncated during upload, its stored file size is a defalt value of 0, in this case the code assumes that this file was uploaded before and size info needs to be taken from the dict of already uploaded files, which is wrong. Here we just skip override of this attribute for empty delta files.
This fixes an issue when delta backup fails during backup with the following error:
The reason for that is when the uploaded delta file gets truncated during upload, its stored file size is a defalt value of 0, in this case the code assumes that this file was uploaded before and size info needs to be taken from the dict of already uploaded files, which is wrong. Here we just skip override of this attribute for empty delta files.