postgres/src
Masahiko Sawada 4c08ecd161 Fix assertion when decrementing eager scanning success and failure counters.
Previously, we asserted that the eager scan's success and failure
counters were positive before decrementing them. However, this
assumption was incorrect, as it's possible that some blocks have
already been eagerly scanned by the time eager scanning is disabled.

This commit replaces the assertions with guards to handle this
scenario gracefully.

With this change, we continue to allow read-ahead operations by the
read stream that exceed the success and failure caps. While there is a
possibility that overruns will trigger eager scans of additional
pages, this does not pose a practical concern as the overruns will not
be substantial and remain within an acceptable range.

Reviewed-by: Melanie Plageman <melanieplageman@gmail.com>
Discussion: https://postgr.es/m/CAD21AoConf6tkVCv-=JhQJj56kYsDwo4jG5+WqgT+ukSkYomSQ@mail.gmail.com
2025-05-27 11:42:36 -07:00
..
backend Fix assertion when decrementing eager scanning success and failure counters. 2025-05-27 11:42:36 -07:00
bin pg_dump: Adjust reltuples from 0 to -1 for dumps of older versions. 2025-05-22 10:23:26 -05:00
common Use 'void *' for arbitrary buffers, 'uint8 *' for byte arrays 2025-05-08 22:01:25 +03:00
fe_utils Fix incorrect format placeholders 2025-04-25 16:49:30 +02:00
include Revert function to get memory context stats for processes 2025-05-23 15:44:54 +02:00
interfaces oauth: Correct missing comma in Requires.private 2025-05-23 13:05:38 -07:00
makefiles oauth: Move the builtin flow into a separate module 2025-05-01 09:14:30 -07:00
pl Translation updates 2025-05-05 12:04:49 +02:00
port Fix incorrect year in some copyright notices 2025-05-19 09:46:52 +09:00
template thread-safety: gmtime_r(), localtime_r() 2024-08-23 07:43:04 +02:00
test Fix race condition in subscription TAP test 021_twophase 2025-05-26 17:28:37 +09:00
timezone Update time zone data files to tzdata release 2025b. 2025-04-30 11:13:49 -04:00
tools Revert function to get memory context stats for processes 2025-05-23 15:44:54 +02:00
tutorial Doc: simplify the tutorial's window-function examples. 2025-01-21 14:43:21 -05:00
.gitignore
DEVELOPERS
Makefile Remove distprep 2023-11-06 15:18:04 +01:00
Makefile.global.in oauth: Move the builtin flow into a separate module 2025-05-01 09:14:30 -07:00
Makefile.shlib Remove AIX support 2024-02-28 15:17:23 +04:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00
nls-global.mk Remove distprep 2023-11-06 15:18:04 +01:00