Re: [HACKERS] logical decoding of two-phase transactions

From: Ajin Cherian <itsajin(at)gmail(dot)com>
To: Peter Smith <smithpb2250(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: [HACKERS] logical decoding of two-phase transactions
Date: 2021-03-18 11:58:13
Message-ID: CAFPTHDbXeYKH0Og+Kuu4Tp-NLjgDh5bPRWH+ByHZPBoHnMNSrw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Thu, Mar 18, 2021 at 5:30 PM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:

> On Thu, Mar 18, 2021 at 5:20 PM Peter Smith <smithpb2250(at)gmail(dot)com> wrote:
> >
> > Please find attached the latest patch set v61*
> >
>
> Please find attached the latest patch set v62

Differences from v61 are:

* Rebased to HEAD

* Addresses the following feedback issues:

Vignesh 12/Mar -
https://www.postgresql.org/message-id/CALDaNm1p%3DKYcDc1s_Q0Lk2P8UYU-z4acW066gaeLfXvW_O-kBA%40mail.gmail.com

(62) Fixed. Added assert for twophase alter check in
maybe_reread_subscription(void)

(63) Fixed. Changed parse_output_parameters to disable two-phase and
streaming combo

Amit 16 Mar -
https://www.postgresql.org/message-id/CAA4eK1Kwah%2BMimFMR3jPY5cSqpGFVh5zfV2g4%3DgTphaPsacoLw%40mail.gmail.com

(74) Fixed. Modify comment about why not supporting combination of
two-phase and streaming

(75) Fixed. Added more comments about creating slot with two-phase race
conditions

(78) Skipped. Adding assert for two-phase variables getting reset, the
logic has been changed, so skipping this.

(79) Changed. Reworded the comment about allowing decoding of prepared
transaction (restoring iff)

(80) Fixed. Added & in the assignment for ctx->twophase, logic is also
changed

(81) Fixed. Changed to conditional setting of two_phase_at only if
two_phase is enabled.

(82) Fixed. Better explanation for two_phase_at variable in
snapbuild.changed

(83) Skipped. The comparison in ReorderBufferFinishPrepared was not changed
and it was tested and it works.
The reason it works is because even if the Prepare is filtered when
two-phase is not enabled, once the tablessync is
over and the TABLES are in READY state, the apply worker and the walsender
restarts, and after restart, the prepare will be
not be filtered out, but will be marked as skipped prepare and also updated
in ReorderBufferRememberPrepareInfo

(87) Fixed. Added server version check before two-phase enabled startstream
in ApplyWorkerMain.

(91)Fixed. Removed unused macros in reorderbuffer.h

Amit 17/Mar -
https://www.postgresql.org/message-id/CAA4eK1LNLA20ci3_qqNQv7BYRTy3HqiAsOfuieqo6tJ2GeYuJw%40mail.gmail.com

(96) Fixed - Removed token for twophase in Start Replication slot, instead
used the twophase options. But kept the token
in Create_Replication slot, as we gave the option for plugins to enable
two-phase while creating a slot. This allows plugins without a
table-synchronization phase
to handle two-phase from the start.

regards,
Ajin Cherian
Fujitsu Australia

Attachment Content-Type Size
v62-0002-Support-2PC-txn-subscriber-tests.patch application/octet-stream 24.4 KB
v62-0003-Fix-apply-worker-dev-logs.patch application/octet-stream 3.4 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message vignesh C 2021-03-18 12:01:01 Re: Logical Replication vs. 2PC
Previous Message Matthieu Garrigues 2021-03-18 11:28:02 Re: [HACKERS] PATCH: Batch/pipelining support for libpq