From 6b8401ed0fda00ded8ed6d2e783d3f3896710699 Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan Date: Fri, 20 Sep 2024 11:47:34 +0100 Subject: [PATCH 1/2] Added reference, converted to tables, added defaults Signed-off-by: Dj Walker-Morgan --- product_docs/docs/pgd/5/reference/index.json | 1 + product_docs/docs/pgd/5/reference/index.mdx | 1 + .../docs/pgd/5/reference/pgd-settings.mdx | 41 ++++++++++++------- 3 files changed, 28 insertions(+), 15 deletions(-) diff --git a/product_docs/docs/pgd/5/reference/index.json b/product_docs/docs/pgd/5/reference/index.json index 39afee609a0..18dbfdf92ee 100644 --- a/product_docs/docs/pgd/5/reference/index.json +++ b/product_docs/docs/pgd/5/reference/index.json @@ -117,6 +117,7 @@ "bdrglobal_lock_timeout": "/pgd/latest/reference/pgd-settings#bdrglobal_lock_timeout", "bdrglobal_lock_statement_timeout": "/pgd/latest/reference/pgd-settings#bdrglobal_lock_statement_timeout", "bdrglobal_lock_idle_timeout": "/pgd/latest/reference/pgd-settings#bdrglobal_lock_idle_timeout", + "bdrlock_table_locking": "/pgd/latest/reference/pgd-settings#bdrlock_table_locking", "bdrpredictive_checks": "/pgd/latest/reference/pgd-settings#bdrpredictive_checks", "bdrreplay_progress_frequency": "/pgd/latest/reference/pgd-settings#bdrreplay_progress_frequency", "bdrstandby_slot_names": "/pgd/latest/reference/pgd-settings#bdrstandby_slot_names", diff --git a/product_docs/docs/pgd/5/reference/index.mdx b/product_docs/docs/pgd/5/reference/index.mdx index 2b57f037fb7..437d97755cc 100644 --- a/product_docs/docs/pgd/5/reference/index.mdx +++ b/product_docs/docs/pgd/5/reference/index.mdx @@ -172,6 +172,7 @@ The reference section is a definitive listing of all functions, views, and comma * [`bdr.global_lock_timeout`](pgd-settings#bdrglobal_lock_timeout) * [`bdr.global_lock_statement_timeout`](pgd-settings#bdrglobal_lock_statement_timeout) * [`bdr.global_lock_idle_timeout`](pgd-settings#bdrglobal_lock_idle_timeout) + * [`bdr.lock_table_locking`](pgd-settings#bdrlock_table_locking) * [`bdr.predictive_checks`](pgd-settings#bdrpredictive_checks) ### [Node management](pgd-settings#node-management) * [`bdr.replay_progress_frequency`](pgd-settings#bdrreplay_progress_frequency) diff --git a/product_docs/docs/pgd/5/reference/pgd-settings.mdx b/product_docs/docs/pgd/5/reference/pgd-settings.mdx index ac7d3d6a45e..e4614fd4a97 100644 --- a/product_docs/docs/pgd/5/reference/pgd-settings.mdx +++ b/product_docs/docs/pgd/5/reference/pgd-settings.mdx @@ -37,13 +37,12 @@ identify rows that are updated or deleted. The accepted values are: -- `default` — Records the old values of the columns of the primary key, - if any (this is the default PostgreSQL behavior). -- `full` — Records the old values of all columns in the row. -- `nothing` — Records no information about the old row. -- `auto` — Tables with PK are created with REPLICA IDENTITY DEFAULT, - and tables without PK are created with REPLICA IDENTITY FULL. This is - the default PGD behavior. +| Value | Description | +|---|---| +| `default` | Records the old values of the columns of the primary key, if any (this is the default PostgreSQL behavior). | +| `full` | Records the old values of all columns in the row. | +| `nothing` | Records no information about the old row. | +| `auto` | Tables with PK are created with REPLICA IDENTITY DEFAULT, and tables without PK are created with REPLICA IDENTITY FULL. This is the default PGD behavior. | See the [PostgreSQL documentation](https://www.postgresql.org/docs/current/sql-altertable.html#SQL-CREATETABLE-REPLICA-IDENTITY) for more details. @@ -105,10 +104,13 @@ This parameter can be set only by bdr_superuser or superuser roles. Possible options are: -- `all` — Use global locking for all DDL operations. -- `dml` — Use global locking only for DDL operations that need to prevent - writes by taking the global DML lock for a relation. -- `off` — Don't use global locking for DDL operations. +| Value | Description | +| --- | --- | +| `all` | Use global locking for all DDL operations. (Default) | +| `dml` | Use global locking only for DDL operations that need to prevent writes by taking the global DML lock for a relation. | +| `off` | Don't use global locking for DDL operations. | + +Default is `all`. A `LOG`-level log message is emitted to the PostgreSQL server logs whenever `bdr.ddl_replication` is set to `off`. Additionally, a `WARNING` message is @@ -152,6 +154,15 @@ Sets the maximum allowed duration of any statement holding a global lock Sets the maximum allowed duration of idle time in a transaction holding a global lock (default is 10 minutes). A value of zero disables this timeout. +### `bdr.lock_table_locking` + +Defaults to `off`. When enabled PGD treats every lock as a global DML lock. This makes the entire cluster wait for the lock to be released. This setting is useful for debugging and testing purposes. + +| Value | Description | +| --- | --- | +| `on` | Use global locking for all table locks. | +| `off` | Don't use global locking for table locks. (Default) | + ### `bdr.predictive_checks` Sets the log level for predictive checks (currently used only by global locks). @@ -252,10 +263,10 @@ Specifies the action to take if a clock skew higher than There are two possible values for this setting: -- `WARN` — Log a warning about this fact. The warnings are logged once - per minute (the default) at the maximum to prevent flooding the server log. -- `WAIT` — Wait until the current local timestamp is no longer older - than remote commit timestamp minus the `bdr.maximum_clock_skew`. +| Value | Description | +| --- | --- | +| `WARN` | Log a warning about this fact. The warnings are logged once per minute at the maximum to prevent flooding the server log. | +| `WAIT` | Wait until the current local timestamp is no longer older than remote commit timestamp minus the `bdr.maximum_clock_skew`. | ### `bdr.accept_connections` From 95171d32dfe5db3aaec6f21770984cf0ff19688f Mon Sep 17 00:00:00 2001 From: Dj Walker-Morgan <126472455+djw-m@users.noreply.github.com> Date: Fri, 20 Sep 2024 14:10:30 +0100 Subject: [PATCH 2/2] Update product_docs/docs/pgd/5/reference/pgd-settings.mdx Co-authored-by: Florin Irion --- product_docs/docs/pgd/5/reference/pgd-settings.mdx | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/product_docs/docs/pgd/5/reference/pgd-settings.mdx b/product_docs/docs/pgd/5/reference/pgd-settings.mdx index e4614fd4a97..08633f62198 100644 --- a/product_docs/docs/pgd/5/reference/pgd-settings.mdx +++ b/product_docs/docs/pgd/5/reference/pgd-settings.mdx @@ -156,7 +156,7 @@ lock (default is 10 minutes). A value of zero disables this timeout. ### `bdr.lock_table_locking` -Defaults to `off`. When enabled PGD treats every lock as a global DML lock. This makes the entire cluster wait for the lock to be released. This setting is useful for debugging and testing purposes. +Defaults to off. This configuration option sets locking behavior for LOCK TABLE Statement; when enabled, LOCK TABLE statement will also take a global DML lock on the cluster, blocking other locking statements. | Value | Description | | --- | --- |