Use ExtendBufferedRelTo() in XLogReadBufferExtended()
authorAndres Freund <andres@anarazel.de>
Fri, 7 Apr 2023 00:45:42 +0000 (17:45 -0700)
committerAndres Freund <andres@anarazel.de>
Fri, 7 Apr 2023 00:56:17 +0000 (17:56 -0700)
commit26158b852d3adf6936008ce09c9ff2b947c8df40
tree498e3e54b276023daca6f79543214b35b5542ba8
parentae78cae3be627213528f2e08eb976d6906d754de
Use ExtendBufferedRelTo() in XLogReadBufferExtended()

Instead of extending the relation block-by-block, use ExtendBufferedRelTo(),
introduced in 31966b151e6. This is faster and simpler.

This also somewhat reduces the danger that disconnected segments pose (which
can be "discovered" once the previous segment reaches SEGSIZE), as
ExtendBufferedRelTo() won't extend past the block it has been asked. However,
the risk of the content of such a disconnected segment being invalid
remains.

Discussion: https://postgr.es/m/20221029025420.eplyow6k7tgu6he3@awork3.anarazel.de
Discussion: https://postgr.es/m/20230223010147.32oir7sb66slqnjk@awork3.anarazel.de
src/backend/access/transam/xlogutils.c