mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-14 10:13:05 +02:00
02eea555c7
In bundle mode pgBackRest skips files of zero size, that is, it does not queue them for copying. After splitting the files into bundles, pgBackRest launches one or more processes that directly perform the backup, namely, read the files and, if necessary, write them to the bundles. If during the time between the distribution of all files among bundles and the direct copying of a file to a bundle, this file of non-zero size was truncated to zero size (for example, when the table was truncated), then pgBackRest still unconditionally places such a zero-size file in the bundle, taking up space in it equal to the size of the headings, and additionally writes the original file size to the manifest. In debug build an assertion was added, that does not allow zero-size files to be written to bundles, which leads to an error. To solve the problem, this patch, when reading the next file, loads one buffer from the file to detect if it is zero-size. If so it marks the file as truncated and continues on to the next file. The advantages of the solution are that, firstly, the assert will not fire on debug builds, and secondly, we will not place zero-size files in bundles, which exactly corresponds to the specification. The patch adds the backupCopyResultTruncate value to the BackupCopyResult enumeration to use it to indicate the result when a non-zero size file is truncated to zero size during the backup process. |
||
---|---|---|
.. | ||
certificate | ||
code-count | ||
data | ||
lib/pgBackRestTest | ||
src | ||
.gitignore | ||
ci.pl | ||
container.yaml | ||
define.yaml | ||
Dockerfile | ||
test.pl | ||
uncrustify.cfg | ||
Vagrantfile |