Re: REPACK: warn about skipping foreign partitions

From: Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>
To: surya poondla <suryapoondla4(at)gmail(dot)com>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, shihao zhong <zhong950419(at)gmail(dot)com>, Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org, Antonin Houska <ah(at)cybertec(dot)at>, solai v <solai(dot)cdac(at)gmail(dot)com>
Subject: Re: REPACK: warn about skipping foreign partitions
Date: 2026-10-14 22:33:26
Message-ID: CAN4CZFPQpdO=hwQCjLuH8bMgDU_uppgb8ska1Qk19vX6U-eeQA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

> This is the same race as in your find_all_inheritors(NoLock) thread [1]. As
> I read v2 there, the missing_ok handling is internal to
> find_all_inheritors(), so it wouldn't cover this new call. Maybe expose the
> missing_ok variant and use it here, or go back to the v4 shape
> (find_all_inheritors() on the table), since you saw no measurable
> difference between them and v4 would get that fix for free.

You are right, I realized that while I was working on it, but it
didn't seem like a big issue with find_all_inheritors behaving the
same way already, and then I forgot about it when starting the other
thread.

Since (1) I think it's better if this thread doesn't depend on the
outcome of the other and (2) I think the v4 version was overall
simpler, I'm attaching the version of that with the original concerns
fixed as v6. I thought a bit more about the performance question, but
since we are already at the partitioned table code, it had to do the
same iterations anyway, so it didn't make the indexed case better,
even in theory.

v6 has exactly the same issue as v5 without the fix from the other
thread, but if that lands, it will handle both locations.

I also did verify that there's no easy way to make the
find_all_inheritors for repack locking and avoiding deadlocks, at
least none I found.

Attachment Content-Type Size
v6-0001-Warn-when-REPACK-or-CLUSTER-skips-a-foreign-table.patch application/octet-stream 8.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Zsolt Parragi 2026-10-14 22:47:46 Re: find_all_inheritors() with NoLock fails on concurrently dropped sub-partitions
Previous Message surya poondla 2026-10-14 21:53:43 Re: find_all_inheritors() with NoLock fails on concurrently dropped sub-partitions