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

Checking Table Configurations for Data Synchronization

Function

This API is used to check table configurations for data synchronization. Before calling this API:

URI

POST /v3/{project_id}/instances/{instance_id}/clickhouse/replication/table-check

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
Table 3 Request body parameters

Parameter

Mandatory

Type

Description

source_instance_id

Yes

String

Source instance ID.

source_node_id

No

String

Source node ID. GaussDB(for MySQL) read replica ID. If this parameter is left blank, the ID of the primary node is used.

source_database_name

Yes

String

Source database name.

db_configs

Yes

Array of ChDatabaseConfigsInfo objects

Database configurations.

tables_configs

Yes

Array of ChDatabaseTablesConfigsInfo objects

Table configurations.

table_repl_config

Yes

ChDatabaseTableReplConfigInfo object

Table synchronization configurations.

Table 4 ChDatabaseConfigsInfo

Parameter

Mandatory

Type

Description

param_name

Yes

String

Name of the database synchronization configuration parameter. To obtain this value, see Querying Database Parameter Settings for Data Synchronization.

value

Yes

String

Value of the database synchronization configuration parameter.

Table 5 ChDatabaseTablesConfigsInfo

Parameter

Mandatory

Type

Description

table_name

Yes

String

Table name.

table_config

Yes

String

Table configuration item.

The following column operations are allowed: PARTITION BY, COLUMNS, ORDER BY, SAMPLE BY, PRIMARY KEY, and TTL.

Table 6 ChDatabaseTableReplConfigInfo

Parameter

Mandatory

Type

Description

repl_type

Yes

String

Table synchronization type. Values:

  • white_list: whitelist. In this case, tables cannot be left blank.
  • black_list: blacklist. If tables are left blank, all tables are selected.

tables

Yes

Array of strings

Tables listed on the whitelist or blacklist.

Response Parameters

Status code: 200

Table 7 Response body parameters

Parameter

Type

Description

source_database_name

String

Source database name.

table_config_check_results

Array of ChDatabaseTableConfigCheckResult objects

Table configuration check result.

Table 8 ChDatabaseTableConfigCheckResult

Parameter

Type

Description

table_name

String

Table name.

table_config

String

Table configuration item.

The following column operations are allowed: PARTITION BY, COLUMNS, ORDER BY, SAMPLE BY, PRIMARY KEY, and TTL.

check_result

String

Check result.

Status code: 400

Table 9 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Status code: 500

Table 10 Response body parameters

Parameter

Type

Description

error_code

String

Error code.

error_msg

String

Error message.

Example Request

Checking table configurations for data synchronization

POST https://{localhost}/v3/23a50154cf494ec9ad6883979a12db0a/instances/54e42160670e48e789af7075e1efea1fin16/clickhouse/replication/table-check

{
  "source_database_name" : "blackwhite_0017_22525694",
  "db_configs" : [ {
    "param_name" : "default_isolation_level",
    "value" : "QUERY_SNAPSHOT"
  }, {
    "param_name" : "enable_snapshots",
    "value" : "true"
  }, {
    "param_name" : "enable_chunk_level",
    "value" : "true"
  }, {
    "param_name" : "max_sync_threads",
    "value" : "1"
  }, {
    "param_name" : "treat_numeric_string_as_integer",
    "value" : "false"
  }, {
    "param_name" : "min_binlog_expire_logs_seconds",
    "value" : "86400"
  }, {
    "param_name" : "max_rows_in_buffer",
    "value" : "2000000"
  }, {
    "param_name" : "max_rows_in_buffers",
    "value" : "6000000"
  }, {
    "param_name" : "max_bytes_in_buffer",
    "value" : "200000000"
  }, {
    "param_name" : "max_bytes_in_buffers",
    "value" : "600000000"
  }, {
    "param_name" : "max_flush_data_time",
    "value" : "5000"
  } ],
  "tables_configs" : [ {
    "table_name" : "sbtest100",
    "table_config" : "ORDER BY id"
  } ],
  "table_repl_config" : {
    "repl_type" : "white_list",
    "tables" : [ ]
  },
  "source_instance_id" : "77aa4096cb824a61b93dab5ca00ecc8fin07",
  "source_node_id" : "57bfeacf6e8d4eb685ea907372374b35no07"
}

Example Response

Status code: 200

Success.

{
  "source_database_name" : "blackwhite_0017_22525694",
  "table_config_check_results" : [ {
    "table_name" : "sbtest100",
    "table_config" : "ORDER BY id",
    "check_result" : "Check Override Table Failed"
  } ]
}

Status Code

Status Code

Description

200

Success.

400

Client error.

500

Server error.

Error Code

For details, see Error Codes.