From ccdf02bfdcca1807d9fe6bd1e39b0b185f81e5e6 Mon Sep 17 00:00:00 2001
From: alterego665 <824662526@qq.com>
Date: Thu, 28 Aug 2025 15:40:48 +0800
Subject: [PATCH v4 0/2] Improve read_local_xlog_page_guts by replacing polling with latch-based waiting

This patch depends on:
  [PATCH v11] Implement WAIT FOR command
  https://www.postgresql.org/message-id/flat/CAPpHfdsjtZLVzxjGT8rJHCYbM0D5dwkO%2BBBjcirozJ6nYbOW8Q%40mail.gmail.com

Summary:
--------
This patch replaces the polling loop in read_local_xlog_page_guts()
with latch-based infrastructure, building on the WAIT FOR command
introduced by Kartyshov Ivan and Alexander Korotkov in the above patch.
The polling loop was inefficient during long waits; this version
integrates latches for more efficient wakeups.

Application:
------------
To apply:
  1. First apply v11-0001-Implement-WAIT-FOR-command.patch
  2. Then apply v4-0002-Improve-read_local_xlog_page_guts-by-replacing-po.patch

Thanks,
Xuneng
