Re: BUG #18644: ALTER PUBLICATION ... SET (publish_via_partition_root) wrong/undocumented behavior. - Mailing list pgsql-bugs

From Amit Kapila
Subject Re: BUG #18644: ALTER PUBLICATION ... SET (publish_via_partition_root) wrong/undocumented behavior.
Date
Msg-id CAA4eK1KUmObSjNkPWS3Tm_3Z_HpApKMZAvAimrrkm3k71wn+fQ@mail.gmail.com
Whole thread Raw
In response to Re: BUG #18644: ALTER PUBLICATION ... SET (publish_via_partition_root) wrong/undocumented behavior.  (Maxim Boguk <maxim.boguk@gmail.com>)
Responses Re: BUG #18644: ALTER PUBLICATION ... SET (publish_via_partition_root) wrong/undocumented behavior.
List pgsql-bugs
On Fri, Oct 4, 2024 at 7:38 PM Maxim Boguk <maxim.boguk@gmail.com> wrote:
>
> >>It would be useful if you can create a small test case to show the exact problem and what is your usecase for the
same?
> Usecase - after initial load of logical replica I decided that on the
> replica I better split future data into weekly partitions due huge
> size (instead of monthly partitions on the master/publisher)
> exactly the case for "alter publication set (publish_via_partition_root)".
>
> My main issues with this case - there is no way to fix this problem if
> it happened less than reloading whole logical replication from blank.
>

You can prevent the problem by avoiding writes to the partitioned
tables between the Alter Pub and Alter Sub steps. One idea could be
that in a parallel session on publisher lock the parent table in
Access Exclusive mode till the Alter Sub command (with
copy_data=false) is finished.

--
With Regards,
Amit Kapila.



pgsql-bugs by date:

Previous
From: Andrei Lepikhov
Date:
Subject: Re: Reference to - BUG #18349: ERROR: invalid DSA memory alloc request size 1811939328, CONTEXT: parallel worker
Next
From: Maxim Boguk
Date:
Subject: Re: BUG #18644: ALTER PUBLICATION ... SET (publish_via_partition_root) wrong/undocumented behavior.