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

DCF Parameters Settings

enable_dcf

Parameter description: Specifies whether to enable the DCF mode.

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

Value range: Boolean. The value can be on or off. on indicates that the current log replication mode is DCF, and off indicates that the current log replication mode is not DCF.

Default value: off

dcf_ssl

Parameter description: This parameter is no longer used. The DCF reuses the GUC parameter ssl. For details, see section "Security and Authentication."

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

Value range: Boolean. The value can be on or off. The value on indicates that SSL is used, and the value off indicates that SSL is not used.

Default value: on

dcf_config

Parameter description: Specifies the DCF cluster configuration information, which is configured by the OM during installation and cannot be modified after installation.

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

Default value: a character string, which is configured by the OM during installation.

dcf_data_path

Parameter description: Specifies the DCF data path, which is configured by the OM during installation and cannot be modified after installation.

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

Default value: a string, which is the dcf_data directory under the data directory of the DN.

dcf_log_path

Parameter description: Specifies the DCF log path, which is configured by the OM during installation and cannot be modified after installation.

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

Default value: a string, which is the dcf_log directory under the data directory of the DN.

dcf_node_id

Parameter description: Specifies the ID of the DN where the DCF is located. This parameter is defined by the user during installation and mode switching.

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

Default value: an integer, which is specified by users during installation.

dcf_max_workers

Parameter description: Specifies the largest number of DCF callback function threads. The DCF needs to apply for the shared memory and semaphore before it invokes the function registered by the DN with the DCF through the callback function.

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

Value range: an integer ranging from 0 to 262143.

Default value: 40

dcf_truncate_threshold

Parameter description: Specifies the threshold for a DN to truncate DCF logs.

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

Value range: an integer ranging from 1 to 2147483647.

Default value: 100000

dcf_election_timeout

Parameter description: Specifies the timeout interval for selecting the DCF leader and follower. The election timeout interval depends on the status of the network between DNs. If the timeout interval is short and the network quality is poor, timeout occurs. After the network recovers, the election becomes normal. You are advised to set a proper timeout interval based on the current network status. Restriction on the DCF node clock: The maximum clock difference between DCF nodes is less than half of the election timeout interval. In DCF manual election mode, to ensure timely CM arbitration, do not modify this parameter. Instead, use the default election timeout interval.

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

Value range: an integer ranging from 1 to 600, in seconds.

Default value: 3

dcf_enable_auto_election_priority

Parameter description: Specifies whether the DCF priority can be automatically adjusted. The value 0 indicates that automatic adjustment is not allowed, and the value 1 indicates that automatic adjustment is allowed.

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

Value range: an integer, 0 or 1.

Default value: 1

dcf_election_switch_threshold

Parameter description: Specifies the DCF threshold for preventing frequent switchover to primary. It is recommended that this parameter be set based on the maximum fault duration acceptable for user services.

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

Value range: an integer ranging from 0 to 2147483647, in seconds.

Default value: 0

dcf_run_mode

Parameter description: Specifies the DCF election mode. The value 0 indicates the automatic election mode, the value 1 indicates the manual election mode, and the value 2 indicates that the election mode is disabled. Currently, the election mode can be disabled only in minority restoration scenarios. If the election mode is disabled, the database instance will become unavailable.

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

Note: The working mode of an instance can be switched only when the instance is running properly. Otherwise, the instance is still abnormal after the switching. The DCF working mode configured in GUC parameters must be the same as that configured by using cm_ctl. That is, both DCF working modes must be set to manual or automatic at the same time.

For example, to set the DCF manual mode, run the following command:
cm_ctl set --param --server -k dn_arbitrate_mode=quorum
cm_ctl reload --param --server
gs_guc reload -Z datanode -I all -N all  -c "dcf_run_mode=1"
To set the DCF automatic mode, run the following command:
cm_ctl set --param --server -k dn_arbitrate_mode=paxos
cm_ctl reload --param --server
gs_guc reload -Z datanode -I all -N all  -c "dcf_run_mode=0"

Value range: 0, 1, or 2

Default value: 1

dcf_log_level

Parameter description: Specifies the DCF log level.

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

Value range: a string

  • To disable the log function, set this parameter to "NONE", which cannot be used together with the following log levels:
  • To enable the log function, set this parameter to one or a combination of the following log levels: "RUN_ERR|RUN_WAR|RUN_INF|DEBUG_ERR|DEBUG_WAR|DEBUG_INF|TRACE|PROFILE|OPER".

    If two or more log levels are used together, separate them with vertical bars (|). The log level cannot be set to an empty string.

Default value: "RUN_ERR|RUN_WAR|DEBUG_ERR|OPER|RUN_INF|PROFILE"

dcf_log_backup_file_count

Parameter description: Specifies the number of DCF run log backups.

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

Value range: an integer ranging from 1 to 1000.

Default value: 100

dcf_max_log_file_size

Parameter description: Specifies the maximum size of a DCF run log file.

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

Value range: an integer ranging from 1 to 1000, in MB.

Default value: 10

dcf_socket_timeout

Parameter description: Specifies the timeout interval for the DCF communication module to connect to the socket. This parameter takes effect upon the system restart. In an environment where the network quality is poor, if the timeout interval is set to a small value, a connection may fail to be set up. In this case, you need to increase the value.

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

Value range: an integer ranging from 10 to 600000, in ms.

Default value: 5000

dcf_connect_timeout

Parameter description: Specifies the timeout interval for the DCF communication module to set up a connection. This parameter takes effect upon the system restart. In an environment where the network quality is poor, if the timeout interval is set to a small value, a connection may fail to be set up. In this case, you need to increase the value.

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

Value range: an integer ranging from 10 to 600000, in ms.

Default value: 60000

dcf_mec_fragment_size

Parameter description: Specifies the fragment size of the DCF communication module. This parameter takes effect upon the system restart.

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

Value range: an integer ranging from 32 to 10240, in KB.

Default value: 64

dcf_stg_pool_max_size

Parameter description: Specifies the maximum size of the memory pool of the DCF storage module. This parameter takes effect upon the system restart.

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

Value range: an integer ranging from 32 to 2147483647, in MB.

Default value: 2048

dcf_stg_pool_init_size

Parameter description: Specifies the minimum size of the memory pool of the DCF storage module. This parameter takes effect upon the system restart.

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

Value range: an integer ranging from 32 to 2147483647, in MB.

Default value: 32

dcf_mec_pool_max_size

Parameter description: Specifies the maximum size of the memory pool of the DCF communication module. This parameter takes effect upon the system restart.

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

Value range: an integer ranging from 32 to 2147483647, in MB.

Default value: 200

dcf_flow_control_disk_rawait_threshold

Parameter description: Specifies the disk waiting threshold for DCF flow control.

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

Value range: an integer ranging from 0 to 2147483647, in μs.

Default value: 100000

dcf_flow_control_net_queue_message_num_threshold

Parameter description: Specifies the threshold for the number of messages in a network queue for DCF flow control.

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

Value range: an integer ranging from 0 to 2147483647.

Default value: 1024

dcf_flow_control_cpu_threshold

Parameter description: Specifies the threshold for DCF CPU flow control.

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

Value range: an integer ranging from 0 to 2147483647, in percentage (%).

Default value: 100

dcf_mec_batch_size

Parameter description: Specifies the number of batch messages for DCF communication. When the value is 0, the DCF automatically adjusts the value based on the network and the amount of data to be written. This parameter takes effect upon the system restart.

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

Value range: an integer ranging from 0 to 1024.

Default value: 0

dcf_mem_pool_max_size

Parameter description: Specifies the maximum DCF memory. This parameter takes effect upon the system restart.

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

Value range: an integer ranging from 32 to 2147483647, in MB.

Default value: 2048

dcf_mem_pool_init_size

Parameter description: Specifies the initial size of the DCF memory. This parameter takes effect upon the system restart.

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

Value range: an integer ranging from 32 to 2147483647, in MB.

Default value: 32

dcf_compress_algorithm

Parameter description: Specifies the compression algorithm for DCF run log transmission.

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

Value range: an integer

  • The value 0 indicates no compression.
  • 1 indicates the LZ4 compression algorithm.

Default value: 0

dcf_compress_level

Parameter description: Specifies the compression level for DCF log transmission. Before this parameter takes effect, a valid compression algorithm must be configured, that is, the dcf_compress_algorithm parameter is set.

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

Value range: an integer ranging from 1 to 22.

If compression is disabled, the configured compression level does not take effect.

Default value: 1

dcf_mec_channel_num

Parameter description: Specifies the number of DCF communication channels. This parameter takes effect upon the system restart.

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

Value range: an integer ranging from 1 to 64.

Default value: 1

dcf_rep_append_thread_num

Parameter description: Specifies the number of DCF log replication threads. This parameter takes effect upon the system restart.

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

Value range: an integer ranging from 1 to 1000.

Default value: 2

dcf_mec_agent_thread_num

Parameter description: Specifies the number of DCF communication working threads. This parameter takes effect upon the system restart. It is recommended that the value of dcf_mec_agent_thread_num be greater than or equal to 2 x Number of nodes x Value of dcf_mec_channel_num.

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

Value range: an integer ranging from 1 to 1000.

Default value: 10

dcf_mec_reactor_thread_num

Parameter description: Specifies the number of reactor threads used by the DCF. This parameter takes effect upon the system restart. It is recommended that the ratio of the value of dcf_mec_reactor_thread_num to the value of dcf_mec_agent_thread_num be 1:40.

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

Value range: an integer ranging from 1 to 100.

Default value: 1

dcf_log_file_permission

Parameter description: Specifies the attribute of the DCF run log file. The parameter setting takes effect after the system is restarted. This parameter is configured during installation and cannot be modified. To allow other users in the same group to access logs, ensure that all parent directories can be accessed by other users in the same group. That is, if dcf_log_path_permission is set to 750, dcf_log_file_permission can only be set to 600 or 640. If dcf_log_path_permission is set to 700, dcf_log_file_permission must be set to 600.

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

Value range: enumerated type. The value can be 600 or 640.

Default value: 600

dcf_log_path_permission

Parameter description: Specifies the attribute of the DCF run log directory. The parameter setting takes effect after the system is restarted. This parameter is configured during installation and cannot be modified. To allow other users in the same group to access the log path, set this parameter to 750. Otherwise, set this parameter to 700.

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

Value range: enumerated type. The value can be 700 or 750.

Default value: 700

dcf_majority_groups

Parameter description: Sets the DCF policy-based majority function. For a group that requires this parameter, at least one standby node in the group receives logs. That is, there is a synchronous standby node in the group. If nodes are added to or deleted from the DCF instance or the group value of a node in the instance is changed, you need to modify the configuration accordingly. When modifying this parameter, ensure that the value of group exists and is valid.

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

Value range: a string

  • To disable the policy-based majority function, enter an empty string "".
  • To enable the function, configure valid group values separated by commas (,). The group values must exist in dcf_config. For example, if the group values 1 and 2 are added to the DCF policy-based majority configuration, you can set this parameter to "1,2". If the group value does not exist in dcf_config or other characters are configured, the DCF considers the configured group invalid.

Default value: an empty string

If all nodes in a group are faulty after the parameter is configured, you need to remove the group from the parameter list when performing node build operations (node recovery or node replacement without changing the IP address) on a node. After the node recovers, you can configure the group again.

dcf_node_id_map

Parameter description: Specifies the dictionary mapping between standby DN names and DCF node IDs. The parameter setting takes effect after the system is restarted. This parameter is configured during installation and cannot be modified. This parameter is used in DCF cluster installation, upgrade, and node replacement scenarios. The value of standby_name configured in the GUC parameter synchronous_standby_names must be included in this dictionary.

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

Value range: a string. The configuration format is 'standby_name1:dcf_node_id1,standby_name2:dcf_node_id2'. The values of standby DN names and the corresponding DCF node IDs are separated by commas (,).

Default value: an empty string

dcf_candidate_names

Parameter description: Specifies the DCF candidate list. That is, names of DNs that may be selected as the primary node. In DCF automatic mode, the election policy is controlled by this parameter. DNs not in the list cannot be elected as a primary node.

Parameter type: string

Unit: none

Value range: a string in the format of 'dn_name1,dn_name2,dn_name3'. The parameter depends on dcf_node_id_map. DN names must be in dcf_node_id_map and separated by commas (,).

Default value: an empty string

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

Setting suggestion: none

dcf_thread_effective_time

Parameter description: Specifies the effective time of the DCF flushing thread. This parameter is used to determine whether the disk I/O hangs. If the DCF control log cannot update and I/O resources cannot be accessed within the period specified by this parameter, the DCF considers that the thread I/O hangs and the switchover is triggered. If this parameter is set to 0, the I/O hang detection is disabled.

Parameter type: integer

Unit: second

Value range: 0 to 1000

Default value: 160

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

Setting suggestion: none

dcf_pri_leader_timeout

Parameter description: Specifies the timeout interval for priority-based leader election. In DCF automatic mode, after priority-based leader election is enabled, the backup node triggers priority-based leader election. If the backup node is not elected as the leader within the timeout interval, the election is canceled. If this parameter is set to 0, the priority-based selection of the primary node waits until the election is successful.

Parameter type: integer

Unit: second

Value range: 0 to 3600

Default value: 60

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

Setting suggestion: none

dcf_static_leader_timeout

Parameter description: Specifies the timeout interval for preferentially electing the old leader. In DCF automatic mode, after the cluster is restarted, the old leader is preferentially elected. If the election fails within the timeout interval, the election is canceled.

Parameter type: integer

Unit: second

Value range: 0 to 600

Default value: 60

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

Setting suggestion: none