mirror of
https://github.com/pgbackrest/pgbackrest.git
synced 2024-12-14 10:13:05 +02:00
4d84820021
Info files required three copies in memory to be loaded (the original string, an ini representation, and the final info object). Not only was this memory inefficient but the Ini object does sequential scans when searching for keys making large files very slow to load. This has not been an issue since archive.info and backup.info are very small, but it becomes a big deal when loading manifests with hundreds of thousands of files. Instead of holding copies of the data in memory, use a callback to deliver the ini data directly to the object when loading. Use a similar method for save to avoid having an intermediate copy. Save is a bit complex because sections/keys must be written in alpha order or older versions of pgBackRest will not calculate the correct checksum. Also move the load retry logic to helper functions rather than embedding it in the Info object. This allows for more flexibility in loading and ensures that stack traces will be available when developing unit tests. Reviewed by Cynthia Shang. |
||
---|---|---|
.. | ||
mock-all-001.log | ||
mock-all-002.log | ||
mock-archive-001.log | ||
mock-archive-002.log | ||
mock-archive-stop-001.log | ||
mock-archive-stop-002.log | ||
mock-expire-001.log | ||
mock-expire-002.log | ||
mock-stanza-001.log | ||
mock-stanza-002.log | ||
real-all-001.log | ||
real-all-002.log | ||
real-all-003.log | ||
real-all-004.log | ||
real-all-005.log | ||
real-all-006.log |