RE: BUG #18644: ALTER PUBLICATION ... SET (publish_via_partition_root) wrong/undocumented behavior.

From: "Hayato Kuroda (Fujitsu)" <kuroda(dot)hayato(at)fujitsu(dot)com>
To: 'Amit Kapila' <amit(dot)kapila16(at)gmail(dot)com>
Cc: vignesh C <vignesh21(at)gmail(dot)com>, Maxim Boguk <maxim(dot)boguk(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: RE: BUG #18644: ALTER PUBLICATION ... SET (publish_via_partition_root) wrong/undocumented behavior.
Date: 2024-10-23 09:59:21
Message-ID: TYAPR01MB5692A0FA1BEEF29373D1DF6CF54D2@TYAPR01MB5692.jpnprd01.prod.outlook.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Dear Amit,

Thanks for giving comments. PSA new version patch.

> + <caution>
> + <para>
> + When the partition root table is specified as the replication target
> + instead of its leaf tables, altering the
> + <literal>publish_via_partition_root</literal> parameter during
> + replication can cause data loss or duplication. This happens because
> + the subscriber initially subscribed to the leaf tables.
>
> This assumes that the user is always changing
> publish_via_partition_root from 'false' to 'true'. Can't she change
> from 'false' to 'true' as well?

Yeah, users can change for arbitrary directions, and the issue can happen in any
cases. Toggling the option changes the oid contained in the replication messages,
this causes a loss. I adjusted a description.

> + <para>
> + To prevent the issue, you can avoid modifying the partitioned table
> + between the <command>ALTER PUBLICATION ... SET</command>
> and
>
> Can't the problem happen when any of the leaf tables are modified? If
> so, that is not clear from the above statement.

Partition root table is a virtual object, and actual changes are done at its leaf.
Based on that "modifying the partitioned table" may be odd. How about "modifying
any leaf tables"?

Best regards,
Hayato Kuroda
FUJITSU LIMITED

Attachment Content-Type Size
v3_add_caution.diffs application/octet-stream 1.6 KB

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Hayato Kuroda (Fujitsu) 2024-10-23 10:12:43 RE: BUG #18644: ALTER PUBLICATION ... SET (publish_via_partition_root) wrong/undocumented behavior.
Previous Message Tender Wang 2024-10-23 06:25:39 Re: BUG #18568: BUG: Result wrong when do group by on partition table!