Updated on 2024-06-03 GMT+08:00

Sending Server

max_wal_senders

Parameter description: Specifies the maximum number of concurrent connections of the transaction log sender. The value must be smaller than that of max_connections.

wal_level must be set to archive, hot_standby, or logical to allow the connection from standby nodes.

Parameter type: integer.

Value range: 0 to 1024. The recommended value range is 8 to 100.

Default value: 20

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestions: 1. It can be set to 0 only when a single DN is used and there is no primary/standby instance. 2. When HA replication, backup and restoration, and logical decoding are used, you are advised to set this parameter to a value by referring to the following formula: Number of current standby nodes + Number of backup connections + Number of required logical replication connections. If the actual value is smaller than the recommended value, these functions may be unavailable or abnormal.

wal_keep_segments

Parameter description: Specifies the number of Xlog file segments. Specifies the minimum number of transaction log files stored in the pg_xlog directory. The standby node obtains log files from the primary node for streaming replication.

Parameter type: integer.

Value range: 2 to INT_MAX.

Default value: 128

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Setting suggestion:

  • During WAL archiving or recovery from a checkpoint on the server, the system may retain more log files than the number specified by wal_keep_segments.
  • If this parameter is set to an excessively small value, a transaction log may have been overwritten by a new transaction before requested by the standby node. As a result, the request fails and the connection between the primary and standby nodes is terminated.
  • If the HA system uses asynchronous transmission, increase the value of wal_keep_segments when data greater than 4 GB is continuously imported in COPY mode. Take T6000 board as an example. If the data to be imported reaches 50 GB, you are advised to set this parameter to 1000. You can dynamically restore the setting of this parameter after data import is complete and the log synchronization is normal.
  • If the synchronous_commit level is lower than LOCAL_FLUSH, you are advised to set this parameter to 1000 when rebuilding the standby node to prevent rebuilding failures caused by primary node log recycling during the rebuilding.

wal_sender_timeout

Parameter description: Specifies the maximum duration that the sender waits for the receiver to receive transaction logs.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

  • If the data volume on the primary node is huge, the value of this parameter must be increased for the database rebuilding on a standby node. For example, if the data volume on the primary node reaches 500 GB, you are advised to set this parameter to 600 seconds.
  • This parameter cannot be set to a value larger than the value of wal_receiver_timeout or the timeout parameter for database rebuilding.

Value range: an integer ranging from 0 to INT_MAX. The unit is ms.

Default value: 6s

max_replication_slots

Parameter description: Specifies the number of log replication slots on the primary node.

Parameter type: integer.

Value range: 0 to 1024. The recommended value range is 8 to 100.

Default value: 20

Setting method: This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Setting suggestion:

When HA replication, backup and restoration, and logical decoding are used, you are advised to set this parameter to a value by referring to the following formula: Number of current physical streaming replication slots + Number of backup slots + Number of required logical replication slots. If the actual value is smaller than the recommended value, these functions may be unavailable or abnormal.

  • Physical streaming replication slots provide an automatic method to ensure that Xlogs are not removed from a primary node before they are received by all the standby nodes. That is, physical streaming replication slots are used to support primary/standby HA. The number of physical streaming replication slots required by a database is equal to the ratio of standby nodes to the primary node. For example, if an HA database has one primary node and one standby node, the number of required physical streaming replication slots will be one. If an HA database has one primary node and three standby nodes, the number of required physical streaming replication slots will be three.
  • Backup slot records replication information during backup execution. Full backup and incremental backup correspond to two independent backup slots.
  • Plan the number of logical replication slots as follows:
    • A logical replication slot can carry changes of only one database for decoding. If multiple databases are involved, create multiple logical replication slots.
    • If logical replication is needed by multiple target databases, create multiple logical replication slots in the source database. Each logical replication slot corresponds to one logical replication link.
    • A maximum of 20 logical replication slots can be enabled for decoding on the same instance.

enable_slot_log

Parameter description: Specifies whether to enable primary/standby synchronization for replication slots. Currently, only archive slots and backup slots are involved.

Parameter type: Boolean.

Value range:

  • on indicates that primary/standby synchronization is enabled for replication slots.
  • off indicates that primary/standby synchronization is disabled for replication slots.

Default value: on

Setting method: This is a USERSET parameter. Set it based on instructions provided in Table 1.

Setting suggestion: Set this parameter to on only in cloud scenarios where logical replication is enabled. In other scenarios, set this parameter to off.

max_changes_in_memory

Parameter description: Specifies the maximum number of DML statements cached in memory for a single transaction during logical decoding.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 1 to 2147483647.

Default value: 4096

max_cached_tuplebufs

Parameter description: Specifies the upper limit of the total tuple information cached in the memory during logical decoding. You are advised to set this parameter to a value greater than or equal to twice of max_changes_in_memory.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 1 to 2147483647.

Default value: 8192

logical_decode_options_default

Parameter description: Specifies the global default value for unspecified decoding options when logical decoding starts.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Currently, the following logical decoding options are supported: parallel-decode-num, parallel-queue-size, max-txn-in-memory, max-reorderbuffer-in-memory, exclude-users, and skip-generated-columns. For details about the options, see "Logical Replication > Logical Decoding > Logical Decoding Options" in Feature Guide.

Value range: a string of key=value characters separated by commas (,), for example, 'parallel-decode-num=4,parallel-queue-size=128,exclude-users=userA,skip-generated-columns=on'. An empty string indicates that the default value of the program is used.

Default value: ""

  • The SIGHUP parameter does not affect the started logical decoding process. The options specified by this parameter are used as the default settings for subsequent logical decoding startup, and the settings specified in the startup command are preferentially used.
  • The exclude-users option is different from the logical decoding startup option. You are not allowed to specify multiple blacklisted users.

logical_sender_timeout

Parameter description: Specifies the maximum waiting time for the sender to wait for the receiver to receive logical logs.

This is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 0 to 2147483647. The unit is ms.

Default value: 30s

enable_logicalrepl_xlog_prune

Parameter description: Specifies whether to enable the function of forcibly invalidating a logical replication slot. When the current GUC parameters enable_logicalrepl_xlog_prune is set to on, enable_xlog_prune is set to on, and max_size_for_xlog_retention is set to a non-zero value, the number of reserved log segments caused by the backup slot or logical replication slot exceeds the value of wal_keep_segments, and other replication slots do not cause more reserved log segments, if the value of max_size_for_xlog_retention is greater than 0 and the number of retained log segments (the size of each log segment is 16 MB) caused by the current logical replication slot exceeds the value of max_size_for_xlog_retention, or if the value of max_size_for_xlog_retention is less than 0 and the disk usage reaches the value of –max_size_for_xlog_retention/100, the logical replication slot is forcibly invalidated and restart_lsn is set to 7FFFFFFF/FFFFFFFF.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

  • true indicates that the function of forcibly invalidating a logical replication slot is enabled.
  • false indicates that the function of forcibly invalidating a logical replication slot is disabled.

Default value: false

enable_logical_replication_ddl

Parameter description: Specifies whether the logical decoding supports DDL statements, reverse parsing, and log generation.

Parameter type: Boolean.

Value range:

  • on: Logical replication supports DDL statements, reversely parses DDL execution results, and generates DDL WALs.
  • off: DDL statements are not supported, reverse parsing is not performed, and WALs are not generated.

Default value: on

Setting method: This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

enable_wal_shipping_compression

Parameter description: Specifies whether to enable cross-database instance log compression in streaming DR mode.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

This parameter applies only to a pair of WAL sender and WAL receiver for cross-database instance transmission in streaming DR and is configured on the primary database instance.

Value range: Boolean

  • true indicates that cross-database instance log compression is enabled for streaming DR.
  • false indicates that cross-database instance log compression is disabled for streaming DR.

Default value: false

repl_auth_mode

Parameter description: Specifies the validation mode for primary/standby replication and standby node rebuilding.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

  • If UUID validation is enabled on the primary node and a non-null repl_uuid validation code is configured, UUID validation must also be enabled on the standby node and the same repl_uuid validation code must be configured on the standby node. Otherwise, requests for log replication between the primary and standby nodes and standby node rebuilding will be rejected by the primary node.
  • The SIGHUP parameter can dynamically load new values. The modification does not affect the established primary/standby connection and takes effect for subsequent primary/standby replication requests and primary/standby rebuilding requests.
  • It supports the standby node rebuild validation under the Quorum and DCF protocols and the primary/standby replication validation under the Quorum protocol. It does not support primary/standby replication validation under the DCF protocol.
  • Authentication between the primary and standby database instances is not supported, including primary and standby Dorado instances and DR instances.
  • The UUID validation function is used to prevent data crosstalk and pollution caused by incorrect connection between the primary and standby nodes. It is not used for security purposes.
  • This parameter cannot be automatically synchronized between the primary and standby nodes.

Value range: enumerated values

  • off: indicates that UUID validation is disabled.
  • default: indicates that UUID validation is disabled.
  • uuid: indicates that UUID validation is enabled.

Default value: default

repl_uuid

Parameter description: Specifies the UUID used for primary/standby UUID validation.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

  • If UUID validation is enabled on the primary node and a non-null repl_uuid validation code is configured, UUID validation must also be enabled on the standby node and the same repl_uuid validation code must be configured on the standby node. Otherwise, requests for log replication between the primary and standby nodes and standby node rebuilding will be rejected by the primary node.
  • The SIGHUP parameter can dynamically load new values. The modification does not affect the established primary/standby connection and takes effect for subsequent primary/standby replication requests and primary/standby rebuilding requests.
  • It supports the standby node rebuild validation under the Quorum and DCF protocols and the primary/standby replication validation under the Quorum protocol. It does not support primary/standby replication validation under the DCF protocol.
  • Authentication between the primary and standby database instances is not supported, including primary and standby Dorado instances and DR instances.
  • The UUID validation function is used to prevent data crosstalk and pollution caused by incorrect connection between the primary and standby nodes. It is not used for security purposes.
  • This parameter cannot be automatically synchronized between the primary and standby nodes.

Value range: a string. The value is a string of 0 to 63 case-insensitive letters and digits. It is converted to lowercase letters for storage. An empty string indicates that UUID validation is disabled.

Default value: an empty string

replconninfo1

Parameter description: Specifies the information about the first node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the first node is configured.

Default value: an empty string

replconninfo2

Parameter description: Specifies the information about the second node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the second node is configured.

Default value: an empty string

replconninfo3

Parameter description: Specifies the information about the third node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the third node is configured.

Default value: an empty string

replconninfo4

Parameter description: Specifies the information about the fourth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the fourth node is configured.

Default value: an empty string

replconninfo5

Parameter description: Specifies the information about the fifth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the fifth node is configured.

Default value: an empty string

replconninfo6

Parameter description: Specifies the information about the sixth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the sixth node is configured.

Default value: an empty string

replconninfo7

Parameter description: Specifies the information about the seventh node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the seventh node is configured.

Default value: an empty string

replconninfo8

Parameter description: Specifies the information about the eighth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the eighth node is configured.

Default value: an empty string

replconninfo9

Parameter description: Specifies the information about the ninth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the ninth node is configured.

Default value: an empty string

replconninfo10

Parameter description: Specifies the information about the tenth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the tenth node is configured.

Default value: an empty string

replconninfo11

Parameter description: Specifies the information about the eleventh node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the eleventh node is configured.

Default value: an empty string

replconninfo12

Parameter description: Specifies the information about the twelfth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the twelfth node is configured.

Default value: an empty string

replconninfo13

Parameter description: Specifies the information about the thirteenth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the thirteenth node is configured.

Default value: an empty string

replconninfo14

Parameter description: Specifies the information about the fourteenth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the fourteenth node is configured.

Default value: an empty string

replconninfo15

Parameter description: Specifies the information about the fifteenth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the fifteenth node is configured.

Default value: an empty string

replconninfo16

Parameter description: Specifies the information about the sixteenth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the sixteenth node is configured.

Default value: an empty string

replconninfo17

Parameter description: Specifies the information about the seventeenth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the seventeenth node is configured.

Default value: an empty string

replconninfo18

Parameter description: Specifies the information about the eighteenth node to be listened on and authenticated by the current server.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the eighteenth node is configured.

Default value: an empty string

cross_cluster_replconninfo1

Parameter description: Specifies the information about the local first node to be listened on and authenticated across database instances.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the first node is configured.

Default value: an empty string

cross_cluster_replconninfo2

Parameter description: Specifies the information about the local second node to be listened on and authenticated across database instances.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the second node is configured.

Default value: an empty string

cross_cluster_replconninfo3

Parameter description: Specifies the information about the local third node to be listened on and authenticated across database instances.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the third node is configured.

Default value: an empty string

cross_cluster_replconninfo4

Parameter description: Specifies the information about the local fourth node to be listened on and authenticated across database instances.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the fourth node is configured.

Default value: an empty string

cross_cluster_replconninfo5

Parameter description: Specifies the information about the local fifth node to be listened on and authenticated across database instances.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the fifth node is configured.

Default value: an empty string

cross_cluster_replconninfo6

Parameter description: Specifies the information about the local sixth node to be listened on and authenticated across database instances.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the sixth node is configured.

Default value: an empty string

cross_cluster_replconninfo7

Parameter description: Specifies the information about the local seventh node to be listened on and authenticated across database instances.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the seventh node is configured.

Default value: an empty string

cross_cluster_replconninfo8

Parameter description: Specifies the information about the local eighth node to be listened on and authenticated across database instances.

This is a SIGHUP parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the eighth node is configured.

Default value: an empty string

available_zone

Parameter description: Specifies the region where the local node is located.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Value range: a string. An empty string indicates that no information about the node is configured.

Default value: an empty string

enable_availablezone

Parameter description: Specifies whether the local cascaded standby node can connect to standby nodes across AZs.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Value range: Boolean

  • true indicates that the cascaded standby node can only connect to standby nodes in the same AZ.
  • false indicates that the cascaded standby node can connect to standby nodes across AZs.

Default value: false

max_keep_log_seg

Parameter description: Stream control parameter. In logical replication, physical logs are parsed and converted into logical logs locally on the DN. When the number of physical log files that are not parsed is greater than the value of this parameter, stream control is triggered. The value 0 indicates that the stream control function is disabled.

This is a USERSET parameter. Set it based on instructions provided in Table 1.

Value range: an integer ranging from 0 to 2147483647.

Default value: 0

enable_time_report

Parameter description: Specifies whether to record the time consumed by each redo log.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Value range: Boolean
  • on indicates that the time when a redo record is generated is recorded.
  • off indicates that no record is generated.

Default value: off

thread_top_level

Parameter description: Increases the priority of the WALWRITERAUXILIARY || WALWRITER || STARTUP ||WALRECEIVER || WAL_NORMAL_SENDER || PGSTAT threads to the highest.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Value range: Boolean
  • on indicates that the priority of the preceding threads is increased to the highest.
  • off indicates that the priority of the preceding threads is not increased.

Default value: off

page_work_queue_size

Parameter description: Specifies the length of the blocking queue of each redo worker.

This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.

Value range: a value ranging from 1 to 100000.

Default value: 4096