Re: Skipping logical replication transactions on subscriber side
Masahiko Sawada <sawada.mshk@gmail.com>
On Wed, Mar 16, 2022 at 11:28 AM Amit Kapila <amit.kapila16@gmail.com> wrote: > > On Wed, Mar 16, 2022 at 6:03 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > > > On Tue, Mar 15, 2022 at 7:18 PM Amit Kapila <amit.kapila16@gmail.com> wrote: > > > > > > On Tue, Mar 15, 2022 at 11:43 AM Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > > > > > > > > > 6. > > > @@ -1583,7 +1649,8 @@ apply_handle_insert(StringInfo s) > > > TupleTableSlot *remoteslot; > > > MemoryContext oldctx; > > > > > > - if (handle_streamed_transaction(LOGICAL_REP_MSG_INSERT, s)) > > > + if (is_skipping_changes() || > > > > > > Is there a reason to keep the skip_changes check here and in other DML > > > operations instead of at one central place in apply_dispatch? > > > > Since we already have the check of applying the change on the spot at > > the beginning of the handlers I feel it's better to add > > is_skipping_changes() to the check than add a new if statement to > > apply_dispatch, but do you prefer to check it in one central place in > > apply_dispatch? > > > > I think either way is fine. I just wanted to know the reason, your > current change looks okay to me. > > Some questions/comments > ====================== > 1. IIRC, earlier, we thought of allowing to use of this option (SKIP) > only for superusers (as this can lead to inconsistent data if not used > carefully) but I don't see that check in the latest patch. What is the > reason for the same? I thought the non-superuser subscription owner can resolve the conflict by manuall manipulating the relations, which is the same result of skipping all data modification changes by ALTER SUBSCRIPTION SKIP feature. But after more thought, it would not be exactly the same since the skipped transaction might include changes to the relation that the owner doesn't have permission on it. > > 2. > + /* > + * Update the subskiplsn of the tuple to InvalidXLogRecPtr. > > I think we can change the above part of the comment to "Clear subskiplsn." > Fixed. > 3. > + * Since we already have > > Isn't it better to say here: Since we have already ...? Fixed. Regards, -- Masahiko Sawada EDB: https://www.enterprisedb.com/
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