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

Ajin Cherian <itsajin@gmail.com>

From: Ajin Cherian <itsajin@gmail.com>
To: Peter Smith <smithpb2250@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2021-03-18T23:33:20Z
Lists: pgsql-hackers

Attachments

Missed the patch - 0001, resending.

On Thu, Mar 18, 2021 at 10:58 PM Ajin Cherian <itsajin@gmail.com> wrote:

>
>
> On Thu, Mar 18, 2021 at 5:30 PM Peter Smith <smithpb2250@gmail.com> wrote:
>
>> On Thu, Mar 18, 2021 at 5:20 PM Peter Smith <smithpb2250@gmail.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
>

Commits

  1. Add prepare API support for streaming transactions in logical replication.

  2. Doc: minor improvements for logical replication protocol documentation.

  3. Fix test failure in 021_twophase.pl.

  4. Refactor to make common functions in proto.c and worker.c.

  5. Unify PostgresNode's new() and get_new_node() methods

  6. Fix potential buffer overruns in proto.c.

  7. Add support for prepared transactions to built-in logical replication.

  8. Refactor function parse_subscription_options.

  9. Allow enabling two-phase option via replication protocol.

  10. Don't use Asserts to check for violations of replication protocol.

  11. Improve psql tab completion for options of subcriptions and publications

  12. Rearrange logrep worker's snapshot handling some more.

  13. doc: Update information of new messages for logical replication.

  14. ALTER SUBSCRIPTION ... ADD/DROP PUBLICATION

  15. Allow pgoutput to send logical decoding messages.

  16. Refactor function parse_output_parameters.

  17. Avoid repeated decoding of prepared transactions after a restart.

  18. Fix an oversight in ReorderBufferFinishPrepared.

  19. Allow multiple xacts during table sync in logical replication.

  20. Fix replication of in-progress transactions in tablesync worker.

  21. Fix 'skip-empty-xacts' option in test_decoding for streaming mode.

  22. Use Enum for top level logical replication message types.

  23. Add support for streaming to built-in logical replication.

  24. Fix the logical streaming test.

  25. Implement streaming mode in ReorderBuffer.

  26. Extend the logical decoding output plugin API with stream methods.

  27. Store 2PC GID in commit/abort WAL recs for logical decoding