Re: Improve read_local_xlog_page_guts by replacing polling with latch-based waiting

From: Xuneng Zhou <xunengzhou(at)gmail(dot)com>
To: Rui Zhao <zhaorui126(at)gmail(dot)com>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, pgsql-hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alexander Korotkov <aekorotkov(at)gmail(dot)com>, Heikki Linnakangas <hlinnaka(at)iki(dot)fi>
Subject: Re: Improve read_local_xlog_page_guts by replacing polling with latch-based waiting
Date: 2026-10-18 13:07:33
Message-ID: CABPTF7W0s_XHGkbsWdVaGs5sBefePXmG64i3RY0FsdU=b_1xwA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Here's the updated patch set.

0001 respects the duty of the page callback: supply the requested WAL
bytes from the appropriate history once they are safe to read. It
changes the way of waiting for the bytes to be ready, while preserving
the timeline and read-limit check.

0002 includes the local and upstream promotion tests for logical slot
creation and, plus a test that promotion interrupts slot
synchronization blocked waiting for replay and cleans up its temporary
slot.

These tests cover operations could be waiting for WAL when promotion
occurs. Paths that are less direct to exercise the changed wait are
not covered -- SQL get/peek and slot advancement generally read WAL
that is already available, two-phase state load reads an existing
prepare record. Repack/slot sync worker are omitted as well since they
share similar decoding setup with slot creation/synchronization.

--
Regards,
Xuneng Zhou
HighGo Software Co., Ltd.

Attachment Content-Type Size
v12-0001-Replace-polling-with-LSN-waits-in-read_local_xlo.patch application/octet-stream 3.9 KB
v12-0002-Test-logical-decoding-LSN-waits-across-promotion.patch application/octet-stream 8.5 KB

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2026-10-18 13:18:05 Re: [PATCH v1] Batch B-tree TIDs when building a bitmap
Previous Message Peter Geoghegan 2026-10-18 12:51:59 Re: index prefetching