Re: REPACK: warn about skipping foreign partitions - Mailing list pgsql-hackers

From Fujii Masao
Subject Re: REPACK: warn about skipping foreign partitions
Date
Msg-id CAHGQGwFBWRoaL9iZb-FFXoupdYPJzQt1F7FHuPwTYWSM32xz0w@mail.gmail.com
Whole thread
In response to Re: REPACK: warn about skipping foreign partitions  (Zsolt Parragi <zsolt.parragi@percona.com>)
Responses Re: REPACK: warn about skipping foreign partitions
List pgsql-hackers
On Sun, Oct 11, 2026 at 2:28 AM Zsolt Parragi <zsolt.parragi@percona.com> wrote:
> That was an oversight, it's fixed in v4.

Thanks for updating the patch!

+ if (rel_is_index)
+ inhoids = find_all_inheritors(relid, NoLock, NULL);

It's better to call list_free(inhoids) before replacing it with the index
OID list? The table OID list is no longer needed after the warning loop.

Especially when an index is specified, the patch adds another
find_all_inheritors() call and loop while holding AccessExclusiveLock on
the parent. Is this overhead unnoticeable and acceptable for tables
with many small partitions?

> The 'without locking' part seems good to me. We already have
> AccessExclusiveLock on the parent, and we never actually open the
> foreign partitions. And this is a preexisting repack design (checking
> permissions without locking first, and then checking again after
> locking, just before processing it)

Understood.

So a partition can be dropped concurrently while warnings are being
issued for foreign partitions, and get_rel_name(tableoid) can return NULL
before the warning is emitted. Is that correct? If so, as in
repack_is_permitted_for_relation(), we should check whether
get_rel_name(tableoid) returns NULL and skip the warning if it does?

Regards,

--
Fujii Masao



pgsql-hackers by date:

Previous
From: Muzzammil Sarwar
Date:
Subject: [PATCH] Fix leak when a plpgsql exception block catches an error from CALL
Next
From: Tom Lane
Date:
Subject: Re: Wrong results from an antijoin