Updated on 2024-05-07 GMT+08:00

Cluster Transaction Parameters

This section describes the settings and value ranges of transaction parameters for the cluster.

transaction_isolation

Parameter description: specifies the isolation level of the current transaction.

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

Value range: a string of case-sensitive characters. The values include:

  • serializable: This value is equivalent to REPEATABLE READ in GaussDB.
  • read committed indicates that only the data in committed transactions will be read.
  • repeatable read indicates that only the data committed before transaction start is read. Uncommitted data or data committed in other concurrent transactions cannot be read.
  • read uncommitted indicates that data is readable at any time.
  • default: The value is the same as that of default_transaction_isolation.

Default value: read committed

transaction_read_only

Parameter description: Specifies whether the current transaction is a read-only transaction.

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

Value range: Boolean

  • on indicates that the current transaction is a read-only transaction.
  • off indicates that the current transaction can be a read/write transaction.

Default value: off

xc_maintenance_mode

Parameter description: Specifies whether the system is in maintenance mode.

This parameter is a SUSET parameter. Set it based on method 3 in Table 2.

Value range: Boolean

  • on indicates that the system is in maintenance mode.
  • off indicates that the system is not in maintenance mode.

Exercise caution when setting this parameter to on to avoid data inconsistencies in the cluster.

Default value: off

allow_concurrent_tuple_update

Parameter description: Specifies whether to allow concurrent update.

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

Value range: Boolean

  • on indicates that concurrent update is allowed.
  • off indicates that concurrent update is disallowed.

Default value: on

gtm_host

Parameter description: Specifies the IP address of the primary GTM process. This parameter is visible only to the sysadmin user.

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

Value range: a string

Default value: IP address of the primary GTM

gtm_port

Parameter description: Specifies the listening port of the primary GTM process. This parameter is visible only to the sysadmin user.

This parameter is a POSTMASTER parameter.

This parameter is specified in the configuration file during installation. Do not modify this parameter unless absolutely necessary. Otherwise, database communication will be affected.

Value range: an integer ranging from 1 to 65535

Default value: specified during installation

gtm_host1

Parameter description: Specifies the IP address of the standby GTM process. This parameter is visible only to the sysadmin user.

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

Value range: a string

Default value: IP address of the standby GTM

gtm_port1

Parameter description: Specifies the listening port of the standby GTM process. This parameter is visible only to the sysadmin user.

This parameter is a POSTMASTER parameter.

This parameter is specified in the configuration file during installation. Do not modify this parameter unless absolutely necessary. Otherwise, database communication will be affected.

Value range: an integer ranging from 1 to 65535

Default value: The value is specified during installation if the standby GTM 1 is deployed. Otherwise, the value is 6665.

pgxc_node_name

Parameter description: Specifies the name of a node.

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

When a standby node requests to replicate logs on the primary node, if the application_name parameter is not set, the pgxc_node_name parameter is used as the name of the streaming replication slot of the standby node on the primary node. The streaming replication slot is named in the following format: Value of this parameter_IP address of the standby node_Port number of the standby node. The IP address and port number of the standby node are obtained from the IP address and port number of the standby node specified by the replconninfo parameter. The maximum length of a streaming replication slot name is 61 characters. If the length of the concatenated string exceeds 61 characters, the truncated pgxc_node_name will be used for concatenation to ensure that the length of the streaming replication slot name is less than or equal to 61 characters.

After this parameter is modified, the cluster will fail to be connected. You are advised not to modify this parameter.

Value range: a string

Default value: current node name

gtm_backup_barrier

Parameter description: Specifies whether to create a restoration point for the GTM starting point.

This parameter is a SUSET parameter. Set it based on instructions provided in Table 2.

Value range: Boolean

  • on indicates that a restoration point will be created for the GTM starting point.
  • off indicates that a restoration point will not be created for the GTM starting point.

Default value: off

gtm_conn_check_interval

Parameter description: Sets the intervals between two consecutive performed checks performed by the CN on the connections between local threads and the primary GTM.

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

Value range: an integer ranging from 0 to 2147483. The unit is s.

Default value: 10s

transaction_deferrable

Parameter description: Specifies whether to delay the execution of a read-only serial transaction without incurring an execution failure. Assume this parameter is set to on. When the server detects that the tuples read by a read-only transaction are being modified by other transactions, it delays the execution of the read-only transaction until the other transactions finish modifying the tuples. This parameter is reserved and does not take effect in this version. Similar to this parameter, the default_transaction_deferrable parameter is used to specify whether to allow delayed execution of a transaction.

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

Value range: Boolean

  • on indicates that the execution of a read-only serial transaction can be delayed.
  • off indicates that the execution of a read-only serial transaction cannot be delayed.

Default value: off

enable_show_any_tuples

Parameter description: This parameter is available only in a read-only transaction and is used for analysis. When this parameter is set to on or true, all versions of tuples in the table are displayed.

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

Value range: Boolean

  • on or true indicates that all versions of tuples in the table are displayed.
  • off or false indicates that no versions of tuples in the table are displayed.

Default value: off

gtm_connect_timeout

Parameter description: Specifies the GTM connection timeout. If the connection time of the GTM exceeds its value, the connection times out and exits.

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

Value range: an integer ranging from 1 to 2147483647. The unit is s.

Default value: 2s

gtm_connect_retries

Parameter description: Specifies the number of GTM reconnection attempts.

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

Value range: an integer ranging from 1 to 2147483647

Default value: 30

gtm_rw_timeout

Parameter description: Specifies the GTM response timeout. If the time spent waiting for GTM responses exceeds its value, the operation times out and exits.

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

Value range: an integer ranging from 1 to 2147483647. The unit is s.

Default value: 1min

enable_redistribute

Parameter description: Specifies whether unmatched nodes are redistributed.

This parameter is a SUSET parameter. Set it based on instructions provided in Table 2.

Value range: Boolean

  • on indicates that unmatched nodes are redistributed.
  • off indicates that unmatched nodes are not redistributed.

Default value: off

replication_type

Parameter description: Specifies whether the current HA mode is primary/standby/secondary, one primary multiple standbys, or single primary.

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

This parameter is used for CM deployment. Do not set it.

Value range: 0 to 2

  • 0: indicates that the HA nodes consist of a primary, a standby, and a secondary node.
  • 1 Indicates that the one-primary-multiple-standby mode is used, covering all scenarios. This mode is recommended.
  • 2 Indicates the single primary mode. In this mode, the standby node cannot be expanded.

Default value: 1

enable_gtm_free

Parameter description: Specifies whether the GTM-Free mode is enabled. In large concurrency scenarios, the snapshots delivered by the GTM increase in number and size. The network between the GTM and the CN becomes the performance bottleneck. The GTM-Free mode is used to eliminate the bottleneck. In this mode, the CN communicates with DNs instead of the GTM. The CN sends queries to each DN, which locally generates snapshots and xids, ensuring external write consistency but not external read consistency.

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

When the GTM-Free mode is used, you are advised to set application_type to perfect_sharding_type so that you can find SQL statements that may cause data inconsistency. Otherwise, the system does not intercept statements that may cause data inconsistency.

Value range: Boolean

  • on indicates that the GTM-FREE mode is enabled and the cluster ensures eventual read consistency.
  • off indicates that the GTM-FREE mode is disabled.

Default value: off

enable_twophase_commit

Parameter description: Specifies whether to enable distributed two-phase commit in the GTM-Free mode adopted to address the replacement issues of SDS in the cloud database. This parameter is a USERSET parameter. Set it based on instructions provided in Table 2.

Value range: Boolean

  • on indicates that distributed two-phase commit is allowed in the GTM-Free mode.
  • off indicates that distributed two-phase commit is not allowed in the GTM-Free mode.

Default value: on

application_type

Parameter description: valid only when enable_gtm_free is set to on. This parameter specifies the service type of a user. This parameter is a USERSET parameter. Set it based on instructions provided in Table 2. This parameter cannot be set using gs_guc. Only the following ways are allowed:

  1. Use the gsql client to perform session-level configuration.
  2. When JDBC is used to connect to the database, set the ApplicationType parameter for the connection string.

Value range: enumerated values

  • not_perfect_sharding_type indicates a service across nodes. If this value is used, statements across nodes can be executed.
  • perfect_sharding_type indicates a service on a single node. If this value is used and the SQL statement involves multiple nodes, an error is reported. The corresponding SQL statement is recorded in the system log.
    • If this value is used, you can run the /*+ multinode */ hint command to allow SQL statements to be executed on multiple nodes. The multinode hint can be added after the select, insert, update, delete, and merge keywords.

gtm_host2

Parameter description: Specifies the host name or IP address of the standby GTM 2 if the standby GTM 2 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: a string

Default value: the IP address of the standby GTM 2 if the standby GTM 2 is deployed. Otherwise, the value is "".

gtm_host3

Parameter description: Specifies the host name or IP address of the standby GTM 3 if the standby GTM 3 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: a string

Default value: the IP address of the standby GTM 3 if the standby GTM 3 is deployed. Otherwise, the value is "".

gtm_host4

Parameter description: Specifies the host name or IP address of the standby GTM 4 if the standby GTM 4 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: a string

Default value: the IP address of the standby GTM 4 if the standby GTM 4 is deployed. Otherwise, the value is "".

gtm_host5

Parameter description: Specifies the host name or IP address of the standby GTM 5 if the standby GTM 5 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: a string

Default value: the IP address of the standby GTM 5 if the standby GTM 5 is deployed. Otherwise, the value is "".

gtm_host6

Parameter description: Specifies the host name or IP address of the standby GTM 6 if the standby GTM 6 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: a string

Default value: the IP address of the standby GTM 6 if the standby GTM 6 is deployed. Otherwise, the value is "".

gtm_host7

Parameter description: Specifies the host name or IP address of the standby GTM 7 if the standby GTM 7 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: a string

Default value: the IP address of the standby GTM 7 if the standby GTM 7 is deployed. Otherwise, the value is "".

gtm_port2

Parameter description: Specifies the listening port of the standby GTM 2 if the standby GTM 2 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: an integer ranging from 1 to 65535

Default value: The value is specified during installation if the standby GTM 2 is deployed. Otherwise, the value is 6666.

gtm_port3

Parameter description: Specifies the listening port of the standby GTM 3 if the standby GTM 3 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: an integer ranging from 1 to 65535

Default value: The value is specified during installation if the standby GTM 3 is deployed. Otherwise, the value is 6666.

gtm_port4

Parameter description: Specifies the listening port of the standby GTM 4 if the standby GTM 4 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: an integer ranging from 1 to 65535

Default value: The value is specified during installation if the standby GTM 4 is deployed. Otherwise, the value is 6666.

gtm_port5

Parameter description: Specifies the listening port of the standby GTM 5 if the standby GTM 5 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: an integer ranging from 1 to 65535

Default value: The value is specified during installation if the standby GTM 5 is deployed. Otherwise, the value is 6666.

gtm_port6

Parameter description: Specifies the listening port of the standby GTM 6 if the standby GTM 6 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: an integer ranging from 1 to 65535

Default value: The value is specified during installation if the standby GTM 6 is deployed. Otherwise, the value is 6666.

gtm_port7

Parameter description: Specifies the listening port of the standby GTM 7 if the standby GTM 7 is deployed. This parameter is visible only to the sysadmin user.

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

Value range: an integer ranging from 1 to 65535

Default value: The value is specified during installation if the standby GTM 7 is deployed. Otherwise, the value is 6666.

enable_defer_calculate_snapshot

Parameter description: Specifies the delay in calculating xmin and oldestxmin. Calculation is triggered only when 1000 transactions are executed or the interval is 1s. If this parameter is set to on, the overhead of calculating snapshots can be reduced in heavy-load scenarios, but the progress of oldestxmin is slow, affecting tuple recycling. If this parameter is set to off, xmin and oldestxmin can be calculated in real time, but the overhead for calculating snapshots increases.

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

Value range: Boolean

  • on indicates that snapshots xmin and oldestxmin are calculated with a delay.
  • off indicates that snapshots xmin and oldestxmin are calculated in real time.

Default value: on