Primary Server
synchronous_standby_names
Parameter description: Specifies a comma-separated list of names of potential standby nodes that support synchronous replication.
This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
- The current synchronous standby node is on the top of the list. If the current synchronous standby node is disconnected, it will be replaced immediately with the next-highest-priority standby node. Name of the next-highest-priority standby node is added to the list.
- The standby node name can be specified by setting the environment variable PGAPPNAME.
- ANY num_sync (standby_name [, ...]) [, ANY num_sync (standby_name [, ...])]
- [FIRST] num_sync (standby_name [, ...])
- standby_name [, ...]
- In the preceding command, num_sync indicates the number of standby nodes that need to wait for responses from the transaction, standby_name indicates the name of the standby node, and FIRST and ANY specify the policies for selecting standby nodes for synchronous replication from the listed servers.
- ANY N (dn_instanceId1, dn_instanceId2,...) indicates that any N host names in the brackets are selected as the name list of standby nodes for synchronous replication. For example, ANY 1(dn_instanceId1, dn_instanceId2) indicates that either of dn_instanceId1 or dn_instanceId2 is used as the standby node for synchronous replication.
- FIRST N (dn_instanceId1, dn_instanceId2, ...) indicates that the first N primary node names in the brackets are selected as the standby node name list for synchronous replication based on the priority. For example, FIRST 1 (dn_instanceId1, dn_instanceId2) indicates that dn_instanceId1 is selected as the standby node for synchronous replication.
- The meanings of dn_instanceId1, dn_instanceId2, ... are the same as those of FIRST 1 (dn_instanceId1, dn_instanceId2, ...).
This parameter is maintained by the CM. If it is manually modified, data may be lost. For details, see "Unified Cluster Management Tool > Features > Automatic Copy Addition and Reduction by Shard > Remarks" in Tool Reference.
If you use the gs_guc tool to set this parameter, perform the following operations:
gs_guc reload -Z datanode -N @NODE_NAME@ -D @DN_PATH@ -c "synchronous_standby_names='ANY NODE 1(dn_instanceId1, dn_instanceId2)'";
or
gs_guc reload -Z datanode -N @NODE_NAME@ -D @DN_PATH@ -c "synchronous_standby_names='ANY 1(AZ1, AZ2)'";
Default value: *
most_available_sync
Parameter description: Specifies whether transactions on the primary node are not blocked due to faults on synchronous standby nodes. For example, if one of the two synchronous standby nodes is faulty and the other is normal, the primary node waits for the normal synchronous standby node instead of being blocked by the faulty synchronous standby node.
For another example, the quorum protocol is executed and one primary node and three synchronous standby nodes are configured by using ANY 2(node1,node2,node3). When node 1 and node 3 are faulty and node 2 is normal, services on the primary node are not blocked.
This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
Value range: Boolean
- on indicates that the primary node is not blocked when all synchronous standby nodes are faulty.
- off indicates that the primary node is blocked when all synchronous standby nodes are faulty.
Default value: off
keep_sync_window
Parameter description: Specifies the delay for entering the maximum availability mode.
- If most_available_sync is set to on, when synchronous standby nodes are faulty in primary/standby scenarios and the number of configured synchronous standby nodes is insufficient (for details, see the meaning of synchonous_standby_name), setting keep_sync_window will retain the maximum protection mode within the time window specified by keep_sync_window. That is, committing transactions on the primary node is blocked, delay the primary node to enter the maximum availability mode.
- If synchronous standby nodes recover from faults and the number of synchronous standby nodes meets the configuration requirements, transactions are not blocked.
- You are advised to set keep_sync_window to 5s. This prevents the monitoring system from incorrectly reporting network instability.
This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
Value range: an integer ranging from 0 to INT_MAX. The unit is second.
- The value 0 indicates that the keep_sync_window is not set, that is, the maximum availability mode is entered directly.
- Other values indicate the size of the timeout window.
Default value: 0
Setting this parameter may affect the RPO. If the primary node is faulty within the configured timeout window, the data generated from the time when the primary node is blocked to the time when the primary node is faulty may be lost.
enable_stream_replication
Parameter description: Specifies whether data and logs are synchronized between the primary and standby nodes.
This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
- This parameter is used for performance testing in scenarios where data synchronization to standby nodes is enabled and where it is disabled. If this parameter is set to off, tests on abnormal scenarios, such as switchover and faults, cannot be performed to prevent inconsistency between the primary and standby nodes.
- This is a restricted parameter, and you are advised not to set it to off in normal service scenarios.
Value range: Boolean
- on indicates that data and log synchronization between the primary and standby nodes is enabled.
- off indicates that data and log synchronization between the primary and standby nodes is disabled.
Default value: on
enable_mix_replication
Parameter description: Specifies how WAL files and data are replicated between the primary and standby nodes.
This parameter is an INTERNAL parameter. Its default value is off and cannot be modified.
- This parameter cannot be modified in normal service scenarios. That is, mixed replication of the WAL files and data pages is disabled.
Value range: Boolean
- on indicates that the WAL file and data page mixed replication mode is enabled.
- off indicates that the WAL file and data page mixed replication mode is disabled.
Default value: off
vacuum_defer_cleanup_age
Parameter description: Specifies the number of transactions by which VACUUM will defer the cleanup of invalid row-store table records. That is, VACUUM and VACUUM FULL do not clean up deleted tuples immediately.
This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
Value range: an integer ranging from 0 to 1000000. 0 means no delay.
Default value: 0
data_replicate_buffer_size
Parameter description: Specifies the amount of memory used by queues when the sender sends data pages to the receiver. The value of this parameter affects the buffer size used during the replication from the primary node to the standby node.
This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.
Value range: an integer ranging from 4096 to 1072693248. The unit is KB.
Default value:
128MB (196-core CPU/1536 GB memory, 128-core CPU/1024 GB memory, 104-core CPU/1024 GB memory, 96-core CPU/1024 GB memory, 96-core CPU/768 GB memory, 80-core CPU/640 GB memory, 64-core CPU/512 GB memory, 60-core CPU/480 GB memory, 32-core CPU/256 GB memory, 16-core CPU/128 GB memory, 8-core CPU/64 GB memory, 4-core CPU/32 GB memory); 4MB (4-core CPU/16 GB memory)
Setting suggestion: Retain the default value. Do not set data_replicate_buffer_size to an excessively large or small value. The following condition must be met: data_replicate_buffer_size + segment_buffers + shared_buffers + wal_buffers + temp_buffers + maintenance_work_mem + work_mem + query_mem + (Standby node) wal_receiver_buffer_size < max_process_memory < Memory size of the physical machine. If the value of the memory parameter is too large and exceeds the upper limit of the physical memory, the database cannot be started because it cannot allocate sufficient memory.
walsender_max_send_size
Parameter description: Specifies the size of the log or data sending buffer on the primary node.
This is a POSTMASTER parameter. Set it based on instructions provided in Table 1.
Value range: an integer ranging from 8 to INT_MAX. The unit is KB.
Default value: 8MB (that is, 8192 KB)
enable_data_replicate
Parameter description: Specifies how data is synchronized between the primary and standby nodes when the data is imported to a row-store table.
This is a USERSET parameter. Set it based on instructions provided in Table 1.
Value range: Boolean
- on indicates that the primary and standby nodes synchronize data using data pages when the data is imported to a row-store table. When replication_type is set to 1, this parameter cannot be set to on. If this parameter is set to on using the GUC tool, its value will be forcibly changed to off.
- off indicates that the primary and standby nodes synchronize data using Xlogs when the data is imported to a row-store table.
Default value: off
ha_module_debug
Parameter description: Specifies the replication status log of a specific data block during data replication.
This is a USERSET parameter. Set it based on instructions provided in Table 1.
Value range: Boolean
- on indicates that the status of each data block is recorded in logs during data replication.
- off indicates that the status of each data block is not recorded in logs during data replication.
Default value: off
catchup2normal_wait_time
Parameter description: Specifies the maximum duration for the standby node to catch up with the primary node when most_available_sync is enabled in primary/standby scenarios. The value of this parameter is an estimate and may be different from the actual value.
This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
Value range: an integer ranging from –1 to 10000. The unit is ms.
- The value –1 indicates that the primary node is blocked until the data catchup on the standby node is complete.
- The value 0 indicates that the primary node is not blocked during the data catchup on the standby node.
- Other values indicate the maximum duration that the primary node is blocked during the data catchup on the standby node. For example, if this parameter is set to 5000, the primary node is blocked until the data catchup on the standby node is complete in 5s.
Default value: –1
check_sync_standby
Parameter description: Specifies whether to enable the standby node check function. After the synchronous_standby_names parameter is correctly configured in the primary/standby scenario, if the synchronous standby node is faulty, the write service on the primary node reports a write failure. This is a USERSET parameter. Set it based on instructions provided in Table 1.
Value range: on or off
- on indicates that the standby node check is enabled.
- off indicates that the standby node check is disabled.
Default value: off
- This parameter cannot be synchronized in job work and autonomous transactions. Otherwise, the check may not take effect.
- If the standby node check is not configured for a specified user or session and the standby node is faulty when the forcible synchronization commit mode is enabled, the write operation on a table causes the query on the same table by another user or in another session to hang. In this case, you need to recover the standby node or manually terminate the hung client.
- The standby node check function cannot be enabled in scenarios (such as VACUUM ANALYZE) where non-write operations trigger log writing. If the standby node does not meet the requirements for synchronizing configurations to the standby node, services will be hung in this scenario. In this case, you need to manually terminate the services.
sync_config_strategy
Parameter description: Specifies the policy for synchronizing configuration files between the primary node and standby node, and between the standby node and cascaded standby node.
This is a USERSET parameter. Set it based on instructions provided in Table 1.
Value range: enumerated values
- all_node: If this parameter is set to all_node for the primary node, the primary node is allowed to proactively synchronize configuration files to all standby nodes. If this parameter is set to all_node for a standby node, the standby node is allowed to send synchronization requests to its primary node, and the standby node is allowed to proactively synchronize configuration files to all cascaded standby nodes. If this parameter is set to all_node for a cascaded standby node, the current cascaded standby node is allowed to send synchronization requests to its standby node.
- only_sync_node: If this parameter is set to only_sync_node for the primary node, the primary node is only allowed to proactively synchronize configuration files to all standby nodes. If this parameter is set to only_sync_node for a standby node, the standby node is allowed to send synchronization requests to its primary node, and the standby node is not allowed to proactively synchronize configuration files to all cascaded standby nodes. If this parameter is set to only_sync_node for a cascaded standby node, the current cascaded standby node is allowed to send synchronization requests to its standby node.
- none_node: If this parameter is set to none_node for the primary node, the primary node is not allowed to proactively synchronize configuration files to all standby nodes. If this parameter is set to none_node for a standby node, the standby node is not allowed to send synchronization requests to its primary node, and the standby node is allowed to proactively synchronize configuration files to all cascaded standby nodes. If this parameter is set to none_node for a cascaded standby node, the current cascaded standby node is not allowed to send synchronization requests to its standby node.
Default value: all_node
hadr_recovery_time_target
Parameter description: Specifies whether the standby database instance completes log writing and replay in streaming DR mode.
This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
Value range: an integer ranging from 0 to 3600. The unit is second.
0 indicates that log flow control is disabled. A value from 1 to 3600 indicates that a standby node can write and replay logs within the period specified by hadr_recovery_time_target. This ensures that the logs can be written and replayed within the period specified by hadr_recovery_time_target and the standby database instance can be promoted to primary quickly. If this parameter is set to a small value, the performance of the primary node is affected. If it is set to a large value, the log flow is not effectively controlled.
Default value: 0
hadr_recovery_point_target
Parameter description: Specifies the RPO time allowed for the standby database instance to flush logs to disks in streaming DR mode.
This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
Value range: an integer ranging from 0 to 3600. The unit is second.
0 indicates that log flow control is disabled. A value from 1 to 3600 indicates that the standby node can flush logs to disks within the period specified by hadr_recovery_point_target. This ensures that the log difference between the primary and standby database instances is controlled within the period specified by hadr_recovery_point_target during the switchover and the standby database instance can be promoted to primary. If this parameter is set to a small value, the performance of the primary node is affected. If it is set to a large value, the log flow is not effectively controlled.
Default value: 0
hadr_super_user_record_path
Parameter description: Specifies the path for storing encrypted files of the hadr_disaster user in the standby database instance in streaming DR mode. This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
Modification suggestion: The value is automatically set by the streaming DR password transfer tool and does not need to be manually added.
Value range: a string.
Default value: NULL
- In a database instance that contains a primary node, and a standby node, the primary node is a sender relative to the standby node and the standby node is a receiver relative to the primary node.
- The sender actively synchronizes the configuration file to the receiver, and the receiver requests the sender to synchronize the configuration file, which are two independent events, so that the configuration files are synchronized. If you do not want to synchronize configuration files, set this parameter to none_node on the receiver. If the sender is a standby node, set this parameter to none_node only. If the sender is a primary node, set this parameter to none_node when the primary node does not synchronize with any standby node; or set this parameter to only_sync_node when the primary node synchronizes with synchronous standby nodes only and does not synchronize with asynchronous standby nodes.
- To be specific, the sender sends a configuration file which directly overwrites the corresponding parameter in the configuration file of the receiver. After the policy for synchronizing configuration files is set, even if you modify configuration parameters of the receiver, the modification does not take effect because the sender immediately overwrites these parameters.
- The following configuration parameters are not synchronized even if the policy for synchronizing configuration files is set: application_name, audit_directory, available_zone, comm_control_port, comm_sctp_port, listen_addresses, log_directory, port, replconninfo1, replconninfo2, replconninfo3, replconninfo4, replconninfo5, replconninfo6, replconninfo7, replconninfo8, replconninfo9, replconninfo10, replconninfo11, replconninfo12, replconninfo13, replconninfo14, replconninfo15, replconninfo16, replconninfo17, replconninfo18, ssl, ssl_ca_file, ssl_cert_file, ssl_ciphers, ssl_crl_file, ssl_key_file, ssl_renegotiation_limit, ssl_cert_notify_time, synchronous_standby_names, local_bind_address, perf_directory, query_log_directory, asp_log_directory, streaming_router_port, enable_upsert_to_merge, recovery_min_apply_delay, and sync_config_strategy.
enable_wal_sender_crc_check
Parameter description: Specifies whether to enable CRC for the WAL sender thread. CRC is performed before the primary node sends logs. If this parameter is enabled, the performance may deteriorate by less than 5%.
This is a SIGHUP parameter. Set it based on instructions provided in Table 1.
Value range: Boolean
- on indicates that the check function is enabled.
- off indicates that the check function is disabled.
Default value: on
Feedback
Was this page helpful?
Provide feedbackThank you very much for your feedback. We will continue working to improve the documentation.See the reply and handling status in My Cloud VOC.
For any further questions, feel free to contact us through the chatbot.
Chatbot