| From: | Zhijie Hou <houzhijie22(at)gmail(dot)com> |
|---|---|
| To: | Raja Sai pranav <rajasaipranav0(at)gmail(dot)com> |
| Cc: | Boyu Yang <pgsql(at)mail-yby(dot)icu>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Robert Haas <robertmhaas(at)gmail(dot)com> |
| Subject: | Re: Incremental backup inconsistency after vacuum truncation + COPY regrowth |
| Date: | 2026-12-06 12:47:21 |
| Message-ID: | f3179661-1ab7-480f-b5c8-bdec58d58740@gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi,
On Sun, Dec 6, 2026 at 02:06 AM Raja Sai pranav wrote:
>
> On Wed, Dec 2, 2026 at 4:30 PM Zhijie Hou wrote:
> > Rather than backing up the entire affected segment, I am thinking
> > shall change the following comparison to '>' so that
> > *truncation_block_length is clamped to relative_limit, matching the
> > comment
>
> I reviewed v1 and tested it on master a069c99680 (macOS, meson,
> cassert). Master already has 4280abf884, which fixed the
> pg_combinebackup side for intermediate truncations. Boyu's case still
> fails there with a single incremental, so this is a separate bug in
> GetFileBackupMethod().
Thanks for reviewing and testing.
>
> About the last-block hunk: the new comment says it keeps the file
> length, but it does not say why that matters.
Agreed. I have updated the comment in v2 to note that a short segment
would hide any subsequent segments. Also, following an off-list
suggestion from zibuyu (whose reply appears to have been held up and did
not reach the list), v2 moves the logic that explicitly includes the
final block above the 90% full-backup check, so we evaluate that
threshold only once and avoid sorting block numbers when falling back to
a full file backup.
> - The RELSEG_SIZE cap from ecd275718be can no longer be reached
> (truncation_block_length now starts at size / BLCKSZ, which is already
> checked against RELSEG_SIZE at the top, and can only go down). It may
> be worth keeping it as an Assert.
Added a Assert as suggested.
Here is v2 patch which also extends the test to run two
COPY commands (up to 8 blocks) so that --with-segsize-blocks=6 exercises
the cross-segment case as well.
--
Best Regards,
Zhijie Hou
| Attachment | Content-Type | Size |
|---|---|---|
| v2-0001-Fix-stale-blocks-in-incremental-backups-after-rel.patch | text/plain | 7.8 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Chengpeng Yan | 2026-12-06 12:52:34 | Re: Tracking per-RelOptInfo uniqueness during planning |
| Previous Message | Tomas Vondra | 2026-12-06 11:48:53 | Re: extremely slow planner when DISTINCT clause holds more columns |