Re: Skipping logical replication transactions on subscriber side

Amit Kapila <amit.kapila16@gmail.com>

From: Amit Kapila <amit.kapila16@gmail.com>
To: Masahiko Sawada <sawada.mshk@gmail.com>
Cc: Peter Eisentraut <peter.eisentraut@enterprisedb.com>, "houzj.fnst@fujitsu.com" <houzj.fnst@fujitsu.com>, vignesh C <vignesh21@gmail.com>, Greg Nancarrow <gregn4422@gmail.com>, "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>, "osumi.takamichi@fujitsu.com" <osumi.takamichi@fujitsu.com>, Alexey Lesovsky <lesovsky@gmail.com>, PostgreSQL-development <pgsql-hackers@postgresql.org>
Date: 2021-12-06T05:17:00Z
Lists: pgsql-hackers
On Fri, Dec 3, 2021 at 12:12 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote:
>
> On Fri, Dec 3, 2021 at 11:53 AM Amit Kapila <amit.kapila16@gmail.com> wrote:
> >
> > >  But this syntax gives you flexibility, so we can also
> > > start with a simple implementation.
> > >
> >
> > Yeah, I also think so. BTW, what do you think of providing extra
> > flexibility of giving other options like 'operation', 'rel' along with
> > xid? I think such options could be useful for large transactions that
> > operate on multiple tables as it is quite possible that only a
> > particular operation from the entire transaction is the cause of
> > failure. Now, on one side, we can argue that skipping the entire
> > transaction is better from the consistency point of view but I think
> > it is already possible that we just skip a particular update/delete
> > (if the corresponding tuple doesn't exist on the subscriber). For the
> > sake of simplicity, we can just allow providing xid at this stage and
> > then extend it later as required but I am not very sure of that point.
>
> +1
>
> Skipping a whole transaction by specifying xid would be a good start.
>

Okay, that sounds reasonable, so let's do that for now.

-- 
With Regards,
Amit Kapila.



Commits

  1. Test ALIGNOF_DOUBLE==4 compatibility under ALIGNOF_DOUBLE==8.

  2. Reorder subskiplsn in pg_subscription to avoid alignment issues.

  3. Add ALTER SUBSCRIPTION ... SKIP.

  4. Optionally disable subscriptions on error.

  5. Update docs of logical replication for commit 8d74fc96db.

  6. Respect permissions within logical replication.

  7. Fix regression test failure caused by commit 8d74fc96db.

  8. Add a view to show the stats of subscription workers.

  9. Add logical change details to logical replication worker errcontext.

  10. Rename LOGICAL_REP_MSG_STREAM_END to LOGICAL_REP_MSG_STREAM_STOP.

  11. Fix typo in protocol.sgml.

  12. Remove unused argument in apply_handle_commit_internal().

  13. Fix replication of in-progress transactions in tablesync worker.

  14. Reorder pg_sequence columns to avoid alignment issue