| From: | vignesh C <vignesh21(at)gmail(dot)com> |
|---|---|
| To: | shihao zhong <zhong950419(at)gmail(dot)com> |
| Cc: | pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Robert Haas <robertmhaas(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> |
| Subject: | Re: Hash index corruption and CLOG lookup errors from checkpoint races |
| Date: | 2026-11-04 08:28:15 |
| Message-ID: | CALDaNm06c=nN_uP+7ONBrcDJmwSLsWwo9VOq-gp7jx7abV7zpg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Tue, 3 Nov 2026 at 09:38, shihao zhong <zhong950419(at)gmail(dot)com> wrote:
>
> Hi Vignesh,
>
> Thanks for catching this, and for the test. It fails on v1 as you
> describe.
>
> v2 drops the flag. _hash_alloc_buckets() now extends the file before
> writing the WAL record, so a checkpoint either replays the record or
> syncs the new block.
>
> ^^^^ is aligned with current heap extend behavior. Another way is to
> use PG_TRY and FINALLY to reset the flag. I prefer to use
> same mechanism because it is easy to understand in the future.
Thanks for providing the updated version, the patch does not apply to
back branches as back branches use PageSetChecksumInplace instead of
PageSetChecksum. We will need a separate patch for the back branch:
git am v2-0003-Extend-hash-index-before-WAL-logging-new-bucket-p.patch
Applying: Extend hash index before WAL-logging new bucket pages
error: patch failed: src/backend/access/hash/hashpage.c:1032
error: src/backend/access/hash/hashpage.c: patch does not apply
Regards,
Vignesh
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Bertrand Drouvot | 2026-11-04 08:37:48 | Re: Fix ReadStream handling when heap rescan strategy changes |
| Previous Message | Nazir Bilal Yavuz | 2026-11-04 08:28:02 | ci: Follow-up CI patches |