Updated on 2023-10-23 GMT+08:00

Sending Server

max_wal_senders

Parameter description: Specifies the maximum number of simultaneously running WAL sender processes. The value cannot be greater than or equal to that of max_connections.

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

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

Value range: an integer ranging from 0 to 1024. The recommended value range is 8 to 100.

This parameter can be set to 0 only when a single DN is used and there is no primary/standby instance.

Default value:

Setting suggestions: Each log replication connection between a standby server and a primary server occupies a WAL sender thread. Therefore, the value of this parameter must be greater than or equal to the number of DNs. Otherwise, the standby server cannot connect to the primary server. When logical replication is required, each log extraction thread occupies one WAL sender thread. If logical replication is required, set max_wal_senders to a value greater than the number of threads required by standby servers and logical replication extraction threads.

wal_keep_segments

Parameter description: Specifies the minimum number of transaction log files that can be retained in the pg_xlog directory. The standby node obtains the logs from the primary node to perform streaming replication.

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

Value range: an integer ranging from 2 to INT_MAX

Default value: 128

Setting suggestions:

  • 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 server. As a result, the request fails and the connection between the primary and standby servers 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 WAL synchronization is proper.

wal_sender_timeout

Parameter description: Specifies the maximum duration that the sending server waits for the WAL receiving in the receiver.

This parameter 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 rebuilding. 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 2147483647. The unit is ms.

Default value: 6s

max_replication_slots

Parameter description: Specifies the number of log replication slots in the primary server.

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

Value range: an integer ranging from 0 to 1024. The recommended value range is 8 to 100.

Default value: 20

Setting suggestions:

When primary/standby replication, and backup and restoration are used, you are advised to set this parameter to: Number of current physical 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 replication slots provide an automatic method to ensure that Xlog files are not removed from a primary DN before they are received by all the standby DNs, allowing high availability for the cluster. The number of physical replication slots required by the cluster is as follows: ratio of the number of standby DNs to the number of primary DNs in a group of DNs. For example, if the HA cluster has one primary DN and one standby DN, the number of physical replication slots required is 2. If the HA cluster has 1 primary DN and 3 standby DNs, the number of physical replication slots required is 3.

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.

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 parameter 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_wal_shipping_compression

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

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

  • This parameter applies only to a pair of WAL senders and WAL receivers for cross-cluster transmission in streaming DR and is configured in the primary cluster.

Value range: Boolean

  • true indicates that cross-cluster log compression is enabled in streaming DR mode.
  • false indicates that cross-cluster log compression is disabled in streaming DR mode.

Default value: false

repl_auth_mode

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

This parameter 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.
  • It does not support the authentication between the primary and standby nodes across clusters, including the primary/standby Dorado and DR clusters.
  • 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 parameter 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.
  • It does not support the authentication between the primary and standby nodes across clusters, including the primary/standby Dorado and DR clusters.
  • 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 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: empty

replconninfo1

Parameter description: Specifies the information about the first node to be listened on and authenticated by the current server. This parameter is automatically configured after the cluster is successfully installed.

This parameter 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: the first connection information listened on by the DN.

Example:

replconninfo1 = 'localhost=127.0.0.1 localport=XXXX localheartbeatport=XXXX localservice=XXXX remotehost=127.0.0.1 remoteport=XXXX remoteheartbeatport=XXXX remoteservice=XXXX'

replconninfo2

Parameter description: Specifies the information about the second node to be listened on and authenticated by the current server. This parameter is automatically configured after the cluster is successfully installed.

This parameter 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: information about the second connection listened to by the DN.

Example:

replconninfo2 = 'localhost=127.0.0.1 localport=XXXX localheartbeatport=XXXX localservice=XXXX remotehost=127.0.0.1 remoteport=XXXX remoteheartbeatport=XXXX remoteservice=XXXX'

replconninfo3

Parameter description: Specifies the information about the third node to be listened on and authenticated by the current server. This parameter is automatically configured after the cluster is successfully installed.

This parameter 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: information about the third connection listened to by the DN.

Example:

replconninfo3 = 'localhost=127.0.0.1 localport=XXXX localheartbeatport=XXXX localservice=XXXX remotehost=127.0.0.1 remoteport=XXXX remoteheartbeatport=XXXX remoteservice=XXXX'

replconninfo4

Parameter description: Specifies the information about the fourth node to be listened on and authenticated by the current server. This parameter is automatically configured after the cluster is successfully installed.

This parameter 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: information about the fourth connection listened to by the DN.

Example:

replconninfo4 = 'localhost=127.0.0.1 localport=XXXX localheartbeatport=XXXX localservice=XXXX remotehost=127.0.0.1 remoteport=XXXX remoteheartbeatport=XXXX remoteservice=XXXX'

replconninfo5

Parameter description: Specifies the information about the fifth node to be listened on and authenticated by the current server. This parameter is automatically configured after the cluster is successfully installed.

This parameter 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: information about the fifth connection listened to by the DN.

Example:

replconninfo5 = 'localhost=127.0.0.1 localport=XXXX localheartbeatport=XXXX localservice=XXXX remotehost=127.0.0.1 remoteport=XXXX remoteheartbeatport=XXXX remoteservice=XXXX'

replconninfo6

Parameter description: Specifies the information about the sixth node to be listened on and authenticated by the current server. This parameter is automatically configured after the cluster is successfully installed.

This parameter 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: information about the sixth connection listened to by the DN.

Example:

replconninfo6 = 'localhost=127.0.0.1 localport=XXXX localheartbeatport=XXXX localservice=XXXX remotehost=127.0.0.1 remoteport=XXXX remoteheartbeatport=XXXX remoteservice=XXXX'

replconninfo7

Parameter description: Specifies the information about the seventh node to be listened on and authenticated by the current server. This parameter is automatically configured after the cluster is successfully installed.

This parameter 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: information about the seventh connection listened to by the DN.

Example:

replconninfo7 = 'localhost=127.0.0.1 localport=XXXX localheartbeatport=XXXX localservice=XXXX remotehost=127.0.0.1 remoteport=XXXX remoteheartbeatport=XXXX remoteservice=XXXX'