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


Reply via email to