Updated on 2024-06-03 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 is a USERSET parameter. Set it based on instructions 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 is read.
  • repeatable read indicates that only the data committed before a transaction starts is read. Uncommitted data or data committed in other concurrent transactions cannot be read.
  • default: The value is the same as that of default_transaction_isolation.

Default value: read committed

transaction_read_only

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

This is a USERSET parameter. Set it based on instructions 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 is a SUSET parameter. Set it based on method 3 provided in Table 2.

Value range: Boolean

  • on indicates that the function is enabled.
  • off indicates that the function is disabled.

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 is a USERSET parameter. Set it based on instructions in Table 2.

Value range: Boolean

  • on indicates that the function is enabled.
  • off indicates that the function is disabled.

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 is a SIGHUP parameter. Set it based on instructions 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 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 is a SIGHUP parameter. Set it based on instructions 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 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 node 1 is deployed. Otherwise, the value is 6665.

pgxc_node_name

Parameter description: Specifies the name of a node.

This is a POSTMASTER parameter. Set it based on instructions 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 is a SUSET parameter. Set it based on instructions in Table 2.

Value range: Boolean

  • on indicates that a restoration point is created.
  • off indicates that no restoration point is created.

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 is a SIGHUP parameter. Set it based on instructions 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 is a USERSET parameter. Set it based on instructions in Table 2.

Value range: Boolean

  • on: allowed.
  • off: not allowed.

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 is a USERSET parameter. Set it based on instructions 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

In the TOAST scenario, if DML operations (mainly INSERT+UPDATE or INSERT+DELETE) are performed before and after the REINDEX operation, and the read-only transaction is started and the GUC parameter is enabled after the REINDEX operation, historical data in the TOAST table or TOAST index table can be queried separately in the released version. However, when historical data in the TOAST column is queried in the main table, the error message "missing chunk number xxx" is displayed.

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 is a SIGHUP parameter. Set it based on instructions 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 is a SIGHUP parameter. Set it based on instructions 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 is a SIGHUP parameter. Set it based on instructions 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 is a SUSET parameter. Set it based on instructions 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 database is deployed in standalone or one-primary-multiple-standby mode.

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

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

Value range: 0 to 2

  • 0: reserved parameter.
  • 1: one-primary-multiple-standby mode, covering all scenarios. This mode is recommended.
  • 2: 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 is a POSTMASTER parameter. Set it based on instructions 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 is a USERSET parameter. Set it based on instructions 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 is a USERSET parameter. Set it based on instructions 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 is a SIGHUP parameter. Set it based on instructions 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 is a SIGHUP parameter. Set it based on instructions 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 is a SIGHUP parameter. Set it based on instructions 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 is a SIGHUP parameter. Set it based on instructions 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 is a SIGHUP parameter. Set it based on instructions 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 is a SIGHUP parameter. Set it based on instructions 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 is a POSTMASTER parameter. Set it based on instructions in Table 2.

Value range: an integer ranging from 1 to 65535.

Default value: The value is specified during installation if the standby node 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 is a POSTMASTER parameter. Set it based on instructions in Table 2.

Value range: an integer ranging from 1 to 65535.

Default value: The value is specified during installation if the standby node 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 is a POSTMASTER parameter. Set it based on instructions in Table 2.

Value range: an integer ranging from 1 to 65535.

Default value: The value is specified during installation if the standby node 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 is a POSTMASTER parameter. Set it based on instructions in Table 2.

Value range: an integer ranging from 1 to 65535.

Default value: The value is specified during installation if the standby node 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 is a POSTMASTER parameter. Set it based on instructions in Table 2.

Value range: an integer ranging from 1 to 65535.

Default value: The value is specified during installation if the standby node 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 is a POSTMASTER parameter. Set it based on instructions in Table 2.

Value range: an integer ranging from 1 to 65535.

Default value: The value is specified during installation if the standby node 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 updating 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.

Parameter type: Boolean.

Unit: none

Value range:

  • 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

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

seqscan_csn_cache_num

Parameter description: Specifies the size of the CSN cache. The cache is used only when the Seq Scan scans the heap table page through the MVCC snapshot to determine the visibility. If this parameter is set to 0, the CSN cache mechanism is not used.

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

Value range: an integer ranging from 0 to 1000.

Default value: 100.