On Thu, 12 Nov 2026 at 02:41, Greg Burd <[email protected]> wrote:
>
> Since the bug is pre-existing, the fix is patch 0001: it stands on its
> own against master, applies with or without the rework, and (the
> back-branch question aside)

We will have to back patch till the PG15 version. I could reproduce
the issue in all the supported branches and the
HotStandbyActiveInReplay changes at [1] fixes the issue.
One small improvement could be done to the patches,
hash_xlog_move_page_contents, hash_xlog_squeeze_page and
hash_xlog_delete all have the below same code, can we use a helper
static function for this:
/*
* The cleanup lock on the primary bucket page serializes replay
* against scans on a hot standby, which pin the page for their whole
* duration.  Scans can run only once hot standby accepts queries, so
* until then we need not read or lock the page.  Skipping the read
* also sidesteps a torn copy of the page whose repairing full-page
* image comes later in the WAL: that hazard exists only before
* consistency is reached, and queries are accepted only after that,
* so once HotStandbyActiveInReplay() is true any earlier image has
* already been replayed.
*/
if (HotStandbyActiveInReplay())
(void) XLogReadBufferForRedoExtended(record, 0, RBM_NORMAL, true, &bucketbuf)

@Gregory Burd Could you post the 0001 patches for the torn-page issue,
covering branches up to PG15? We can make the patch ready for commit.

[1] - 
https://www.postgresql.org/message-id/CALDaNm3ZudVo%2BNT6HKA%2BkPbmXmCuKv%2BZw95Do5G5%2BEUE9GGn%3Dg%40mail.gmail.com

Regards,
Vignesh


Reply via email to