Re: Deficient error handling in pg_dump and pg_basebackup
Michael Paquier <michael@paquier.xyz>
From: Michael Paquier <michael@paquier.xyz>
To: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org, Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Date: 2021-11-17T05:24:59Z
Lists: pgsql-hackers
On Tue, Nov 16, 2021 at 10:26:11PM -0500, Tom Lane wrote: > I feel like doing an immediate exit() for these errors and not other > ones is a pretty terrible idea, mainly because it doesn't account for > the question of what to do with a failure that prevents us from getting > to the fsync() call in the first place. So I'd like to see a better > design rather than more quick hacking. I confess I don't have a > clear idea of what "a better design" would look like. [ .. thinks .. ] We cannot really have something equivalent to data_sync_retry in the frontends. But I'd like to think that it would be fine for pg_basebackup to just exit() on this failure so as callers would be able to retry a base backup. pg_receivewal is more tricky though. An exit() would allow for flush retries of a previous WAL segment where things failed, but that stands when using --no-loop (still the code path triggered by this option would not be used). When not using --no-loop, it may be better to actually just retry streaming from the previous point so as the error should be reported from walmethods.c to the upper stack anyway. > However, that's largely orthogonal to any of the things my proposed > patches are trying to fix. If you want to review the patches without > considering the fsync-error-handling problem, that'd be great. I have looked at them upthread, FWIW: https://www.postgresql.org/message-id/YYtSj5vlWp5faVXz@paquier.xyz Your proposals still look rather sane to me, after a second look. -- Michael
Commits
-
Clean up error handling in pg_basebackup's walmethods.c.
- c8b5221b5767 13.6 landed
- a414eb850dd8 11.15 landed
- 8378dad4c579 12.10 landed
- 53c4a580e4ab 14.2 landed
- 248c3a937dd0 15.0 landed
- 13799bb93866 10.20 landed
-
Handle close() failures more robustly in pg_dump and pg_basebackup.
- bbda88c3383d 13.6 landed
- 6b413b41b45f 14.2 landed
- 3cac2c8caaef 15.0 landed
- 12bf118899eb 12.10 landed
-
Add support for LZ4 compression in pg_receivewal
- babbbb595d23 15.0 cited