forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit789a689
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 ifthe file was concurrently truncated to remove that block, then we'dreach 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 ifthis happens in a non-assert build, and it's pretty unlikely to happenin the first place because it requires a series of somewhat unlikelythings to happen in very quick succession. However, assertion failuresare 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.com1 parent33a3e38 commit789a689
1 file changed
+9
-8
lines changedLines changed: 9 additions & 8 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1567 | 1567 |
| |
1568 | 1568 |
| |
1569 | 1569 |
| |
1570 |
| - | |
1571 |
| - | |
1572 |
| - | |
1573 |
| - | |
1574 |
| - | |
1575 |
| - | |
1576 |
| - | |
1577 |
| - | |
1578 | 1570 |
| |
1579 | 1571 |
| |
1580 | 1572 |
| |
| |||
1677 | 1669 |
| |
1678 | 1670 |
| |
1679 | 1671 |
| |
| 1672 | + | |
| 1673 | + | |
| 1674 | + | |
| 1675 | + | |
| 1676 | + | |
| 1677 | + | |
| 1678 | + | |
| 1679 | + | |
| 1680 | + | |
1680 | 1681 |
| |
1681 | 1682 |
| |
1682 | 1683 |
| |
|
0 commit comments
Comments
(0)