Re: [HACKERS] logical decoding of two-phase transactions - Mailing list pgsql-hackers

From Ajin Cherian
Subject Re: [HACKERS] logical decoding of two-phase transactions
Date
Msg-id CAFPTHDYPCLUqn32aE7zcxpevyMLhT_qhqHAPvddZqxPMP-6kAQ@mail.gmail.com
Whole thread Raw
In response to Re: [HACKERS] logical decoding of two-phase transactions  (vignesh C <vignesh21@gmail.com>)
List pgsql-hackers
Modified pgbench's "tpcb-like" builtin query as below to do two-phase
commits and then ran a 4 cascade replication setup.

        "BEGIN;\n"
        "UPDATE pgbench_accounts SET abalance = abalance + :delta
WHERE aid = :aid;\n"
        "SELECT abalance FROM pgbench_accounts WHERE aid = :aid;\n"
        "UPDATE pgbench_tellers SET tbalance = tbalance + :delta WHERE
tid = :tid;\n"
        "UPDATE pgbench_branches SET bbalance = bbalance + :delta
WHERE bid = :bid;\n"
        "INSERT INTO pgbench_history (tid, bid, aid, delta, mtime)
VALUES (:tid, :bid, :aid, :delta, CURRENT_TIMESTAMP);\n"
        "PREPARE TRANSACTION ':aid:';\n"
        "COMMIT PREPARED ':aid:';\n"

The tests ran fine and all 4 cascaded servers replicated the changes
correctly. All the subscriptions were configured with two_phase
enabled.

regards,
Ajin Cherian
Fujitsu Australia



pgsql-hackers by date:

Previous
From: "houzj.fnst@fujitsu.com"
Date:
Subject: RE: [bug?] Missed parallel safety checks, and wrong parallel safety
Next
From: Andres Freund
Date:
Subject: Re: WIP: WAL prefetch (another approach)