PGD Synchronous Commit
======================

コミットスコープの種類 ``SYNCHRONOUS_COMMIT``

概要
----

PGDの\ ``SYNCHRONOUS_COMMIT``
は、基になるオペレーションでのPostgreSQLの `Synchronous commit <https://www.postgresql.org/docs/current/runtime-config-wal.html#GUC-SYNCHRONOUS-COMMIT>`_ オプションに似た方法で動作するコミットスコープの種類です。ただし、
PostgreSQLオプションとは異なり、コミットスコープとして構成され、PGD内での構成と対話が簡単です。

GROUP COMMITやCAMOなどの他のコミットスコープの種類とは異なり、
SYNCHRONOUS_COMMITオペレーションのトランザクションは2フェーズコミット2PCトランザクションに変換されませんが、Postgresの同期コミットのように動作します。

例
--

::

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

この例では、 ``left_dc``
グループ内のノードは、このコミットスコープが使用されている場合、
``SYNCHRONOUS_COMMIT`` を使用して\ ``left_dc``
グループ内の他のノードに変更をレプリケートします。 ``left_dc``
グループ内のノードの大部分を検索して、トランザクションをコミットしたことを確認します。

構成
----

``SYNCHRONOUS_COMMIT`` のパラメーターがないため、構成はありません。

確認
----

.. csv-table::
  :header: Confirmation&nbsp;Level,PGD Synchronous Commit Handling
  :widths: 10,30
  :align: left
  :class: longtable

  `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.

詳細
----

現在、\ ``SYNCHRONOUS_COMMIT``
は、コミットスコープルール構文の確認レベルを使用しません。
