Do not fail WAL buffers read after on-disk xlog removal

Started by Kirill Reshkeabout 10 hours ago2 messageshackers
Beta feature

Hackorum builds and tests every patch posted to the lists, not only commitfest submissions. This is Hackorum's own CI rather than the PostgreSQL project's, and it is still under testing - please report anything that looks wrong.

appliestests failedCI history

You can run a PostgreSQL built from this patch straight from Docker, with no checkout and no build:

docker run --rm -p 5432:5432 ghcr.io/hackorum-dev/postgres-patch:t254371
psql -h localhost -U postgres

Built from patchset v2 (message #2), October 24, 2026 at 05:44 PM.

Every patchset is also pushed to a branch of our PostgreSQL fork, so you can check out the same tree CI built. Without a PostgreSQL checkout:

git clone --branch t254371_2 https://github.com/hackorum-dev/postgres.git

In a checkout you already have, add the fork once:

git remote add hackorum https://github.com/hackorum-dev/postgres.git

then, for this patchset and every later one:

git fetch hackorum t254371_2 && git checkout t254371_2

Patchset v2 (message #2) is on t254371_2

Jump to latest
#1Kirill Reshke
reshkekirill@gmail.com

Hi,

XLogSendPhysical checks for on-disk xlog removal even when the entire requested
range was copied from WAL buffers. So this rejects data already available in the
output buffer and terminates streaming unnecessarily.

Attached checks for xlog files presence only in WAL buffers read failed.

--
Best regards,
Kirill Reshke

Attachments:

t254371_1
0001-Do-not-reject-WAL-buffer-reads-after-segment-recycling.patchapplication/octet-stream; name=0001-Do-not-reject-WAL-buffer-reads-after-segment-recycling.patchDownload+10-4
#2Kirill Reshke
reshkekirill@gmail.com
In reply to: Kirill Reshke (#1)
Re: Do not fail WAL buffers read after on-disk xlog removal

On Sat, 24 Oct 2026 at 22:19, Kirill Reshke <reshkekirill@gmail.com> wrote:

Hi,

XLogSendPhysical checks for on-disk xlog removal even when the entire requested
range was copied from WAL buffers. So this rejects data already available in the
output buffer and terminates streaming unnecessarily.

Attached checks for xlog files presence only in WAL buffers read failed.

--
Best regards,
Kirill Reshke

Also PFA TAP test demonstrating an issue. Not intended to commit
thought. Just show-caseing a bug

--
Best regards,
Kirill Reshke

Attachments:

t254371_2
0002-Test-WAL-buffer-reads-after-segment-recycling.patchapplication/octet-stream; name=0002-Test-WAL-buffer-reads-after-segment-recycling.patchDownload+114-1