1
0
mirror of https://github.com/pgbackrest/pgbackrest.git synced 2024-12-14 10:13:05 +02:00
pgbackrest/test/expect
David Steele 4d84820021 Improve performance of info file load/save.
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.
2019-09-06 13:48:28 -04:00
..
mock-all-001.log Improve performance of info file load/save. 2019-09-06 13:48:28 -04:00
mock-all-002.log Improve performance of info file load/save. 2019-09-06 13:48:28 -04:00
mock-archive-001.log Improve performance of info file load/save. 2019-09-06 13:48:28 -04:00
mock-archive-002.log Improve performance of info file load/save. 2019-09-06 13:48:28 -04:00
mock-archive-stop-001.log Improve performance of info file load/save. 2019-09-06 13:48:28 -04:00
mock-archive-stop-002.log Improve performance of info file load/save. 2019-09-06 13:48:28 -04:00
mock-expire-001.log Improve performance of info file load/save. 2019-09-06 13:48:28 -04:00
mock-expire-002.log Improve performance of info file load/save. 2019-09-06 13:48:28 -04:00
mock-stanza-001.log Improve performance of info file load/save. 2019-09-06 13:48:28 -04:00
mock-stanza-002.log Improve performance of info file load/save. 2019-09-06 13:48:28 -04:00
real-all-001.log The stanza-create/update/delete commands are implemented entirely in C. 2019-08-21 16:26:28 -04:00
real-all-002.log Reduce log level for all expect tests to detail. 2019-05-22 18:23:44 -04:00
real-all-003.log Reduce log level for all expect tests to detail. 2019-05-22 18:23:44 -04:00
real-all-004.log The stanza-create/update/delete commands are implemented entirely in C. 2019-08-21 16:26:28 -04:00
real-all-005.log Reduce log level for all expect tests to detail. 2019-05-22 18:23:44 -04:00
real-all-006.log The stanza-create/update/delete commands are implemented entirely in C. 2019-08-21 16:26:28 -04:00