PGD Synchronous Commit

PGD Synchronous Commit#

Commit scope kind: SYNCHRONOUS_COMMIT

Overview#

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

Unlike other commit scope kinds such as GROUP COMMIT and CAMO, the transactions in a SYNCHRONOUS_COMMIT operation will not be transformed into a two phase commit (2PC) transaction, but work more like a Postgres Synchronous commit.

Example#

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
);

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

Configuration#

There are no parameters for SYNCHRONOUS_COMMIT and therefore no configuration.

Confirmation#

Confirmation Level

PGD Synchronous Commit Handling

received

A remote PGD node confirms the transaction once it's been fully received and is in in-memory write queue.

replicated

Same behavior as received.

durable

Confirms 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 does not use the confirmation levels of the commit scope rule syntax.