Re: Crashes on a partition whose concurrent detach never finished

From: shveta malik <shveta(dot)malik(at)gmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Masahiko Sawada <sawada(dot)mshk(at)gmail(dot)com>, Nisha Moond <nisha(dot)moond412(at)gmail(dot)com>, Mihail Nikalayeu <mihailnikalayeu(at)gmail(dot)com>, Zsolt Parragi <zsolt(dot)parragi(at)percona(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Alvaro Herrera <alvherre(at)alvh(dot)no-ip(dot)org>, vignesh C <vignesh21(at)gmail(dot)com>, "ashutosh(dot)bapat(dot)oss(at)gmail(dot)com" <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, shveta malik <shvetamalik(at)gmail(dot)com>
Subject: Re: Crashes on a partition whose concurrent detach never finished
Date: 2026-11-11 08:51:29
Message-ID: CAJpy0uASvCvfOJ1Q8Mj2Md-+54_9B4YjVaFikEtT_EOb7Y2MHA@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Nov 11, 2026 at 12:49 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>
> On Wed, Nov 11, 2026 at 11:00 AM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
> >
> > On Wed, Nov 11, 2026 at 10:51 AM shveta malik <shveta(dot)malik(at)gmail(dot)com> wrote:
> > >
> > > > Sorry for not being clear. I meant the pgoutput crash.
> > >
> > > Yes, I reproduced the crash on PG 19 using the attached test. I
> > > verified that it works on PG18.
> > >
> > > > IIUC while this is an existing issue, commit fd366065e06 made it
> > > > worse. Before the commit, the llast_oid() call on the result of
> > > > get_partition_ancestors() in get_rel_sync_entry() was reached only
> > > > when publish_via_partition_root = true, but now it's reached
> > > > regardless of publish_via_partition_root for FOR ALL TABLES
> > > > publications. So decoding a change to a detach-pending partition
> > > > crashes the walsender even with the default publish_via_partition_root
> > > > = false. In other words, that case works with v18 but no longer with
> > > > v19. So I think we should fix it in v19.
> >
> > I have attached a potential fix for Pg19. It is similar to the fix in
> > 'RelationBuildPublicationDesc'. I have run a few related test-suits on
> > this; I have yet to run 'make check world'.
> >
>
> I think this is mostly the same fix as v2-0001* in [1].

yes, it looks the same; we can take that patch.

> But the points
> to consider are the fix is for both except and non-except cases, shall
> we fix both if so, non-except should be ideally committed till PG-14.
> Then the next question to consider is whether to fix the invalidation
> problem you reported in [2]. Without the invalidation, the crash will
> be fixed but probably the answer whether to replicate the partition
> changes could be incorrect (this will be true for both EXCEPT and
> non-EXCEPT cases).
>
> I feel in any case the invalidation problem is not related to PG-19
> code change and requires more discussion. So, we should leave that and
> discuss whether to fix both EXCEPT and non-EXCEPT cases?

+1

For non-EXCEPT, I also think that fix will be needed till PG15. Not
sure about PG14, as it reaches end of life on 12 November 2026, which
is tomorrow as per [1].

[1]: https://www.postgresql.org/message-id/flat/026ae0e2-c107-4d1e-bb2f-48130a6ca883%40postgresql.org

>
> [1]: https://www.postgresql.org/message-id/CADzfLwU97r3QC5oZDeVcWvcvXhNy9VnoFNDVHw%2BERg_DEG4%3DFQ%40mail.gmail.com
> [2]: https://www.postgresql.org/message-id/CAJpy0uA6womAP7fkmT%3DsSfKG_0CfKUSb7HhP_J9mw071MXc39w%40mail.gmail.com
>
> --
> With Regards,
> Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Fujii Masao 2026-11-11 08:52:09 Re: Fix for consume_xids advancing XIDs incorrectly
Previous Message Daniel Gustafsson 2026-11-11 08:32:16 Re: [PATCH] RFC: new_oid_hook, to let an extension propose catalog OIDs