pgsql: Make max_pinned_buffers be > 0, don't just Assert that it is. - Mailing list pgsql-committers

From Tom Lane
Subject pgsql: Make max_pinned_buffers be > 0, don't just Assert that it is.
Date
Msg-id E1wk3L6-000KFf-0r@gemulon.postgresql.org
Whole thread
List pgsql-committers
Make max_pinned_buffers be > 0, don't just Assert that it is.

It was possible to trigger read_stream_begin_relation's
assertion that it calculated nonzero max_pinned_buffers,
in scenarios with unreasonably small numbers of buffers.
There seems to be no visible problem in non-Assert builds.

The bug occurs only in v17 (the first branch containing
this logic), because commit 92fc6856c replaced that Assert
with a runtime clamp.  I won't risk back-patching that entire
commit, but let's copy just this minimal fix.

Bug: #19551
Reported-by: Roman Zharkov <r.zharkov@postgrespro.ru>
Author: Thomas Munro <thomas.munro@gmail.com>
Reviewed-by: Tom Lane <tgl@sss.pgh.pa.us>
Discussion: https://postgr.es/m/19551-d4a55b8fe81db4f2@postgresql.org
Backpatch-through: 17 only

Branch
------
REL_17_STABLE

Details
-------
https://git.postgresql.org/pg/commitdiff/3d3b8872814362e061802703bb5d92fe050fc602

Modified Files
--------------
src/backend/storage/aio/read_stream.c | 7 ++++++-
1 file changed, 6 insertions(+), 1 deletion(-)


pgsql-committers by date:

Previous
From: Fujii Masao
Date:
Subject: pgsql: Fix argument names in pg_clear_attribute_stats() errors
Next
From: Robert Haas
Date:
Subject: pgsql: Add additional sanity checks when reading a blkreftable.