Help Center/ GaussDB(for MySQL)/ API Reference/ APIs (Recommended)/ HTAP (Lightweight Edition)/ Querying Database Parameter Settings for Data Synchronization
Updated on 2024-09-11 GMT+08:00

Querying Database Parameter Settings for Data Synchronization

Function

This API is used to query database parameter settings for data synchronization. Before calling this API:

URI

GET /v3/{project_id}/instances/{instance_id}/clickhouse/replication/database-parameter

Table 1 URI parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region.

To obtain this value, see Obtaining a Project ID.

instance_id

Yes

String

ClickHouse instance ID, which is compliant with the UUID format.

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Auth-Token

Yes

String

User token.

To obtain this value, call the IAM API for obtaining a user token.

The value of X-Subject-Token in the response header is the token value.

X-Language

No

String

Request language type. The default value is en-us.

Values:

  • en-us
  • zh-cn

Response Parameters

Status code: 200

Table 3 Response body parameter

Parameter

Type

Description

db_parameters

Array of ChDatabaseParameterInfo objects

Database parameters.

Table 4 ChDatabaseParameterInfo

Parameter

Type

Description

param_name

String

Parameter name.

data_type

String

Parameter type.

default_value

String

Default parameter value.

value_range

String

Parameter value range.

description

String

Parameter description.

Status code: 400

Table 5 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 6 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Querying database parameter settings for data synchronization of an instance

GET https://{localhost}/v3/23a50154cf494ec9ad6883979a12db0a/instances/54e42160670e48e789af7075e1efea1fin16/clickhouse/replication/database-parameter

Example Response

Status code: 200

Success.

{
  "db_parameters" : [ {
    "param_name" : "default_isolation_level",
    "data_type" : "String",
    "default_value" : "QUERY_SNAPSHOT",
    "value_range" : "READ_COMMITTED|READ_UNCOMMITTED|QUERY_RAW|QUERY_SNAPSHOT",
    "description" : "Controls the default isolation level. This parameter is only suitable for the MaterializeMySQL engine. read_uncommitted: MVCC is not supported. read_committed: Transactional integrity in queries (including subqueries) is preserved. query_snapshot: Transactional integrity is preserved and duplicate and deleted rows are removed at the cost of data freshness."
  }, {
    "param_name" : "enable_snapshots",
    "data_type" : "String",
    "default_value" : "true",
    "value_range" : "true|false",
    "description" : "Disables or enables snapshots. This parameter can be set to true only when mvcc_isolation_level is set to query_snapshot."
  }, {
    "param_name" : "enable_chunk_level",
    "data_type" : "String",
    "default_value" : "true",
    "value_range" : "true|false",
    "description" : "Enables or disables chunk-level parallel replication."
  }, {
    "param_name" : "max_sync_threads",
    "data_type" : "Integer",
    "default_value" : "1",
    "value_range" : "1-2",
    "description" : "Controls the maximum number of threads for full replication."
  }, {
    "param_name" : "treat_numeric_string_as_integer",
    "data_type" : "String",
    "default_value" : "false",
    "value_range" : "true|false",
    "description" : "Controls whether numeric strings are treated as integers during block-level task generation during full synchronization."
  }, {
    "param_name" : "min_binlog_expire_logs_seconds",
    "data_type" : "Integer",
    "default_value" : "86400",
    "value_range" : "0-2592000",
    "description" : "Controls the minimum duration for storing binlogs. If the duration for storing binlogs is less than the threshold, a synchronization failure is reported. 0 indicates that the duration is not limited."
  }, {
    "param_name" : "max_rows_in_buffer",
    "data_type" : "Integer",
    "default_value" : "2000000",
    "value_range" : "1-10000000",
    "description" : "Controls the maximum number of rows of data that is allowed to be cached in memory (for a single table and any cache data that cannot be queried). When the number of rows exceeds this parameter value, the data will be materialized."
  }, {
    "param_name" : "max_rows_in_buffers",
    "data_type" : "Integer",
    "default_value" : "6000000",
    "value_range" : "1-10000000",
    "description" : "Controls the maximum number of rows of data that is allowed to be cached in memory (for databases and cache data that cannot be queried). When the number of rows exceeds this parameter value, the data will be materialized."
  }, {
    "param_name" : "max_bytes_in_buffer",
    "data_type" : "Integer",
    "default_value" : "200000000",
    "value_range" : "1-1000000000",
    "description" : "Controls the maximum number of bytes of data that is allowed to be cached in memory (for a single table and any cache data that cannot be queried). When the number of bytes exceeds the parameter value, the data will be materialized."
  }, {
    "param_name" : "max_bytes_in_buffers",
    "data_type" : "Integer",
    "default_value" : "600000000",
    "value_range" : "1-1000000000",
    "description" : "Controls the maximum number of bytes of data that is allowed to be cached in memory (for databases and any cache data that cannot be queried). When the number of bytes exceeds the parameter value, the data will be materialized."
  }, {
    "param_name" : "max_flush_data_time",
    "data_type" : "Integer",
    "default_value" : "5000",
    "value_range" : "1-10000",
    "description" : "Controls how long that data is cached in the memory, in milliseconds."
  } ]
}

Status Code

Status Code

Description

200

Success.

400

Client error.

500

Server error.

Error Code

For details, see Error Codes.