Re: Skipping logical replication transactions on subscriber side
Amit Kapila <amit.kapila16@gmail.com>
On Tue, Dec 14, 2021 at 11:40 AM Dilip Kumar <dilipbalaut@gmail.com> wrote: > > On Fri, Dec 3, 2021 at 12:12 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > > > Skipping a whole transaction by specifying xid would be a good start. > > Ideally, we'd like to automatically skip only operations within the > > transaction that fail but it seems not easy to achieve. If we allow > > specifying operations and/or relations, probably multiple operations > > or relations need to be specified in some cases. Otherwise, the > > subscriber cannot continue logical replication if the transaction has > > multiple operations on different relations that fail. But similar to > > the idea of specifying multiple xids, we need to note the fact that > > user wouldn't know of the second operation failure unless the apply > > worker applies the change. So I'm not sure there are many use cases in > > practice where users can specify multiple operations and relations in > > order to skip applies that fail. > > I think there would be use cases for specifying the relations or > operation, e.g. if the user finds an issue in inserting in a > particular relation then maybe based on some manual investigation he > founds that the table has some constraint due to that it is failing on > the subscriber side but on the publisher side that constraint is not > there so maybe the user is okay to skip the changes for this table and > not for other tables, or there might be a few more tables which are > designed based on the same principle and can have similar error so > isn't it good to provide an option to give the list of all such > tables. > That's right and I agree there could be some use case for it and even specifying the operation but I think we can always extend the existing feature for it if the need arises. Note that the user can anyway only specify a single relation or an operation because there is a way to know only one error and till that is resolved, the apply process won't proceed. We have discussed providing these additional options in this thread but thought of doing it later once we have the base feature and based on the feedback from users. -- With Regards, Amit Kapila.
Commits
-
Test ALIGNOF_DOUBLE==4 compatibility under ALIGNOF_DOUBLE==8.
- c1da0acbb06e 15.0 landed
-
Reorder subskiplsn in pg_subscription to avoid alignment issues.
- 79b716cfb7a1 15.0 landed
-
Add ALTER SUBSCRIPTION ... SKIP.
- 208c5d65bbd6 15.0 landed
-
Optionally disable subscriptions on error.
- 705e20f8550c 15.0 cited
-
Update docs of logical replication for commit 8d74fc96db.
- 85c61ba8920b 15.0 landed
-
Respect permissions within logical replication.
- a2ab9c06ea15 15.0 cited
-
Fix regression test failure caused by commit 8d74fc96db.
- 41e66fee0516 15.0 landed
-
Add a view to show the stats of subscription workers.
- 8d74fc96db5f 15.0 landed
-
Add logical change details to logical replication worker errcontext.
- abc0910e2e0a 15.0 landed
-
Rename LOGICAL_REP_MSG_STREAM_END to LOGICAL_REP_MSG_STREAM_STOP.
- 4cd7a1896871 15.0 landed
-
Fix typo in protocol.sgml.
- e1915646658d 14.0 landed
- 0ac1aee0d7d8 15.0 landed
-
Remove unused argument in apply_handle_commit_internal().
- f4b939f1a372 14.0 landed
- 16bd4becee32 15.0 landed
-
Fix replication of in-progress transactions in tablesync worker.
- 0926e96c4934 14.0 cited
-
Reorder pg_sequence columns to avoid alignment issue
- f3b421da5f4a 10.0 cited