Re: [BUG] [PATCH] pg_basebackup produces wrong incremental files after relation truncation in segmented tables

From: Oleg Tkachenko <oatkachenko(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Amul Sul <sulamul(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Stanislav Bashkyrtsev <stanislav(dot)bashkyrtsev(at)elsci(dot)io>
Subject: Re: [BUG] [PATCH] pg_basebackup produces wrong incremental files after relation truncation in segmented tables
Date: 2025-12-18 17:23:53
Message-ID: 08EA8874-0114-4E5C-A794-EB40C971EE7C@gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

Here is a refactored test.

Now, it creates data depending on the relation block size, so it works even if the segment size is not standard. I tested it locally with segment_size_blocks = 6, and it works correctly.

I would be happy to hear your comments or suggestions.

Regards,

Oleg


> On Dec 18, 2025, at 15:26, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
>
> On Thu, Dec 18, 2025 at 1:05 AM Amul Sul <sulamul(at)gmail(dot)com> wrote:
>> Test looks good to me, but I have three suggestions as follow:
>>
>> 1. To minimize repetition in insert: use fillfactor 10, which is the
>> minimal we can set for a table, so that we can minimize tuples per
>> page. Use a longer string and lower count in repeat(), which I believe
>> helps the test become a bit faster.
>
> I haven't checked how big a relation the test case creates, but it's
> worth keeping in mind that the CI tests run on one platform with the
> segment size set to six blocks. I think we should design the test case
> with that in mind i.e. don't worry about catching the bug when the
> segment size is 1GB, but make sure the test fails in CI without the
> bug fix. Let's not rely on fillfactor -- the cost here is the disk
> space and the time to write the blocks, not how many tuples they
> actually contain.
>
>> 2. I think we could add this test to the existing pg_combinebackup's
>> test file instead of creating a new file with a single-test. See the
>> attached version; it’s a bit smaller than your original patch, but
>> since I haven't copied all of your comments yet, I’ve marked it as
>> WIP.
>
> -1. This kind of thing tends to make the tests harder to understand.
>
> --
> Robert Haas
> EDB: http://www.enterprisedb.com

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jacob Champion 2025-12-18 17:27:22 Re: Custom oauth validator options
Previous Message Heikki Linnakangas 2025-12-18 17:20:38 Re: Buffer locking is special (hints, checksums, AIO writes)