Re: Skipping logical replication transactions on subscriber side
Masahiko Sawada <sawada.mshk@gmail.com>
On Mon, Jan 17, 2022 at 5:03 PM osumi.takamichi@fujitsu.com <osumi.takamichi@fujitsu.com> wrote: > > On Monday, January 17, 2022 3:18 PM Masahiko Sawada <sawada.mshk@gmail.com> wrote: > > I've attached an updated patch. Please review it. > Hi, thank you for sharing a new patch. > Few comments on the v6. Thank you for the comments! > > (1) doc/src/sgml/ref/alter_subscription.sgml > > + resort. This option has no effect on the transaction that is already > > One TAB exists between "resort" and "This". Will remove. > > (2) Minor improvement suggestion of comment in src/backend/replication/logical/worker.c > > + * reset during that. Also, we don't skip receiving the changes in streaming > + * cases, since we decide whether or not to skip applying the changes when > > I sugguest that you don't use 'streaming cases', because > what "streaming cases" means sounds a bit broader than actual your implementation. > We do skip transaction of streaming cases but not during the spooling phase, right ? > > I suggest below. > > "We don't skip receiving the changes at the phase to spool streaming transactions" I might be missing your point but I think it's correct that we don't skip receiving the change of the transaction that is sent via streaming protocol. And it doesn't sound broader to me. Could you elaborate on that? > > (3) in the comment of apply_handle_prepare_internal, two full-width characters. > > 3-1 > + * won’t be resent in a case where the server crashes between them. > > 3-2 > + * COMMIT PREPARED or ROLLBACK PREPARED. But that’s okay because this > > You have full-width characters for "won't" and "that's". > Could you please check ? Which characters in "won't" are full-width characters? I could not find them. > > > (4) typo > > + * the subscription if hte user has specified skip_xid. Once we start skipping > > "hte" should "the" ? Will fix. > > (5) > > I can miss something here but, in one of > the past discussions, there seems a consensus that > if the user specifies XID of a subtransaction, > it would be better to skip only the subtransaction. > > This time, is it out of the range of the patch ? > If so, I suggest you include some description about it > either in the commit message or around codes related to it. How can the user know subtransaction XID? I suppose you refer to streaming protocol cases but while applying spooled changes we don't report subtransaction XID neither in server log nor pg_stat_subscription_workers. > > (6) > > I feel it's a better idea to include a test whether > to skip aborted streaming transaction clears the XID > in the TAP test for this feature, in a sense to cover > various new code paths. Did you have any special reason > to omit the case ? Which code path is newly covered by this aborted streaming transaction tests? I think that this patch is already covered even by the test for a committed-and-streamed transaction. It doesn't matter whether the streamed transaction is committed or aborted because an error occurs while applying the spooled changes. > > (7) > > I want more explanation for the reason to restart the subscriber > in the TAP test because this is not mandatory operation. > (We can pass the TAP tests without this restart) > > From : > # Restart the subscriber node to restart logical replication with no interval > > IIUC, below would be better. > > To : > # As an optimization to finish tests earlier, restart the subscriber with no interval, > # rather than waiting for new error to laucher a new apply worker. I could not understand why the proposed sentence has more information. Does it mean you want to mention "As an optimization to finish tests earlier"? 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