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

Peter Smith <smithpb2250@gmail.com>

From: Peter Smith <smithpb2250@gmail.com>
To: vignesh C <vignesh21@gmail.com>
Cc: Amit Kapila <amit.kapila16@gmail.com>, Ajin Cherian <itsajin@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2021-04-07T06:43:05Z
Lists: pgsql-hackers

Attachments

Please find attached the latest patch set v70*

Differences from v69* are:

* Rebased to HEAD @ today
Unfortunately, the v69 patch was broken due to a recent push [1]

----
[1] https://github.com/postgres/postgres/commit/82ed7748b710e3ddce3f7ebc74af80fe4869492f

Kind Regards,
Peter Smith.
Fujitsu Australia

On Wed, Apr 7, 2021 at 10:25 AM Peter Smith <smithpb2250@gmail.com> wrote:
>
> Please find attached the latest patch set v69*
>
> Differences from v68* are:
>
> * Rebased to HEAD @ yesterday.
> There was some impacts caused by recently pushed patches [1] [2]
>
> * The stream/prepare functionality and tests have been restored to be
> the same as they were in v48 [3].
> Previously, this code had been removed back in v49 [4] due to
> incompatibilities with the (now obsolete) psf design.
>
> * TAP tests are now co-located in the same patch as the code they are testing.
>
> ----
> [1] https://github.com/postgres/postgres/commit/531737ddad214cb8a675953208e2f3a6b1be122b
> [2] https://github.com/postgres/postgres/commit/ac4645c0157fc5fcef0af8ff571512aa284a2cec
> [3] https://www.postgresql.org/message-id/CAHut%2BPsr8f1tUttndgnkK_%3Da7w%3Dhsomw16SEOn6U68jSBKL9SQ%40mail.gmail.com
> [4] https://www.postgresql.org/message-id/CAFPTHDZduc2fDzqd_L4vPmA2R%2B-e8nEbau9HseHHi82w%3Dp-uvQ%40mail.gmail.com
>
> Kind Regards,
> Peter Smith.
> Fujitsu Australia
>
> On Tue, Mar 30, 2021 at 11:03 AM Peter Smith <smithpb2250@gmail.com> wrote:
> >
> > Please find attached the latest patch set v68*
> >
> > Differences from v67* are:
> >
> > * Rebased to HEAD @ today.
> >
> > * v68 fixes an issue reported by Vignesh [1] where a scenario was
> > found which still was able to cause a generated GID clash. Using
> > Vignesh's test script I could reproduce the problem exactly as
> > described. The fix makes the GID unique by including the subid. Now
> > the same script runs to normal completion and produces good/expected
> > output:
> >
> >  transaction |       gid        |           prepared            |
> > owner   | database
> > -------------+------------------+-------------------------------+----------+----------
> >          547 | pg_gid_16389_543 | 2021-03-30 10:32:36.87207+11  |
> > postgres | postgres
> >          555 | pg_gid_16390_543 | 2021-03-30 10:32:48.087771+11 |
> > postgres | postgres
> > (2 rows)
> >
> >
> > ----
> > [1] https://www.postgresql.org/message-id/CALDaNm2ZnJeG23bE%2BgEOQEmXo8N%2Bfs2g4%3DxuH2u6nNcX0s9Jjg%40mail.gmail.com
> >
> > Kind Regards,
> > Peter Smith.
> > 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