Re: BUG #19890: pg_receivewal advances past a truncated LZ4 WAL segment
Thread notes
1 note#bug
hackorum-bot#bug
@global #bug
On Tue, Nov 25, 2026 at 6:01 AM Michael Paquier <michael@paquier.xyz> wrote:
The only way to see this failure would be a segment that is not
fsync-ed properly, leading to something cut earlier than it should.
pg_receivewal *without* --no-sync, taken in isolation, already ensures
that this will never happen.
Understood. A segment cut short like this needs either a run with --no-sync
or a segment copied in from another tool, so the extra check is defense in
depth.
So, I could see the argument of the extra check as a defense in depth
measure, at least. [...] I'd tend to think that a backpatch down to
v15 (where this code has been added) is an acceptable thing to do
here.
Agreed, v15 is where this code was added.
I don't buy that the suggested test is worth the cycles spent on.
Fine with me to drop the test. If it helps, I will send a v2 without it.
I have no opinion on content checksums for HEAD.
Regards,
Sai Pranav
On Thu, Nov 26, 2026 at 7:15 AM Raja Sai pranav <rajasaipranav0@gmail.com>
wrote:
Fine with me to drop the test. If it helps, I will send a v2 without it.
v2 attached drops the test and keeps only the check. The commit message
now calls it a defense in depth for segments from external sources.
It applies to master and to REL_15_STABLE through REL_19_STABLE (only
line offsets on 15). On REL_15 I built it with the patch and repeated the
case by hand: with the frame's end mark cut off, the patched
pg_receivewal warns and restarts at the cut segment (0/2000000), and the
unpatched one restarts at the next (0/3000000). On master the
pg_basebackup TAP suite passes.
Regards,
Sai Pranav