pg.ddx.io pgsql-committers@postgresql.org mailing list archivehelp / color / mirror / Atom feed
pgsql: In basebackup.c, refactor to create verify_page_checksum. 2+ messages / 1 participants [nested] [flat]
* pgsql: In basebackup.c, refactor to create verify_page_checksum. @ 2023-10-03 14:47 Robert Haas <rhaas@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Robert Haas @ 2023-10-03 14:47 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org In basebackup.c, refactor to create verify_page_checksum. If checksum verification fails for a particular page, we reread the page and try one more time. The code that does this somewhat complex and difficult to follow. Move some of the logic into a new function and rearrange the code a bit to try to make it clearer. This way, we don't need the block_retry Boolean, a couple of other variables move from sendFile() into the new function, and some code is now less deeply indented. Patch by me, reviewed by David Steele. Discussion: http://postgr.es/m/CA+TgmoYt5jXH4U6cu1dm9Oe2FTn1aae6hBNhZzJJjyjbE_zYig@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/053183138a7a11408d6faa9281001ff7b1ffee2e Modified Files -------------- src/backend/backup/basebackup.c | 188 ++++++++++++++++++++++------------------ 1 file changed, 104 insertions(+), 84 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
* pgsql: In basebackup.c, refactor to create read_file_data_into_buffer. @ 2023-10-03 15:01 Robert Haas <rhaas@postgresql.org> 0 siblings, 0 replies; 2+ messages in thread From: Robert Haas @ 2023-10-03 15:01 UTC (permalink / raw) To: pgsql-committers@lists.postgresql.org In basebackup.c, refactor to create read_file_data_into_buffer. This further reduces the length and complexity of sendFile(), hopefully make it easier to understand and modify. In addition to moving some logic into a new function, I took this opportunity to make a few slight adjustments to sendFile() itself, including renaming the 'len' variable to 'bytes_done', since we use it to represent the number of bytes we've already handled so far, not the total length of the file. Patch by me, reviewed by David Steele. Discussion: http://postgr.es/m/CA+TgmoYt5jXH4U6cu1dm9Oe2FTn1aae6hBNhZzJJjyjbE_zYig@mail.gmail.com Branch ------ master Details ------- https://git.postgresql.org/pg/commitdiff/c2ba3fdea5938dff96ca32ed7a4a83c8ff5f188d Modified Files -------------- src/backend/backup/basebackup.c | 231 +++++++++++++++++++++++----------------- 1 file changed, 133 insertions(+), 98 deletions(-) ^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2023-10-03 15:01 UTC | newest] Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-10-03 14:47 pgsql: In basebackup.c, refactor to create verify_page_checksum. Robert Haas <rhaas@postgresql.org> 2023-10-03 15:01 pgsql: In basebackup.c, refactor to create read_file_data_into_buffer. Robert Haas <rhaas@postgresql.org>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox