postgresql/src/backend/access
Thomas Munro acf1dd4234 Don't retry restore_command while reading ahead.
Suppress further attempts to read ahead in the WAL if we run out of
data, until the records already decoded have been replayed.  This
restores the traditional behavior for continuous archive recovery, which
is to retry the failing restore_command only every 5 seconds.  With the
coding in 5dc0418f, we would start retrying every time through the
recovery loop when our WAL decoding window hit the end of the current
segment and we tried to look ahead into a not-yet-available next file.
That was very slow.

Also change the no_readahead_until mechanism to use <= rather than <,
which seems more useful.  Otherwise we'd either get one extra unwanted
retry of restore_command, or we'd need to add 1 to an LSN.

No change in behavior for regular streaming.  That was already limited
by the flushedUpto variable, which won't be updated until we replay what
we have already.

Reported by Andres Freund while analyzing the failure of a TAP test on
build farm animal skink (investigation ongoing but probably due to
otherwise unrelated timing bugs triggered by this slowness magnified by
valgrind).

Discussion: https://postgr.es/m/20220409005910.alw46xqmmgny2sgr%40alap3.anarazel.de
2022-04-17 10:50:19 +12:00
..
brin Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
common Remove error message hints mentioning configure options 2022-04-08 07:41:55 +02:00
gin Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
gist Adjust tuplesort API to have bitwise option flags 2022-04-04 22:24:59 +12:00
hash Adjust tuplesort API to have bitwise option flags 2022-04-04 22:24:59 +12:00
heap Fix multi-table VACUUM VERBOSE accounting. 2022-04-15 15:48:39 -07:00
index Update copyright for 2022 2022-01-07 19:04:57 -05:00
nbtree Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
rmgrdesc Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
spgist Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
table Remove extraneous blank lines before block-closing braces 2022-04-13 19:16:02 +02:00
tablesample Update copyright for 2022 2022-01-07 19:04:57 -05:00
transam Don't retry restore_command while reading ahead. 2022-04-17 10:50:19 +12:00
Makefile Introduce access/{table.h, relation.h}, for generic functions from heapam.h. 2019-01-21 10:51:36 -08:00