Skip to main content

KlustronDB System Variables

KlustronDBAbout 16 min

KlustronDB System Variables

In the KlustronDB cluster, there are two types of system variables: system variables of Kluscomp instances and system variables of Klustore instances. The following text will provide a detailed introduction to the specific contents of these two types of system variables.

1. Kluscomp system variables of the Kluscomp instance

KlustronDB clusters maintain many system variables that affect operations. On Kluscomp instances, most system variables can be configured during the startup of Kluscomp through configuration files, and their values can also be dynamically adjusted at runtime using set statements and reload. Before making configuration changes, it is essential to clearly understand the actual meaning of the system variables, the way to apply the configuration, and the variable type, in order to avoid configuration failures or more serious impacts on the use of KlustronDB.

In the Kluscomp instances of a KlustronDB cluster, there are several ways to set application system variables, which are introduced here in descending order of difficulty according to the application configuration requirements:

  • Internal, these settings cannot be changed directly; they reflect values determined internally. Some of them can be changed by rebuilding the server with different configuration options, or by changing the options provided to initdb.

  • Postmaster: These options are only used when the server starts, so any changes require restarting the server. The values of these settings are usually stored in the postgresql.conf file or passed to the command line when the server starts. Of course, any settings with a low-context type can also be set when the server starts. System variables of the Postmaster configuration type take effect only after executing the ALTER SYSTEM SET statement and then restarting the Kunlun server, and they will be persisted in the configuration file. After that, any new sessions will use the modified values. Note that using the SET command will return an error after modification.

  • Sighup: These settings can be changed in postgresql.conf without restarting the server. Sending a Sighup signal to the main process makes it reread postgresql.conf and apply the changes. The main process also passes the Sighup signal to its child processes, so they all use the new values. System variables of the Sighup configuration type require the use of the 'alter system set' statement, then after using 'reload', the current session will take effect immediately and will be persisted to the configuration file. New sessions or restarting the Kunlun server will apply the modified values. Note that using the 'set' command will return an error after modification.

  • Backend, these settings can be changed in postgresql.conf without restarting the server; they can also be set for a specific session in the connection request (for example, via libpq's PGOPTIONS environment variable). However, these settings never change after the session starts. If you change them in postgresql.conf, send a SIGHUP signal to the main process to make it reread postgresql.conf. The new values will only affect sessions that are loaded afterward. System variables of the Backend configuration type need to be executed with the ALTER SYSTEM SET statement, and after using reload, they will take effect for newly opened sessions but not for the current session. After modification, they will persist in the configuration file, and restarting Kluscomp will apply the modified values. Note that using the SET command will execute the modification but return an error.

  • SuperUser: These values can be set in postgresql.conf or set in a session using the SET command; however, only superusers can change them via SET. Changing them in postgresql.conf will only affect existing sessions when no session-local values have been established using SET. System variables of the SuperUser configuration type can only be executed using the SET command by superusers to take effect immediately in the current session. They can also be executed using the ALTER SYSTEM SET statement, and after a reload, they will take effect immediately in the current session and will persist in the configuration file. New sessions or restarting the Kunlun server will use the modified values.

  • User, these values can be set in postgresql.conf or set within a session using the SET command. Any user is allowed to change their session-local values. Changes in postgresql.conf will only affect existing sessions when no session-local values have been established using SET.System variables of the User configuration type can be executed by the user with the SET command, taking effect immediately in the current session, or executed using the ALTER SYSTEM SET statement, which will take effect immediately in the current session after a reload and will persist in the configuration file. New sessions or restarting the Kunlun server will apply the modified values.

Tips

  • Perform persistent operations on system variables using the reload method, see the System Variables FAQ section.
  • Among all the system variables, some are unique to KlustronDB. Here, only the system variables specific to KlustronDB Kluscomp instances are introduced.

Introduction to KlustronDB-Specific System Variables

Variable Nameautocommit
Variable MeaningWhether to enable auto-commit mode.
Variable TypeBoolean
Default ValueON
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namecheck_primary_interval_secs
Variable MeaningThe interval for checking the primary nodes of all storage shards and metashards.
Variable TypeInteger
Default Value3
Value Range[1,100]
Application RequirementUser
Introduced Versionv1.2
Variable Nameclient_connection_type
Variable MeaningThe client connection type, either MySQL or PG.
Variable TypeEnumeration
Default ValueFE_PG
Optional ValuesFE_UNKNOWN, FE_PG, FE_MYSQL
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namecluster_commitlog_group_size
Variable MeaningCommit log XID write group size.
Variable TypeInteger
Default Value8
Value Range[1,67108864]
Application RequirementPostmaster
Introduced Versionv1.2
Variable Namecomp_node_id
Variable MeaningThis is assigned to the Kluscomp instance when the Kluscomp instance is created.
Variable TypeInteger
Default Value
Value Range[0,2147483647]
Application Setting RequirementPostmaster
Introduced Versionv1.2
Variable Namedebug_remote_connection
Variable MeaningDisplays which shards are accessed during SQL execution in the form of a Notice. Used for functional debugging.
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namedeclared_mysql_server_version
Variable MeaningKunlunServer declares itself as the MySQL version to MySQL client connectors.
Variable TypeString
Default Value8.0.29
Application Setting RequirementSighup
Introduced Versionv1.2
Variable Namedefault_nulls_smallest
Variable MeaningWhen sorting in ascending order, null is treated as the smallest value by default.
Variable TypeBoolean
Default ValueON
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namedefault_pgsql_collation
Variable MeaningIf a given MySQL character set and collation does not have a valid PostgreSQL collation in pg_MySQL_collation_mapping, the default PostgreSQL collation for the MySQL session will be used.
Variable TypeString
Default Valueucs_basic
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_block_nestloop
Variable MeaningWhether to enable the block nestloop feature, thereby reducing the number of interactions with the Klustore instance.
Variable TypeBoolean
Default ValueON
Application RequirementUser
Introduced Versionv1.2
Variable Nameenable_catalog_security_policy
Variable MeaningAdd row-level security checks to system catalog relations to prevent users from seeing object names they do not have permission to access (e.g., table names, etc.).
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementPostmaster
Introduced Versionv1.2
Variable Nameenable_collation_pushdown
Variable MeaningPush down collation to Klustore instances.
Variable TypeBoolean
Default ValueON
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_coredump
Variable MeaningWhether to generate a core dump file when any PostgreSQL process catches a fatal signal. Core dump files are very useful for error diagnosis.
Variable TypeBoolean
Default ValueON
Application Setting RequirementSighup
Introduced Versionv1.2
Variable Nameenable_debug_remote_path
Variable MeaningUsed for optimizer debugging. Displays all alternative remote operators generated during query optimization.
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_flatten_correlated_sublink
Variable MeaningFlatten any subquery correlated to a semi-join.
Variable TypeBoolean
Default ValueON
Application ScopeUser
Introduced Versionv1.2
Variable Nameenable_global_deadlock_detection
Variable MeaningEnable global deadlock detection and resolution.
Variable TypeBoolean
Default ValueON
Application Setting RequirementSighup
Introduced Versionv1.2
Variable Nameenable_global_mvcc
Variable MeaningEnable global MVCC feature.
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementPostmaster
Introduced Versionv1.2
Variable Nameenable_olap_mode
Variable MeaningSet some parameters to optimize OLAP workloads.
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_parallel_remotescan
Variable MeaningTreat remote scan plans as parallel-safe to improve parallelism.
Variable TypeBoolean
Default ValueON
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_pg_mysql_charset_mapping_deduction
Variable MeaningSome mappings are deduced from documentation and public information. Whether to use such deduced mappings.
Variable TypeBoolean
Default ValueON
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_remote_agg_pushdown
Variable MeaningAttempt to push down aggregation to storage shards for better performance.
Variable TypeBoolean
Default ValueON
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_remote_cursor
Variable MeaningUse a cursor to fetch tuples from remote shards, provided enable_shard_binary_protocol is set.
Variable TypeBoolean
Default ValueOFF
Application RequirementUser
Introduced Versionv1.2
Variable Nameenable_remote_distinct_pushdown
Variable MeaningTry to push down the DISTINCT clause to storage shards for better performance.
Variable TypeBoolean
Default ValueON
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_remote_indexscan
Variable MeaningTry to create a remote index scan plan.
Variable TypeBoolean
Default ValueON
Application RequirementUser
Introduced Versionv1.2
Variable Nameenable_remote_join_pushdown
Variable MeaningAttempts to push down the table join if the left and right tables are in the same storage shard.
Variable TypeBoolean
Default ValueON
Applied Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_remote_limit_pushdown
Variable MeaningAttempt to push down the LIMIT clause to storage shards for better performance.
Variable TypeBoolean
Default ValueON
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_remote_orderby_pushdown
Variable MeaningAttempt to push down sorting to storage shards for better performance.
Variable TypeBoolean
Default ValueON
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_replica_read
Variable MeaningEnable replica read function to reduce the read load on the master.
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_shard_binary_protocol
Variable MeaningWhen the client communicates with the Kluscomp instance using the binary protocol, the Kluscomp instance also communicates with the shard using the MySQL binary protocol.
Variable TypeBoolean
Default ValueON
Application Setting RequirementSuperUser
Introduced Versionv1.2
Variable Nameenable_sql_log
Variable MeaningRecord the SQL sent to the storage shard into a separate SQL log for easier problem diagnosis.
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameenable_stacktrace
Variable MeaningWhether to print a stack trace to the server log file when any Postgres process catches a fatal signal. Stack traces are useful for error diagnosis.
Variable TypeBoolean
Default ValueON
Application Setting RequirementSighup
Introduced Versionv1.2
Variable Nameenable_stmt_subxact
Variable MeaningWraps user queries into internal subtransactions and rolls back the subtransaction in case of an error, instead of rolling back the entire transaction.
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameforce_remote_sql_parameterize
Variable MeaningParameterizes all constants in pushed-down SQL and communicates with the Klustore instance using the binary protocol.
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementSuperUser
Introduced Versionv1.2
Variable Nameforce_secure_file_access_proc
Variable MeaningForce the use of Unix sockets when calling file access functions.
Variable TypeBoolean
Default ValueON
Application Setting RequirementSighup
Introduced Versionv1.2
Variable Nameglobal_deadlock_detector_victim_policy
Variable MeaningSpecifies how the global deadlock detector selects a victim to terminate in order to resolve a global deadlock.
Variable TypeEnumeration
Default ValueKILL_MOST_ROWS_LOCKED
Valid ValuesKILL_OLDEST, KILL_YOUNGEST, KILL_MOST_ROWS_CHANGED, KILL_LEAST_ROWS_CHANGED, KILL_MOST_ROWS_LOCKED, KILL_MOST_WAITING_BRANCHES, KILL_MOST_BLOCKING_BRANCHES
Configuration Reload RequirementSIGHUP
Introduced in Versionv1.2
Variable Nameglobal_txn_commit_log_wait_max_secs
Variable MeaningTimeout period for writing transaction logs to the metadata server during a two-phase commit.
Variable TypeInteger
Default Value10
Value Range[1,100000]
UnitSeconds
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namegtss_concurrency
Variable MeaningNumber of coroutines used to write commit logs.
Variable TypeInteger
Default Value4
Value Range[1,8]
Application Setting RequirementPostmaster
Introduced Versionv1.2
Variable Nameinternal_read_only_double_quotes_symbols
Variable MeaningWhether the current session uses double quotes (") to quote database object names (tables, columns, functions, etc.) (true) or string literals (false).
Variable TypeBoolean
Default ValueON
Application ScopeUser
Introduced In Versionv1.2
Variable Namemax_remote_insert_blocks
Variable MeaningThe maximum length of an insert statement when a Kluscomp instance inserts data into a Klustore instance.
Variable TypeInteger
Default Value1024
Value Range[8,1048576]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namemetadata_connect_timeout
Variable MeaningTimeout when connecting to the metadata server.
Variable TypeInteger
Default Value20
Value Range[1,100000]
UnitSeconds
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namemetadata_read_timeout
Variable MeaningTimeout when reading from the metadata server.
Variable TypeInteger
Default Value20
Value Range[1,100000]
UnitSeconds
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namemetadata_write_timeout
Variable MeaningTimeout when writing to the metadata server.
Variable TypeInteger
Default Value20
Value Range[1,100000]
UnitSeconds
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namemin_remote_index_paralleism
Variable MeaningThe minimum parallelism of the remote index scan operator.
Variable TypeInteger
Default Value0
Value Range[0,1024]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namemysql_ansi_quotes
Variable MeaningUse double quotes (") to quote symbol names instead of string constants.
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namemysql_default_schema
Variable MeaningThe default schema for MySQL connections, only used when the connection is established. If empty, perform the same action as with PostgreSQL connections and set to the "$User, public" schema.
Variable TypeString
Default Value
Application RequirementUser
Introduced Versionv1.2
Variable Namemysql_interactive_timeout
Variable MeaningThe timeout period to wait for the next command from the MySQL CLI program before disconnecting.
Variable TypeInteger
Default Value1800
Value Range[1,2000000000]
UnitSeconds
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namemysql_net_buffer_length
Variable MeaningThe size of the read/write buffer for each client connection in the MySQL server protocol.
Variable TypeInteger
Default Value65536
Value Range[16384,1048576]
UnitBytes
Application Setting RequirementBackend
Introduced Versionv1.2
Variable Namemysql_net_retry_count
Variable MeaningNumber of retries for connecting/ writing/ reading with peers.
Variable TypeInteger
Default Value10
Value Range[1,1000000]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namemysql_port
Variable MeaningSets the TCP port on which the server listens for MySQL client connections using the MySQL protocol.
Variable TypeInteger
Default ValueUser-specified
Value Range[1,65535]
Application Setting RequirementPostmaster
Introduced Versionv1.2
Variable Namemysql_protocol_compression_algos
Variable MeaningThe protocol compression algorithms used by MySQL, which can only be a combination of 'zlib', 'zstd', and 'uncompressed'.
Variable TypeString
Default Valuezlib, zstd, uncompressed
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namemysql_protocol_ps_exec_fetch_rows
Variable MeaningThe number of rows fetched via the MySQL binary protocol in EXECUTE or FETCH commands. If all rows are fetched at once in EXECUTE, the value is 0.
Variable TypeInteger
Default Value0
Value Range[0,2147483647]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namemysql_send_resultset_metadata
Variable MeaningWhether to send result set metadata for connections using the MySQL protocol.
Variable TypeBoolean
Default ValueON
Application Setting RequirementSuperUser
Introduced Versionv1.2
Variable Namemysql_wait_timeout
Variable MeaningThe timeout period to wait for the next command from the MySQL client before disconnecting.
Variable TypeInteger
Default Value1800
Value Range[1,2000000000]
UnitSeconds
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namenet_motion_cost
Variable MeaningThe cost for a Kluscomp instance to read a 4KB data block from a Klustore instance, used for optimizer cost estimation.
Variable TypeReal
Default Value1
Value Range[0,1.79769e 308]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namenet_motion_penalty
Variable MeaningThe penalty value calculated for each interaction between Kluscomp instances and Klustore instances, used for optimizer cost estimation.
Variable TypeReal
Default Value100
Value Range[0,1.79769e 308]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameonly_full_group_by
Variable MeaningReject the following queries: select field lists, having conditions, or order by columns that reference non-aggregated columns that are neither named in the GROUP BY clause nor functionally dependent on them.
Variable TypeBoolean
Default ValueON
Application ScopeUser
Introduced Versionv1.2
Variable Nameplan_cache_mode
Variable MeaningControls the planner's choice between custom or generic plans.
Variable TypeEnumeration
Default Valueauto
Optional Valuesauto, force_generic_plan, force_custom_plan
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameremote_cursor_prefetch_rows
Variable MeaningThe number of rows read per batch when the Kluscomp instance reads data from the Klustore instance using a cursor.
Variable TypeInteger
Default Value1000
Value Range[1,2147483647]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nameremote_print_warning
Variable MeaningEnables a warning if some operators/functions cannot be pushed down to the Klustore instance.
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namereplica_read_fallback
Variable MeaningWhen read-write splitting is enabled, the fallback strategy when no replica is available for reading. 0: Error; 1: Any replica; 2: Primary node.
Variable TypeInteger
Default Value2
Value Range[0,3]
Application RequirementUser
Introduced Versionv1.2
Variable Namereplica_read_latency_threshold
Variable MeaningWhen read-write separation is enabled, it is the binlog synchronization delay threshold of the replica that can be used for replica reads.
Variable TypeReal
Default Value0
Value Range[0,1e 10]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namereplica_read_order
Variable MeaningWhen the read-write splitting feature is enabled, determines the order of priority for replicas (the higher the priority, the higher the probability of being selected). 0: ro_weight; 1: ping latency; 2: binlog replication delay.
Variable TypeInteger
Default Value0
Value Range[0,3]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namereplica_read_ping_threshold
Variable MeaningWhen the read-write separation feature is enabled, the ping latency threshold from the current Kluscomp instance to replicas available for read operations.
Variable TypeReal
Default Value0
Value Range[0,1e10]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namesharding_policy
Variable MeaningThe strategy for choosing which shard to place the table on. 0: Random; 1: Least Storage; 2: Fewest Tables; 3: First Shard.
Variable TypeInteger
Default Value0
Value Range[0,5]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namesingle_shard_mode
Variable MeaningA cluster deployment mode for when the cluster has only one shard. In this mode, computation nodes only modify local metadata when executing DDL, and users are allowed to freely define the mapping between computation node schemas and Klustore instance schemas.
Variable TypeBoolean
Default ValueOFF
Application Setting RequirementPostmaster
Introduced Versionv1.2
Variable Namesql_auto_is_null
Variable MeaningUsed for MySQL compatibility, always false.
Variable TypeBoolean
Default ValueOFF
Application RequirementUser
Introduced Versionv1.2
Variable Namestart_global_deadlock_detection_wait_timeout
Variable MeaningIf an insert/delete/update statement sent to a storage shard does not return after this amount of time, a round of deadlock detection is triggered.
Variable TypeInteger
Default Value500
Value Range[1,2147483647]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Namesynchronize_meta_data_interval_secs
Variable MeaningSets the interval for synchronizing metadata from the meta cluster.
Variable TypeInteger
Default Value60
Value Range[1,1000]
UnitSeconds
Application RequirementUser
Introduced Versionv1.2
Variable Nametable_migration_recovery_max_retries
Variable MeaningThe maximum number of retries when a Klustore instance reports a NO_SUCH_TABLE error due to table migration.
Variable TypeInteger
Default Value8
Value Range[0,16]
Application Setting RequirementUser
Introduced Versionv1.2
Variable Nametransform_create_db_to_schema
Variable MeaningOnly in MySQL connections, convert all CREATE DATABASE statements to CREATE SCHEMA statements.
Variable TypeBoolean
Default ValueON
Application Setting RequirementUser
Introduced Versionv1.2

2. System variables of the Kunlun-storage Klustore instance

Many system variables that affect operations are maintained in a KlustronDB cluster. In Klustore instances, most system variables can be configured either by loading them through the configuration file when starting kunlun-storage, or dynamically adjusted during the runtime of kunlun-storage using the set command and set global command. Before making configuration changes, it is essential to clearly understand the actual meaning, scope, and type of the system variables to avoid configuration failures or, more seriously, affecting the use of KlustronDB. Adjustments to system variables on Klustore instances should be handled with caution, and it is advisable to contact the KlustronDB team for confirmation before making adjustments.

In the Klustore instances of the KlustronDB cluster, the scope of setting system variables is divided into two levels: Session and Global, which is consistent with the way MySQL sets them.

  • At the session level, modifying session-level variables through the set command will take effect immediately in the current session and will remain effective until changed to another value or the session is reopened. This change has no effect on other sessions.
  • At the Global level, system variables at the Global level can be modified through the 'set global' command. The modified system variable values will be persisted to the Klustore instances and only affect system variables at the Global level, taking effect immediately. If the scope includes both Global and Session levels, the modified variable values will not take effect for the current connection session, which will continue to use the current session's Session variable values, and will only affect new Sessions opened after the change.

Introduction to KlustronDB-Specific System Variables

The following system variables are specific to KlustronDB Klustore instances and do not include MySQL system variables.

Variable Namegmvcc_register_txns_at_readview_creation
Variable MeaningRegister transactions whose tgvc entries are cached into each read view at creation time, achieving better performance at the cost of higher memory usage.
Variable TypeBoolean
Default ValueFALSE
ScopeGlobal
Dynamic ModificationNo
Introduced Versionv1.2
Variable Nameenable_fullsync
Variable MeaningWhether to enable the fullsync mechanism globally or in the current session.
Variable TypeBoolean
Default ValueTRUE
ScopeGlobal, Session
Dynamic ChangeYes
Introduced Versionv1.2
Variable Namefullsync_timeout
Variable MeaningIf after this many milliseconds from the start of a transaction, the replica ACK has not arrived, an error is returned to the client and the error is written to the error log.
Variable TypeInteger
Default Value30000
Value Range[5,4294967295]
UnitMilliseconds
ScopeGlobal
Dynamic ChangeYes
Introduced Versionv1.2
Variable Namefullsync_warning_timeout
Variable MeaningIf this many milliseconds have passed since the transaction began waiting for the replica ACK, write a warning to the error log.
Variable TypeInteger
Default Value3000
Value Range[3,4294967295]
UnitMilliseconds
ScopeGlobal
Dynamic ModificationYes
Introduced Versionv1.2
Variable Nameskip_fullsync_replica_acks_older_than
Variable MeaningIf a replica is this many milliseconds behind the primary, skip fsync relay log or sending ACK.
Variable TypeInteger
Default Value3600000
Value Range[0,4294967295]
UnitMilliseconds
ScopeGlobal
Dynamic ModificationYes
Introduced Versionv1.2
Variable Namefullsync_fsync_ack_wait_max_milli_secs
Variable MeaningThe replica node waits for up to this many milliseconds for more events to arrive before relaying logs in fsync and sending an ACK.
Variable TypeInteger
Default Value2
Value Range[0,4294967295]
UnitMilliseconds
ScopeGlobal
Dynamic ModificationYes
Introduced Versionv1.2
Variable Namefullsync_fsync_ack_least_txns
Variable MeaningAccumulate at least this many transaction groups before relaying the fsync log and sending an ACK.
Variable TypeInteger
Default Value10
Value Range[0,4294967295]
ScopeGlobal
Dynamic ModificationYes
Introduced Versionv1.2
Variable Namefullsync_fsync_ack_least_event_bytes
MeaningThe minimum number of relay log bytes accumulated before fsyncing the relay log and sending an ACK.
TypeInteger
Default4096
Range[0,4294967295]
UnitBytes
ScopeGlobal
Dynamic ChangeYes
Introduced in Versionv1.2
Variable Namefullsync_relaylog_fsync_ack_level
Variable MeaningThe value of this variable is assigned to the replica channel at the time of creation to determine when full synchronization is enabled and whether the replica channel should fsync the relay log and/or reply to an ACK to its primary channel after writing the event group it received to the relay log file. 0: Do not fsync or send ACK; 1: Do not fsync, but send ACK; 2: fsync and send ACK To subsequently change the channel-specific settings, do CHANGE MASTER TO FULLSYNC_RELAY_LOG_FSYNC_ACK_LEVEL={0|1|2} [FOR CHANNEL 'xxx'].
Variable Types:Integer
Default2
Value range[0,2]
ScopeGlobal
Dynamic modificationYes
Introducing Versionsv1.2
Variable Namefullsync_consistency_level
Variable MeaningWhether and how to wait for full synchronization replica ACK before replying to the client that the transaction has been committed at the end of a transaction commit. 0: Do not wait; Positive: Wait for this number of ACKs.
Variable TypeInteger
Default Value1
Value Range[0,1024]
ScopeGlobal
Dynamic ModificationYes
Introduced Versionv1.2
Variable Namebg_worker_threads
Variable MeaningNumber of background worker threads.
Variable TypeInteger
Default Value16
Value Range[4,256]
ScopeGlobal
Dynamic ModificationYes
Introduced Versionv1.2
Variable Nameslow_logging_start_point
Variable MeaningThe starting point of the slow query logging cycle: from query reception (2), query start (1), or lock acquisition (0) to end time.
Variable TypeInteger
Default Value2
Value Range[0,2]
ScopeGlobal
Dynamic ModificationYes
Introduced Versionv1.2
Variable Nameprint_extra_info_verbosity
Variable MeaningThe level of detail for printing extra information to help diagnose issues, including disconnection information, newly added log event fields, etc. The larger the value, the more detailed/the more information is printed. 0 will disable printing any detailed information.
Variable TypeInteger
Default Value1
Value Range[0,100000]
ScopeGlobal
Dynamic ModificationYes
Introduced Versionv1.2

System Variables FAQ

1. How to operate the configuration method of reload?

A: When adjusting system variables in KlustronDB, some require restarting the Kluscomp instance, while others can be applied to the Kluscomp instances by reloading the configuration to make the system variables take effect.

  • the way of reload

Here, taking the modification of the system variable statement_timeout as an example, first log in to Kluscomp to check the default value of this system variable:

show statement_timeout;

Example image:

Check the type of the system variable value to be modified:

select * from pg_settings where name='statement_timeout';

Example image:

Modify configuration value:

alter system set statement_timeout = 200000;

Example image:

Check the Kluscomp process and confirm the directory where the pg_ctl tool is located

Here, taking the port number 23007 of the Kluscomp as an example:

ps -ef|grep 23007

Example image:

Check the directory where pg_ctl is located:

cd /data/ha/kunlun/instance_binaries/computer/23007/ KlustronDB\_server-1.2.1/bin
ls -l

Example image:

Execute reload:

./pg_ctl -D /data/ha/kunlun/server_datadir/23007 reload

Example image:

To check whether the adjustment was successful, log in to Kluscomp to view the default value of this system variable:

show statement_timeout ;

Example image:

Note: There may be multiple Kluscomp instances, so other Kluscomp instances also need to be modified following the same steps above to ensure that the system variable configuration values of all Kluscomp instances are consistent. In most cases, the values of system variables should remain consistent across multiple Kluscomp instances, and any special user requirements should be adjusted separately.

  • restart method

Here, taking the modification of the system variable cluster_commitlog_delay_ms as an example, first log in to the Kluscomp to check the default value of this system variable:

show cluster_commitlog_delay_ms;

Example image:

Check the type of the system variable value to be modified:

select * from pg_settings where name='cluster_commitlog_delay_ms';

Example image:

Modify configuration value:

alter system set cluster_commitlog_delay_ms=11;

Example image:

Check the Kluscomp process and confirm the directory where the pg_ctl tool is located

Here, taking the port number 23001 of Kluscomp as an example:

ps -ef|grep 23001

Example image:

Check the directory where pg_ctl is located:

cd /data/ha/kunlun/instance_binaries/computer/23001/ KlustronDB\_server-1.2.1/scripts
ls -l

Example image:

Execute restart of Kluscomp instance:

Stop:

python2 stop_pg.py --port=23001

Example image:

Start:

python2 start_pg.py --port=23001

Review started successfully:

ps -ef|grep 23001

Example image:

Check whether the adjustment was successful by logging into Kluscomp to view the default value of this system variable:

show cluster_commitlog_delay_ms ;

Example image:

Note: There may be multiple Kluscomp instances, so other Kluscomp instances also need to be modified following the same steps above, ensuring that the system variable configuration values of all Kluscomp instances are consistent. In most cases, the values of system variables should remain consistent across multiple Kluscomp instances, and any special user requirements should be adjusted separately.

END