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.
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.
| Variable Name | autocommit |
|---|
| Variable Meaning | Whether to enable auto-commit mode. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | check_primary_interval_secs |
|---|
| Variable Meaning | The interval for checking the primary nodes of all storage shards and metashards. |
| Variable Type | Integer |
| Default Value | 3 |
| Value Range | [1,100] |
| Application Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | client_connection_type |
|---|
| Variable Meaning | The client connection type, either MySQL or PG. |
| Variable Type | Enumeration |
| Default Value | FE_PG |
| Optional Values | FE_UNKNOWN, FE_PG, FE_MYSQL |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | cluster_commitlog_group_size |
|---|
| Variable Meaning | Commit log XID write group size. |
| Variable Type | Integer |
| Default Value | 8 |
| Value Range | [1,67108864] |
| Application Requirement | Postmaster |
| Introduced Version | v1.2 |
| Variable Name | comp_node_id |
|---|
| Variable Meaning | This is assigned to the Kluscomp instance when the Kluscomp instance is created. |
| Variable Type | Integer |
| Default Value | |
| Value Range | [0,2147483647] |
| Application Setting Requirement | Postmaster |
| Introduced Version | v1.2 |
| Variable Name | debug_remote_connection |
|---|
| Variable Meaning | Displays which shards are accessed during SQL execution in the form of a Notice. Used for functional debugging. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | declared_mysql_server_version |
|---|
| Variable Meaning | KunlunServer declares itself as the MySQL version to MySQL client connectors. |
| Variable Type | String |
| Default Value | 8.0.29 |
| Application Setting Requirement | Sighup |
| Introduced Version | v1.2 |
| Variable Name | default_nulls_smallest |
|---|
| Variable Meaning | When sorting in ascending order, null is treated as the smallest value by default. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | default_pgsql_collation |
|---|
| Variable Meaning | If 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 Type | String |
| Default Value | ucs_basic |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_block_nestloop |
|---|
| Variable Meaning | Whether to enable the block nestloop feature, thereby reducing the number of interactions with the Klustore instance. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_catalog_security_policy |
|---|
| Variable Meaning | Add 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 Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | Postmaster |
| Introduced Version | v1.2 |
| Variable Name | enable_collation_pushdown |
|---|
| Variable Meaning | Push down collation to Klustore instances. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_coredump |
|---|
| Variable Meaning | Whether to generate a core dump file when any PostgreSQL process catches a fatal signal. Core dump files are very useful for error diagnosis. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | Sighup |
| Introduced Version | v1.2 |
| Variable Name | enable_debug_remote_path |
|---|
| Variable Meaning | Used for optimizer debugging. Displays all alternative remote operators generated during query optimization. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_flatten_correlated_sublink |
|---|
| Variable Meaning | Flatten any subquery correlated to a semi-join. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Scope | User |
| Introduced Version | v1.2 |
| Variable Name | enable_global_deadlock_detection |
|---|
| Variable Meaning | Enable global deadlock detection and resolution. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | Sighup |
| Introduced Version | v1.2 |
| Variable Name | enable_global_mvcc |
|---|
| Variable Meaning | Enable global MVCC feature. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | Postmaster |
| Introduced Version | v1.2 |
| Variable Name | enable_olap_mode |
|---|
| Variable Meaning | Set some parameters to optimize OLAP workloads. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_parallel_remotescan |
|---|
| Variable Meaning | Treat remote scan plans as parallel-safe to improve parallelism. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_pg_mysql_charset_mapping_deduction |
|---|
| Variable Meaning | Some mappings are deduced from documentation and public information. Whether to use such deduced mappings. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_remote_agg_pushdown |
|---|
| Variable Meaning | Attempt to push down aggregation to storage shards for better performance. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_remote_cursor |
|---|
| Variable Meaning | Use a cursor to fetch tuples from remote shards, provided enable_shard_binary_protocol is set. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_remote_distinct_pushdown |
|---|
| Variable Meaning | Try to push down the DISTINCT clause to storage shards for better performance. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_remote_indexscan |
|---|
| Variable Meaning | Try to create a remote index scan plan. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_remote_join_pushdown |
|---|
| Variable Meaning | Attempts to push down the table join if the left and right tables are in the same storage shard. |
| Variable Type | Boolean |
| Default Value | ON |
| Applied Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_remote_limit_pushdown |
|---|
| Variable Meaning | Attempt to push down the LIMIT clause to storage shards for better performance. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_remote_orderby_pushdown |
|---|
| Variable Meaning | Attempt to push down sorting to storage shards for better performance. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_replica_read |
|---|
| Variable Meaning | Enable replica read function to reduce the read load on the master. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_shard_binary_protocol |
|---|
| Variable Meaning | When 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 Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | SuperUser |
| Introduced Version | v1.2 |
| Variable Name | enable_sql_log |
|---|
| Variable Meaning | Record the SQL sent to the storage shard into a separate SQL log for easier problem diagnosis. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | enable_stacktrace |
|---|
| Variable Meaning | Whether 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 Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | Sighup |
| Introduced Version | v1.2 |
| Variable Name | enable_stmt_subxact |
|---|
| Variable Meaning | Wraps user queries into internal subtransactions and rolls back the subtransaction in case of an error, instead of rolling back the entire transaction. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | force_remote_sql_parameterize |
|---|
| Variable Meaning | Parameterizes all constants in pushed-down SQL and communicates with the Klustore instance using the binary protocol. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | SuperUser |
| Introduced Version | v1.2 |
| Variable Name | force_secure_file_access_proc |
|---|
| Variable Meaning | Force the use of Unix sockets when calling file access functions. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | Sighup |
| Introduced Version | v1.2 |
| Variable Name | global_deadlock_detector_victim_policy |
|---|
| Variable Meaning | Specifies how the global deadlock detector selects a victim to terminate in order to resolve a global deadlock. |
| Variable Type | Enumeration |
| Default Value | KILL_MOST_ROWS_LOCKED |
| Valid Values | KILL_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 Requirement | SIGHUP |
| Introduced in Version | v1.2 |
| Variable Name | global_txn_commit_log_wait_max_secs |
|---|
| Variable Meaning | Timeout period for writing transaction logs to the metadata server during a two-phase commit. |
| Variable Type | Integer |
| Default Value | 10 |
| Value Range | [1,100000] |
| Unit | Seconds |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | gtss_concurrency |
|---|
| Variable Meaning | Number of coroutines used to write commit logs. |
| Variable Type | Integer |
| Default Value | 4 |
| Value Range | [1,8] |
| Application Setting Requirement | Postmaster |
| Introduced Version | v1.2 |
| Variable Name | internal_read_only_double_quotes_symbols |
|---|
| Variable Meaning | Whether the current session uses double quotes (") to quote database object names (tables, columns, functions, etc.) (true) or string literals (false). |
| Variable Type | Boolean |
| Default Value | ON |
| Application Scope | User |
| Introduced In Version | v1.2 |
| Variable Name | max_remote_insert_blocks |
|---|
| Variable Meaning | The maximum length of an insert statement when a Kluscomp instance inserts data into a Klustore instance. |
| Variable Type | Integer |
| Default Value | 1024 |
| Value Range | [8,1048576] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | metadata_connect_timeout |
|---|
| Variable Meaning | Timeout when connecting to the metadata server. |
| Variable Type | Integer |
| Default Value | 20 |
| Value Range | [1,100000] |
| Unit | Seconds |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | metadata_read_timeout |
|---|
| Variable Meaning | Timeout when reading from the metadata server. |
| Variable Type | Integer |
| Default Value | 20 |
| Value Range | [1,100000] |
| Unit | Seconds |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | metadata_write_timeout |
|---|
| Variable Meaning | Timeout when writing to the metadata server. |
| Variable Type | Integer |
| Default Value | 20 |
| Value Range | [1,100000] |
| Unit | Seconds |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | min_remote_index_paralleism |
|---|
| Variable Meaning | The minimum parallelism of the remote index scan operator. |
| Variable Type | Integer |
| Default Value | 0 |
| Value Range | [0,1024] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | mysql_ansi_quotes |
|---|
| Variable Meaning | Use double quotes (") to quote symbol names instead of string constants. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | mysql_default_schema |
|---|
| Variable Meaning | The 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 Type | String |
| Default Value | |
| Application Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | mysql_interactive_timeout |
|---|
| Variable Meaning | The timeout period to wait for the next command from the MySQL CLI program before disconnecting. |
| Variable Type | Integer |
| Default Value | 1800 |
| Value Range | [1,2000000000] |
| Unit | Seconds |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | mysql_net_buffer_length |
|---|
| Variable Meaning | The size of the read/write buffer for each client connection in the MySQL server protocol. |
| Variable Type | Integer |
| Default Value | 65536 |
| Value Range | [16384,1048576] |
| Unit | Bytes |
| Application Setting Requirement | Backend |
| Introduced Version | v1.2 |
| Variable Name | mysql_net_retry_count |
|---|
| Variable Meaning | Number of retries for connecting/ writing/ reading with peers. |
| Variable Type | Integer |
| Default Value | 10 |
| Value Range | [1,1000000] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | mysql_port |
|---|
| Variable Meaning | Sets the TCP port on which the server listens for MySQL client connections using the MySQL protocol. |
| Variable Type | Integer |
| Default Value | User-specified |
| Value Range | [1,65535] |
| Application Setting Requirement | Postmaster |
| Introduced Version | v1.2 |
| Variable Name | mysql_protocol_compression_algos |
|---|
| Variable Meaning | The protocol compression algorithms used by MySQL, which can only be a combination of 'zlib', 'zstd', and 'uncompressed'. |
| Variable Type | String |
| Default Value | zlib, zstd, uncompressed |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | mysql_protocol_ps_exec_fetch_rows |
|---|
| Variable Meaning | The 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 Type | Integer |
| Default Value | 0 |
| Value Range | [0,2147483647] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | mysql_send_resultset_metadata |
|---|
| Variable Meaning | Whether to send result set metadata for connections using the MySQL protocol. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | SuperUser |
| Introduced Version | v1.2 |
| Variable Name | mysql_wait_timeout |
|---|
| Variable Meaning | The timeout period to wait for the next command from the MySQL client before disconnecting. |
| Variable Type | Integer |
| Default Value | 1800 |
| Value Range | [1,2000000000] |
| Unit | Seconds |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | net_motion_cost |
|---|
| Variable Meaning | The cost for a Kluscomp instance to read a 4KB data block from a Klustore instance, used for optimizer cost estimation. |
| Variable Type | Real |
| Default Value | 1 |
| Value Range | [0,1.79769e 308] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | net_motion_penalty |
|---|
| Variable Meaning | The penalty value calculated for each interaction between Kluscomp instances and Klustore instances, used for optimizer cost estimation. |
| Variable Type | Real |
| Default Value | 100 |
| Value Range | [0,1.79769e 308] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | only_full_group_by |
|---|
| Variable Meaning | Reject 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 Type | Boolean |
| Default Value | ON |
| Application Scope | User |
| Introduced Version | v1.2 |
| Variable Name | plan_cache_mode |
|---|
| Variable Meaning | Controls the planner's choice between custom or generic plans. |
| Variable Type | Enumeration |
| Default Value | auto |
| Optional Values | auto, force_generic_plan, force_custom_plan |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | remote_cursor_prefetch_rows |
|---|
| Variable Meaning | The number of rows read per batch when the Kluscomp instance reads data from the Klustore instance using a cursor. |
| Variable Type | Integer |
| Default Value | 1000 |
| Value Range | [1,2147483647] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | remote_print_warning |
|---|
| Variable Meaning | Enables a warning if some operators/functions cannot be pushed down to the Klustore instance. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | replica_read_fallback |
|---|
| Variable Meaning | When read-write splitting is enabled, the fallback strategy when no replica is available for reading. 0: Error; 1: Any replica; 2: Primary node. |
| Variable Type | Integer |
| Default Value | 2 |
| Value Range | [0,3] |
| Application Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | replica_read_latency_threshold |
|---|
| Variable Meaning | When read-write separation is enabled, it is the binlog synchronization delay threshold of the replica that can be used for replica reads. |
| Variable Type | Real |
| Default Value | 0 |
| Value Range | [0,1e 10] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | replica_read_order |
|---|
| Variable Meaning | When 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 Type | Integer |
| Default Value | 0 |
| Value Range | [0,3] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | replica_read_ping_threshold |
|---|
| Variable Meaning | When the read-write separation feature is enabled, the ping latency threshold from the current Kluscomp instance to replicas available for read operations. |
| Variable Type | Real |
| Default Value | 0 |
| Value Range | [0,1e10] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | sharding_policy |
|---|
| Variable Meaning | The strategy for choosing which shard to place the table on. 0: Random; 1: Least Storage; 2: Fewest Tables; 3: First Shard. |
| Variable Type | Integer |
| Default Value | 0 |
| Value Range | [0,5] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | single_shard_mode |
|---|
| Variable Meaning | A 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 Type | Boolean |
| Default Value | OFF |
| Application Setting Requirement | Postmaster |
| Introduced Version | v1.2 |
| Variable Name | sql_auto_is_null |
|---|
| Variable Meaning | Used for MySQL compatibility, always false. |
| Variable Type | Boolean |
| Default Value | OFF |
| Application Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | start_global_deadlock_detection_wait_timeout |
|---|
| Variable Meaning | If 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 Type | Integer |
| Default Value | 500 |
| Value Range | [1,2147483647] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | synchronize_meta_data_interval_secs |
|---|
| Variable Meaning | Sets the interval for synchronizing metadata from the meta cluster. |
| Variable Type | Integer |
| Default Value | 60 |
| Value Range | [1,1000] |
| Unit | Seconds |
| Application Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | table_migration_recovery_max_retries |
|---|
| Variable Meaning | The maximum number of retries when a Klustore instance reports a NO_SUCH_TABLE error due to table migration. |
| Variable Type | Integer |
| Default Value | 8 |
| Value Range | [0,16] |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
| Variable Name | transform_create_db_to_schema |
|---|
| Variable Meaning | Only in MySQL connections, convert all CREATE DATABASE statements to CREATE SCHEMA statements. |
| Variable Type | Boolean |
| Default Value | ON |
| Application Setting Requirement | User |
| Introduced Version | v1.2 |
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.
The following system variables are specific to KlustronDB Klustore instances and do not include MySQL system variables.
| Variable Name | gmvcc_register_txns_at_readview_creation |
|---|
| Variable Meaning | Register transactions whose tgvc entries are cached into each read view at creation time, achieving better performance at the cost of higher memory usage. |
| Variable Type | Boolean |
| Default Value | FALSE |
| Scope | Global |
| Dynamic Modification | No |
| Introduced Version | v1.2 |
| Variable Name | enable_fullsync |
|---|
| Variable Meaning | Whether to enable the fullsync mechanism globally or in the current session. |
| Variable Type | Boolean |
| Default Value | TRUE |
| Scope | Global, Session |
| Dynamic Change | Yes |
| Introduced Version | v1.2 |
| Variable Name | fullsync_timeout |
|---|
| Variable Meaning | If 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 Type | Integer |
| Default Value | 30000 |
| Value Range | [5,4294967295] |
| Unit | Milliseconds |
| Scope | Global |
| Dynamic Change | Yes |
| Introduced Version | v1.2 |
| Variable Name | fullsync_warning_timeout |
|---|
| Variable Meaning | If this many milliseconds have passed since the transaction began waiting for the replica ACK, write a warning to the error log. |
| Variable Type | Integer |
| Default Value | 3000 |
| Value Range | [3,4294967295] |
| Unit | Milliseconds |
| Scope | Global |
| Dynamic Modification | Yes |
| Introduced Version | v1.2 |
| Variable Name | skip_fullsync_replica_acks_older_than |
|---|
| Variable Meaning | If a replica is this many milliseconds behind the primary, skip fsync relay log or sending ACK. |
| Variable Type | Integer |
| Default Value | 3600000 |
| Value Range | [0,4294967295] |
| Unit | Milliseconds |
| Scope | Global |
| Dynamic Modification | Yes |
| Introduced Version | v1.2 |
| Variable Name | fullsync_fsync_ack_wait_max_milli_secs |
|---|
| Variable Meaning | The replica node waits for up to this many milliseconds for more events to arrive before relaying logs in fsync and sending an ACK. |
| Variable Type | Integer |
| Default Value | 2 |
| Value Range | [0,4294967295] |
| Unit | Milliseconds |
| Scope | Global |
| Dynamic Modification | Yes |
| Introduced Version | v1.2 |
| Variable Name | fullsync_fsync_ack_least_txns |
|---|
| Variable Meaning | Accumulate at least this many transaction groups before relaying the fsync log and sending an ACK. |
| Variable Type | Integer |
| Default Value | 10 |
| Value Range | [0,4294967295] |
| Scope | Global |
| Dynamic Modification | Yes |
| Introduced Version | v1.2 |
| Variable Name | fullsync_fsync_ack_least_event_bytes |
|---|
| Meaning | The minimum number of relay log bytes accumulated before fsyncing the relay log and sending an ACK. |
| Type | Integer |
| Default | 4096 |
| Range | [0,4294967295] |
| Unit | Bytes |
| Scope | Global |
| Dynamic Change | Yes |
| Introduced in Version | v1.2 |
| Variable Name | fullsync_relaylog_fsync_ack_level |
|---|
| Variable Meaning | The 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 |
| Default | 2 |
| Value range | [0,2] |
| Scope | Global |
| Dynamic modification | Yes |
| Introducing Versions | v1.2 |
| Variable Name | fullsync_consistency_level |
|---|
| Variable Meaning | Whether 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 Type | Integer |
| Default Value | 1 |
| Value Range | [0,1024] |
| Scope | Global |
| Dynamic Modification | Yes |
| Introduced Version | v1.2 |
| Variable Name | bg_worker_threads |
|---|
| Variable Meaning | Number of background worker threads. |
| Variable Type | Integer |
| Default Value | 16 |
| Value Range | [4,256] |
| Scope | Global |
| Dynamic Modification | Yes |
| Introduced Version | v1.2 |
| Variable Name | slow_logging_start_point |
|---|
| Variable Meaning | The starting point of the slow query logging cycle: from query reception (2), query start (1), or lock acquisition (0) to end time. |
| Variable Type | Integer |
| Default Value | 2 |
| Value Range | [0,2] |
| Scope | Global |
| Dynamic Modification | Yes |
| Introduced Version | v1.2 |
| Variable Name | print_extra_info_verbosity |
|---|
| Variable Meaning | The 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 Type | Integer |
| Default Value | 1 |
| Value Range | [0,100000] |
| Scope | Global |
| Dynamic Modification | Yes |
| Introduced Version | v1.2 |
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.
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:
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:
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:
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.
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:
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:
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.