pgsql: Add nbtree README note on index-only scans in recovery.

Started by Peter Geogheganabout 2 months ago2 messagescommitters
Jump to latest

Add nbtree README note on index-only scans in recovery.

The nbtree README has long claimed that "the interlocking required to
avoid returning incorrect results from non-MVCC scans is not required on
standby nodes". A recent test case proved that the underlying reasoning
was faulty.

There are significant practical challenges around fixing this bug, and
no user has complained about it so far. The old "pin scan" mechanism
prevented the problem but performed very poorly. Since there seems to
be no appetite for resurrecting that mechanism, and since an acceptable
fix hasn't been forthcoming, make a note of the issue for later.

Discussion: /messages/by-id/CAH2-Wzkro678xEDOrsxrq-YDVP4w7nXybhVJV2MxrzTj-5OU4w@mail.gmail.com

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/9e7d152488f197e96f171f0714459c227c3f7693

Modified Files
--------------
src/backend/access/nbtree/README | 5 +++--
1 file changed, 3 insertions(+), 2 deletions(-)

#2Matthias van de Meent
boekewurm+postgres@gmail.com
In reply to: Peter Geoghegan (#1)
Re: pgsql: Add nbtree README note on index-only scans in recovery.

Hi Peter,

On Mon, 12 Oct 2026 at 09:53, Peter Geoghegan <pg@bowt.ie> wrote:

Add nbtree README note on index-only scans in recovery.

The nbtree README has long claimed that "the interlocking required to
avoid returning incorrect results from non-MVCC scans is not required on
standby nodes". A recent test case proved that the underlying reasoning
was faulty.

There are significant practical challenges around fixing this bug, and
no user has complained about it so far. The old "pin scan" mechanism
prevented the problem but performed very poorly. Since there seems to
be no appetite for resurrecting that mechanism, and since an acceptable
fix hasn't been forthcoming, make a note of the issue for later.

Could you elaborate what your acceptance criteria for a fix are? Your
one and final reply mail of 9 July [0]/messages/by-id/CAH2-Wzm--Yd-wuCURZnunVf_N9awb60pTLrv1La006Yf5zaAhw@mail.gmail.com in the discussion thread
included you mentioning that the fix I produced on 22 June [1]/messages/by-id/CAEze2WighSz7jbnw4L0KgQEBg_4+HJhDKdYwQTgeyDTXHwFvfQ@mail.gmail.com or its
approach was not "appealing", but it said nothing about its
acceptability, its lack thereof, nor did it contain any comments on
its merits.

Is ensuring correctness now playing second fiddle to unqualified
appeal to some committers? If not, could you elaborate why the patch
is not considered an acceptable fix, and what qualities a fix needs to
have be considered acceptable?

Kind regards,

Matthias van de Meent

[0]: /messages/by-id/CAH2-Wzm--Yd-wuCURZnunVf_N9awb60pTLrv1La006Yf5zaAhw@mail.gmail.com
[1]: /messages/by-id/CAEze2WighSz7jbnw4L0KgQEBg_4+HJhDKdYwQTgeyDTXHwFvfQ@mail.gmail.com