Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 7 additions & 0 deletions docs/configuration/pgdog.toml/databases.md
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,13 @@ Overrides the [`min_pool_size`](general.md#min_pool_size) setting. The connectio

This setting configures the `statement_timeout` connection parameter on all connections to Postgres for this database.


### `lock_timeout`

Configures the `lock_timeout` connection parameter on all connections to Postgres for this database. Aborts any statement that waits longer than the specified duration to acquire a lock. Unlike `statement_timeout`, this only counts time spent waiting for locks, not total execution time.

Default: **none** (not set)

### `idle_timeout`

Overrides the [`idle_timeout`](general.md#idle_timeout) setting. Idle server connections exceeding this timeout will be closed automatically.
Expand Down
12 changes: 12 additions & 0 deletions docs/configuration/pgdog.toml/general.md
Original file line number Diff line number Diff line change
Expand Up @@ -555,6 +555,18 @@ Base delay, in milliseconds, between table copy retries during resharding. Each

Default: **`1_000`** (1s)

### `resharding_replication_retry_max_attempts`

Maximum number of retries for a transient error during the logical replication streaming phase of resharding. `0` means retry indefinitely.

Default: **`5`**

### `resharding_replication_retry_min_delay`

Fixed delay, in milliseconds, between replication stream retry attempts. Unlike [`resharding_copy_retry_min_delay`](#resharding_copy_retry_min_delay), this value is not subject to exponential backoff; the same delay is applied on every attempt.

Default: **`1_000`** (1s)

### `reload_schema_on_ddl`

!!! warning
Expand Down
10 changes: 10 additions & 0 deletions docs/configuration/users.toml/users.md
Original file line number Diff line number Diff line change
Expand Up @@ -81,6 +81,16 @@ Sets the `statement_timeout` on all server connections at connection creation. T
!!! note
Nothing is preventing the user from manually changing this setting at runtime, e.g., by running `SET statement_timeout TO 0`;


### `lock_timeout`

Sets the `lock_timeout` on all server connections at connection creation. Aborts any statement that waits longer than the specified duration to acquire a lock. Unlike `statement_timeout`, this only counts time spent waiting for locks, not total execution time.

Default: **none** (not set)

!!! note
Nothing is preventing the user from manually changing this setting at runtime, e.g., by running `SET lock_timeout TO 0`;

### `replication_mode`

Sets the `replication=database` parameter on user connections to Postgres. Allows this user to use replication commands.
Expand Down
14 changes: 14 additions & 0 deletions docs/features/sharding/resharding/move.md
Original file line number Diff line number Diff line change
Expand Up @@ -234,6 +234,20 @@ resharding_copy_retry_max_attempts = 5 # per-table retry attempts
resharding_copy_retry_min_delay = 1000 # base backoff in ms; doubles each attempt, max 32×
```

### Transient errors during replication streaming

After the initial copy completes, PgDog streams WAL changes from the source. If a transient error occurs (e.g., a dropped connection or a momentary network interruption) during streaming, PgDog retries automatically: it sleeps for the configured delay, then reconnects using the source replication slot and all destination shard connections in parallel before resuming.

By default: up to **5 attempts**, with a fixed **1 second** delay between each.

To change the defaults, configure [`resharding_replication_retry_max_attempts`](../../../configuration/pgdog.toml/general.md#resharding_replication_retry_max_attempts) and [`resharding_replication_retry_min_delay`](../../../configuration/pgdog.toml/general.md#resharding_replication_retry_min_delay) in `pgdog.toml`:

```toml
[general]
resharding_replication_retry_max_attempts = 5 # 0 = retry indefinitely
resharding_replication_retry_min_delay = 1000 # fixed delay in ms
```

### Primary key violations when retrying after copy failure

In rare cases, if the connection drops after `COPY` commits but before PgDog records the table as done, some rows may remain in the destination. The next retry will hit primary key violations.
Expand Down
Loading