aboutsummaryrefslogtreecommitdiff
path: root/src/backend/executor/nodeModifyTable.c
diff options
context:
space:
mode:
authorRobert Haas <rhaas@postgresql.org>2023-02-02 12:04:16 -0500
committerRobert Haas <rhaas@postgresql.org>2023-03-06 10:20:17 -0500
commit349803b18fee2476c7c9c84039d04c900ce8d499 (patch)
tree8aaaa75ec9e21152c5bc205a96e367a87811a445 /src/backend/executor/nodeModifyTable.c
parent055990904a179416453e024ae0be8791ba70a235 (diff)
downloadpostgresql-349803b18fee2476c7c9c84039d04c900ce8d499.tar.gz
postgresql-349803b18fee2476c7c9c84039d04c900ce8d499.zip
In basebackup.c, perform end-of-file test after checksum validation.
We read blocks of data from files that we're backing up in chunks, some multiple of BLCKSZ for each read. If checksum verification fails, we then try rereading just the one block for which validation failed. If that block happened to be the first block of the chunk, and if the file was concurrently truncated to remove that block, then we'd reach a call to bbsink_archive_contents() with a buffer length of 0. That causes an assertion failure. As far as I can see, there are no particularly bad consequences if this happens in a non-assert build, and it's pretty unlikely to happen in the first place because it requires a series of somewhat unlikely things to happen in very quick succession. However, assertion failures are bad, so rearrange the code to avoid that possibility. Patch by me, reviewed by Michael Paquier. Discussion: http://postgr.es/m/CA+TgmoZ_fFAoU6mrHt9QBs+dcYhN6yXenGTTMRebZNhtwPwHyg@mail.gmail.com
Diffstat (limited to 'src/backend/executor/nodeModifyTable.c')
0 files changed, 0 insertions, 0 deletions