Synchronous Commit v5.6

Commit scope kind: SYNCHRONOUS_COMMIT alias: SYNCHRONOUS COMMIT

Overview

PGD's SYNCHRONOUS_COMMIT is a commit scope kind that works in a way that's more like PostgreSQL's synchronous_commit option in its underlying operation. Unlike the PostgreSQL option, though, it's configured as a commit scope and is easier to configure and interact with in PGD.

Unlike other commit scope kinds, such as GROUP COMMIT and CAMO, the transactions in a SYNCHRONOUS_COMMIT operation aren't transformed into a two-phase commit (2PC) transaction. They work more like a Postgres synchronous_commit.

Example

In this example, when this commit scope is in use, any node in the left_dc group uses SYNCHRONOUS_COMMIT to replicate changes to the other nodes in the left_dc group. It looks for a majority of nodes in the left_dc group to confirm that they committed the transaction.

SELECT bdr.add_commit_scope(
    commit_scope_name := 'example_sc_scope',
    origin_node_group := 'left_dc',
    rule := 'MAJORITY (left_dc) SYNCHRONOUS_COMMIT',
    wait_for_ready := true
);

Configuration

SYNCHRONOUS_COMMIT supports the optional DEGRADE ON clause. See the SYNCHRONOUS_COMMIT commit scope reference for specific configuration parameters or see this section regarding Degrade on options.

Confirmation

Confirmation levelPGD Synchronous Commit handling
receivedA remote PGD node confirms the transaction once it's been fully received and is in the in-memory write queue.
replicatedSame behavior as received.
durableConfirms the transaction after all of its changes are flushed to disk. Analogous to synchronous_commit = on in legacy synchronous replication.
visible (default)Confirms the transaction after all of its changes are flushed to disk and it's visible to concurrent transactions. Analogous to synchronous_commit = remote_apply in legacy synchronous replication.

Details

Currently SYNCHRONOUS_COMMIT doesn't use the confirmation levels of the commit scope rule syntax.