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

tanghy.fnst@fujitsu.com <tanghy.fnst@fujitsu.com>

From: "tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>
To: Amit Kapila <amit.kapila16@gmail.com>, Ajin Cherian <itsajin@gmail.com>
Cc: Peter Smith <smithpb2250@gmail.com>, PostgreSQL Hackers <pgsql-hackers@postgresql.org>
Date: 2021-03-22T09:12:06Z
Lists: pgsql-hackers
On Sunday, March 21, 2021 4:37 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>I have further updated the patch to implement unique GID on the
>subscriber-side as discussed in the nearby thread [1].

I did some tests(cross version & synchronous) on the latest patch set v65*, all tests passed. Here is the detail, please take it as a reference.

Case   |  version of publisher  |  version of subscriber  |  two_phase option    |  synchronous  |  expect result  |  result
-------+------------------------+-------------------------+----------------------+---------------+-----------------+---------
 1     |  13                    |  14(patched)            |  on                  |  no           |  same as case3  |  ok
 2     |  13                    |  14(patched)            |  off                 |  no           |  same as case3  |  ok
 3     |  13                    |  14(unpatched)          |  not support         |  no           |  -              |  -
 4     |  14(patched)           |  13                     |  not support         |  no           |  same as case5  |  ok
 5     |  14(unpatched)         |  13                     |  not support         |  no           |  -              |  -
 6     |  13                    |  14(patched)            |  on                  |  yes          |  same as case8  |  ok
 7     |  13                    |  14(patched)            |  off                 |  yes          |  same as case8  |  ok
 8     |  13                    |  14(unpatched)          |  not support         |  yes          |  -              |  -
 9     |  14(patched)           |  13                     |  not support         |  yes          |  same as case10 |  ok
 10    |  14(unpatched)         |  13                     |  not support         |  yes          |  -              |  -

remark:
    (1)case3, 5 ,8, 10 is tested just for reference
    (2)SQL been executed in each case
       scenario1    begin…commit
       scenario2    begin…prepare…commit

Regards,
Tang

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