RE: Hash index: stop registering pin-only bucket pages in WAL (remove REGBUF_NO_CHANGE)

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'vignesh C' <vignesh21(at)gmail(dot)com>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Greg Burd <greg(at)burd(dot)me>, Joao Rito <joaovictor(dot)rito(at)gmail(dot)com>, shihao zhong <zhong950419(at)gmail(dot)com>, Michael Paquier <michael(at)paquier(dot)xyz>, Jeff Davis <pgsql(at)j-davis(dot)com>, Alexander Lakhin <exclusion(at)gmail(dot)com>, "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: RE: Hash index: stop registering pin-only bucket pages in WAL (remove REGBUF_NO_CHANGE)
Date: 2026-11-18 13:11:32
Message-ID: OS7PR01MB183178173D126642189CE7B92F57A2@OS7PR01MB18317.jpnprd01.prod.outlook.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Thanks for updating the patch! I checked 0001 again and here is my comment.

```
if (xldata->is_prim_bucket_same_wrt)
{
/*
* If the primary bucket page is modified, it is registered as block
* 0 and read for redo. Otherwise, acquire its cleanup lock
* separately.
*/
if (XLogRecHasBlockRef(record, 0))
action = XLogReadBufferForRedoExtended(record, 0, RBM_NORMAL, true, &writebuf);
else
{
bucketbuf = hash_xlog_lock_primary_bucket(record, 1, SizeOfHashSqueezePage);
action = BLK_NOTFOUND;
}
}
else
{
bucketbuf = hash_xlog_lock_primary_bucket(record, 1, SizeOfHashSqueezePage);

if (xldata->ntups > 0 || xldata->is_prev_bucket_same_wrt)
action = XLogReadBufferForRedo(record, 0, &writebuf);
else
action = BLK_NOTFOUND;
}
```

While reading the code again, I came up with another idea to clean up the code:
how about making the code similar with the WAL generation side? Something like
attached. Or is it matter of taste?

For now I cannot find other comments.

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment Content-Type Size
nocfbot-0001-simplify-hash_xlog_squeeze_page.patch application/octet-stream 2.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Rafael Chacón 2026-11-18 13:20:36 Re: Table synchronization cannot resume after a subscriber crash
Previous Message Raja Sai pranav 2026-11-18 13:05:02 Re: BUG #19776: pg_combinebackup ignores the truncation_block_length of an intermediate incremental backup