- Notifications
You must be signed in to change notification settings - Fork28
Commit1a990b2
committed
Have BufFileSize() ereport() on FileSize() failure.
Move the responsibility for checking for and reporting a failure fromthe only current BufFileSize() caller, logtape.c, to BufFileSize()itself. Code within buffile.c is generally responsible for interfacingwith fd.c to report irrecoverable failures. This seems like aconvention that's worth sticking to.Reorganizing things this way makes it easy to make the error messageraised in the event of BufFileSize() failure descriptive of theunderlying problem. We're now clear on the distinction betweentemporary file name and BufFile name, and can show errno, confident thatits value actually relates to the error being reported. In passing, anexisting, similar buffile.c ereport() + errcode_for_file_access() siteis changed to follow the same conventions.The API of the function BufFileSize() is changed by this commit, despitealready being in a stable release (Postgres 11). This seems acceptable,since the BufFileSize() ABI was changed by commitaa55183, whichhasn't made it into a point release yet. Besides, it's difficult toimagine a third party BufFileSize() caller not just raising an erroranyway, since BufFile state should be considered corrupt whenBufFileSize() fails.Per complaint from Tom Lane.Discussion:https://postgr.es/m/26974.1540826748@sss.pgh.pa.usBackpatch: 11-, where shared BufFiles were introduced.1 parentf2cbffc commit1a990b2
2 files changed
+11
-8
lines changedLines changed: 11 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
304 | 304 |
| |
305 | 305 |
| |
306 | 306 |
| |
307 |
| - | |
| 307 | + | |
| 308 | + | |
308 | 309 |
| |
309 | 310 |
| |
310 | 311 |
| |
| |||
763 | 764 |
| |
764 | 765 |
| |
765 | 766 |
| |
766 |
| - | |
| 767 | + | |
767 | 768 |
| |
768 | 769 |
| |
769 |
| - | |
| 770 | + | |
770 | 771 |
| |
771 | 772 |
| |
772 | 773 |
| |
773 | 774 |
| |
774 | 775 |
| |
775 | 776 |
| |
| 777 | + | |
| 778 | + | |
776 | 779 |
| |
777 | 780 |
| |
778 | 781 |
| |
779 |
| - | |
| 782 | + | |
| 783 | + | |
| 784 | + | |
| 785 | + | |
| 786 | + | |
780 | 787 |
| |
781 | 788 |
| |
782 | 789 |
| |
|
Lines changed: 0 additions & 4 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
433 | 433 |
| |
434 | 434 |
| |
435 | 435 |
| |
436 |
| - | |
437 |
| - | |
438 |
| - | |
439 |
| - | |
440 | 436 |
| |
441 | 437 |
| |
442 | 438 |
| |
|
0 commit comments
Comments
(0)