You've already forked pgbackrest
mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2025-06-18 23:57:33 +02:00
Move info file checksum to the end of the file.
Putting the checksum at the beginning of the file made it impossible to stream the file out when saving. The entire file had to be held in memory while it was checksummed so the checksum could be written at the beginning. Instead place the checksum at the end. This does not break the existing Perl or C code since the read is not order dependent. There are no plans to improve the Perl code to take advantage of this change, but it will make the C implementation more efficient. Reviewed by Cynthia Shang.
This commit is contained in:
@ -34,12 +34,13 @@ sub iniHeader
|
||||
my $strChecksum = shift;
|
||||
|
||||
return
|
||||
"[backrest]" .
|
||||
"\nbackrest-checksum=\"" .
|
||||
(defined($strChecksum) ? $strChecksum : $oIni->get(INI_SECTION_BACKREST, INI_KEY_CHECKSUM)) . "\"" .
|
||||
"\nbackrest-format=" . (defined($iFormat) ? $iFormat : $oIni->get(INI_SECTION_BACKREST, INI_KEY_FORMAT)) .
|
||||
"\nbackrest-version=\"" . (defined($iVersion) ? $iVersion : $oIni->get(INI_SECTION_BACKREST, INI_KEY_VERSION)) . "\"" .
|
||||
"\n";
|
||||
"[backrest]\n" .
|
||||
"backrest-format=" . (defined($iFormat) ? $iFormat : $oIni->get(INI_SECTION_BACKREST, INI_KEY_FORMAT)) . "\n" .
|
||||
"backrest-version=\"" . (defined($iVersion) ? $iVersion : $oIni->get(INI_SECTION_BACKREST, INI_KEY_VERSION)) . "\"\n" .
|
||||
"\n" .
|
||||
"[backrest]\n" .
|
||||
"backrest-checksum=\"" .
|
||||
(defined($strChecksum) ? $strChecksum : $oIni->get(INI_SECTION_BACKREST, INI_KEY_CHECKSUM)) . "\"\n";
|
||||
}
|
||||
|
||||
####################################################################################################################################
|
||||
|
Reference in New Issue
Block a user