Re: Slow catchup of 2PC (twophase) transactions on replica in LR
Peter Smith <smithpb2250@gmail.com>
From: Peter Smith <smithpb2250@gmail.com>
To: "Hayato Kuroda (Fujitsu)" <kuroda.hayato@fujitsu.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, "Zhijie Hou (Fujitsu)" <houzj.fnst@fujitsu.com>, "pgsql-hackers@lists.postgresql.org" <pgsql-hackers@lists.postgresql.org>, Vitaly Davydov <v.davydov@postgrespro.ru>, Ajin Cherian <itsajin@gmail.com>
Date: 2024-07-17T03:31:14Z
Lists: pgsql-hackers
Commits
Same data as JSON:
GET /api/v1/messages/:b64id/commits
the thread's linked commits as JSON, with link sources.
API reference →
-
Fix random failure in 021_twophase.
- 0dcea330babd 18.0 landed
-
Allow altering of two_phase option of a SUBSCRIPTION.
- 1462aad2e447 18.0 landed
-
Doc: use true|false rather than on|off for "failover" option
- fa65a022db26 17.0 cited
-
Support an optional asynchronous commit mode, in which we don't flush WAL
- 4a78cdeb6b59 8.3.0 cited
Attachments
- PS_NITPICKS_20240717_2PC_V180002.txt (text/plain)
Here are some review comments for patch v18-0002. ====== src/backend/commands/subscriptioncmds.c 1. CheckAlterSubOption 1a. It's not obvious why we are only checking the 'slot name' when needs_update==true, but OTOH is always checking the 'enabled' state. ~ 1b. Param 'needs_update' is a vague name. It needs more explanatory comments or a better name. e.g. First impression was "Why are we calling 'Alter' function if needs_update is false?". I know it encapsulates some common code, but if special cases cause the logic to be more confusing then that cost may outweigh the benefit of this function. ~ 1c. If the error checks can be moved to be done up-front, then all the 'needs_update' can be combined. Avoiding multiple checks to 'needs_update' will make this function simpler. ~~~ AlterSubscription: nitpick - typo /needs/need/ nitpick - typo /wo_phase/two_phase/ nitpick - The comment wording "the later part...", was confusing. I've reworded the whole comment. But this belongs in patch 0001. ====== src/test/subscription/t/021_twophase.pl nitpick - Use the same "###############################" comment style as in patch 0001 to indicate each main TEST scenario. ====== 99. Please refer to the diffs attachment patch, which implements any nitpicks mentioned above. ====== Kind Regards, Peter Smith. Fujitsu Australia