pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Hayato Kuroda (Fujitsu) <kuroda.hayato@fujitsu.com>
To: Amit Kapila <amit.kapila16@gmail.com>
Cc: vignesh C <vignesh21@gmail.com>
Cc: Maxim Boguk <maxim.boguk@gmail.com>
Cc: pgsql-bugs@lists.postgresql.org <pgsql-bugs@lists.postgresql.org>
Subject: RE: BUG #18644: ALTER PUBLICATION ... SET (publish_via_partition_root) wrong/undocumented behavior.
Date: Wed, 23 Oct 2024 09:59:21 +0000
Message-ID: <TYAPR01MB5692A0FA1BEEF29373D1DF6CF54D2@TYAPR01MB5692.jpnprd01.prod.outlook.com> (raw)
In-Reply-To: <CAA4eK1LNuj1CRY1Mb1W0XkbB6pL6PNXrJcg+Ww5QdvKGm6Mm3w@mail.gmail.com>
References: <18644-6866bbd22178ee16@postgresql.org>
	<CAA4eK1LwHnB9285-otBb2O3ez8SC4=cN1qqGee-oWp7wr4D5Sg@mail.gmail.com>
	<CAK-MWwRd_XXXcCdgY6u9W4tHD+Jz3SiMUbN1WYZrCnOoVzYsLg@mail.gmail.com>
	<CAA4eK1KUmObSjNkPWS3Tm_3Z_HpApKMZAvAimrrkm3k71wn+fQ@mail.gmail.com>
	<CAK-MWwTsO5548J1HetXnT4KpzMmO-k7fq8Ev-5SX0cthz9BF2g@mail.gmail.com>
	<TYAPR01MB56924E2922925727E6B6C40EF57F2@TYAPR01MB5692.jpnprd01.prod.outlook.com>
	<CALDaNm3yWCY+q60OremzicPRZWrYZRg22a=KcfBmAyVud4H2FQ@mail.gmail.com>
	<TYAPR01MB5692D7302A3B1A895CEC8DB0F57F2@TYAPR01MB5692.jpnprd01.prod.outlook.com>
	<CAA4eK1LNuj1CRY1Mb1W0XkbB6pL6PNXrJcg+Ww5QdvKGm6Mm3w@mail.gmail.com>

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



Attachments:

  v3_add_caution.diffs (application/octet-stream, 1.6K) download

view thread (20+ messages)  latest in thread

Message-ID: <TYAPR01MB5692A0FA1BEEF29373D1DF6CF54D2@TYAPR01MB5692.jpnprd01.prod.outlook.com>
Permalink:  ../TYAPR01MB5692A0FA1BEEF29373D1DF6CF54D2@TYAPR01MB5692.jpnprd01.prod.outlook.com/
Also on:    postgresql.org/message-id/TYAPR01MB5692A0FA1BEEF29373D1DF6CF54D2@TYAPR01MB5692.jpnprd01.prod.outlook.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: kuroda.hayato@fujitsu.com, amit.kapila16@gmail.com, vignesh21@gmail.com, maxim.boguk@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: RE: BUG #18644: ALTER PUBLICATION ... SET (publish_via_partition_root) wrong/undocumented behavior.
  In-Reply-To: <TYAPR01MB5692A0FA1BEEF29373D1DF6CF54D2@TYAPR01MB5692.jpnprd01.prod.outlook.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox