Re: BUG #19776: pg_combinebackup ignores the truncation_block_length of an intermediate incremental backup

From: Rajesh Kumar Thandapani <rajeshkumarth(at)google(dot)com>
To: Raja Sai pranav <rajasaipranav0(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Cc: Ke <kehan5800(at)gmail(dot)com>, pgsql-bugs(at)lists(dot)postgresql(dot)org, Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Robert Haas <robertmhaas(at)gmail(dot)com>, Dilip Kumar <dilipkumarb(at)google(dot)com>
Subject: Re: BUG #19776: pg_combinebackup ignores the truncation_block_length of an intermediate incremental backup
Date: 2026-11-04 14:51:19
Message-ID: CAJoZ81uw=O112PP4oKWaJzWwx9qgNYB2LWisUKLs14y9bvHE_Q@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-bugs pgsql-hackers

Hi Sai Pranav,

> - Nothing tests the full_copy_possible = false in the new block: with that
> line removed, the whole suite still passes. I think the line is needed,
> though: without it, a chain where no block comes from an incremental file
> and the full file happens to be as long as the latest
> truncation_block_length would be copied whole, including the blocks the
> intermediate backup had truncated away. I couldn't build that case through
> the server (regrowing the relation writes blocks that end up in the later
> incremental file), so a test may not be practical. A short comment saying
> why the line is there would help.
>
> - Small wording nit in the new comment: blocks at or beyond an incremental
> file's truncation_block_length are not necessarily blocks that "did not
> exist at the time of this backup"; they may have been truncated away at
> some point during that backup's WAL range. Something like "Blocks at or
> beyond this file's truncation_block_length were truncated away at some
> point before this backup, so their contents in any earlier backup are
> stale" might be clearer.

Thanks for reviewing and testing the patch! Both points make sense.
I updated the comment in v3 to clarify the truncation wording and
explain why we also clear full_copy_possible there.

Regards,
Rajesh

Attachment Content-Type Size
v3-0001-Fix-pg_combinebackup-with-truncated-intermediate-.patch application/x-patch 6.2 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Daniel Gustafsson 2026-11-04 15:27:17 Re: set_config(‘search_path’) does not truncate names over 63 bytes, unlike SET
Previous Message shihao zhong 2026-11-04 14:47:20 Re: set_config(‘search_path’) does not truncate names over 63 bytes, unlike SET

Browse pgsql-hackers by date

  From Date Subject
Next Message Phil Alger 2026-11-04 14:57:07 Re: Print latency percentiles in pgbench
Previous Message Nikolay Samokhvalov 2026-11-04 14:51:18 Re: Python/pytest test framework take two