Re: Skipping logical replication transactions on subscriber side
Amit Kapila <amit.kapila16@gmail.com>
On Tue, Dec 14, 2021 at 3:41 PM Dilip Kumar <dilipbalaut@gmail.com> wrote: > > On Tue, Dec 14, 2021 at 2:36 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > > > > > > > > > I agree with this theory. Can we reflect this in comments so that in > > > > the future we know why we didn't pursue this direction? > > > > > > I might be missing something here, but for streaming, transaction > > > users can decide whether they wants to skip or not only once we start > > > applying no? I mean only once we start applying the changes we can > > > get some errors and by that time we must be having all the changes for > > > the transaction. > > > > > > > That is right and as per my understanding, the patch is trying to > > accomplish the same. > > > > > So I do not understand the point we are trying to > > > discuss here? > > > > > > > The point is that whether we can skip the changes while streaming > > itself like when we get the changes and write to a stream file. Now, > > it is possible that streams from multiple transactions can be > > interleaved and users can change the skip_xid in between. It is not > > that we can't handle this but that would require a more complex design > > and it doesn't seem worth it because we can anyway skip the changes > > while applying as you mentioned in the previous paragraph. > > Actually, I was trying to understand the use case for skipping while > streaming. Actually, during streaming we are not doing any database > operation that means this will not generate any error. > Say, there is an error the first time when we start to apply changes for such a transaction. So, such a transaction will be streamed again. Say, the user has set the skip_xid before we stream a second time, so this time, we can skip it either during the stream phase or apply phase. I think the patch is skipping it during apply phase. Sawada-San, please confirm if my understanding is correct? -- 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