Updated on 2022-09-15 GMT+08:00

Modifying Parameters of a DDM Instance

Function

This API is used to modify parameters of a DDM instance.

Constraints

None

URI

PUT /v3/{project_id}/instances/{instance_id}/configurations

Table 1 Path parameters

Parameter

Mandatory

Type

Description

project_id

Yes

String

Project ID of a tenant in a region

instance_id

Yes

String

DDM instance ID

Request Parameters

Table 2 Request header parameters

Parameter

Mandatory

Type

Description

X-Language

No

String

Language. The default language is Chinese. zh-cn indicates the language is Chinese. en-us indicates the language is English.

X-Auth-Token

Yes

String

User token

It can be obtained by calling an IAM API. The value of X-Subject-Token in the response header is the user token.

Table 3 Request body parameters

Parameter

Mandatory

Type

Description

values

Yes

values object

Parameters that need to be modified

Table 4 values

Parameter

Mandatory

Type

Description

bind_table

No

String

Data association among multiple sharded tables. The optimizer processes JOIN operations at the MySQL layer based on these associations. The format is [{tb.col1,tb2.col2},{tb.col2,tb3.col1},...].

character_set_server

No

String

DDM server's character set. To store emoticons, set both this parameter and the character set on RDS to utf8mb4. To modify the character set, you must change the collation of the DDM server correspondingly.

Enumerated values:

  • gbk
  • utf8
  • utf8mb4

collation_server

No

String

Collation on the DDM server. To modify the collation, you must modify the server's character set correspondingly.

Enumerated values:

  • utf8_unicode_ci
  • utf8_bin
  • gbk_chinese_ci
  • gbk_bin
  • utf8mb4_unicode_ci
  • utf8mb4_bin

concurrent_execution_level

No

String

Concurrency level of scanning table shards in a logical table. DATA_NODE: indicates that database shards are scanned in parallel and table shards in each database shard are scanned in serial. RDS_INSTANCE: indicates that RDS instances are scanned in parallel and shards in each DB instance are scanned in serial. PHY_TABLE: indicates that all table shards are scanned in parallel.

Enumerated values:

  • RDS_INSTANCE
  • DATA_NODE
  • PHY_TABLE

connection_idle_timeout

No

String

Number of seconds the server waits for activity on a connection before closing it. The value ranges from 60 to 28800. The default value is 28800, indicating that the server waits for 28800 seconds before closing a connection.

enable_table_recycle

No

String

Whether the table recycle bin is enabled.

Enumerated values:

  • OFF
  • ON

insert_to_load_data

No

String

Whether constant values can be inserted by executing the LOAD DATA statement.

Enumerated values:

  • OFF
  • ON

live_transaction_timeout_on_shutdown

No

String

Timeout limit of an in-transit transaction, in seconds. The value ranges from 0 to 100. The default value is 1, indicating that the server waits for 1 second before closing the connection.

long_query_time

No

String

Minimum duration of a query to be logged as slow, in seconds. The value ranges from 0.01 to 10. The default value is 1, indicating that the query is considered as a slow query if its execution duration is greater than or equal to 1 second.

max_allowed_packet

No

String

Maximum size of a packet or any generated intermediate string. The packet message buffer is initialized to net_buffer_length bytes, but can grow up to max_allowed_packet bytes if required. This value is small by default, to catch large (and possibly incorrect) packets. The value must be a multiple of 1024. The value ranges from 1024 to 1073741824. The default value is 16777216.

max_backend_connections

No

String

Maximum of concurrent RDS client connections allowed per DDM instance. When this parameter is set to 0 (default), the maximum concurrent connections from a DDM node to an RDS instance is: (RDS instance's maximum connections - 20)/DDM nodes. The value ranges from 0 to 10000000.

max_connections

No

String

Concurrent connections allowed per DDM instance, which depends on the class and quantity of associated RDS instances. The default value is 20000. The value ranges from 10 to 40000, indicating that the maximum of concurrent connections cannot exceed 40,000.

min_backend_connections

No

String

Minimum concurrent connections from a DDM node to an RDS instance. The default value is 10. The value ranges from 0 to 10000000.

not_from_pushdown

No

String

Whether the SELECT statements that do not contain any FROM clauses are pushed down.

Enumerated values:

  • OFF
  • ON

seconds_behind_master

No

String

Threshold in seconds of the replication lag between a primary RDS instance to its read replica. The value ranges from 0 to 7200. The default value is 30, indicating that the time for data replication between the primary RDS instance and its read replicas cannot exceed 30 seconds. If the time exceeds 30 seconds, the data read requests are no longer forwarded to the read replicas.

sql_audit

No

String

Whether SQL audit is enabled.

Enumerated values:

  • OFF
  • ON

sql_execute_timeout

No

String

Number of seconds to wait for a SQL statement to execute before it times out. The value ranges from 100 to 28800. The default value is 28800, indicating that the SQL statement times out if its execution time is greater than or equal to 28,800 seconds.

support_ddl_binlog_hint

No

String

Whether a binlog hint is added to each DDL statement.

Enumerated values:

  • OFF
  • ON

transaction_policy

No

String

Transactions supported by DDM. XA transaction, which attempts to ensure atomicity and isolation. FREE transaction, which is a best-effort commit transaction that allows data to be written to multiple shards, without impacting performance. FREE transactions do not ensure atomicity. NO_DTX transaction, which is a single-shard transaction.

Enumerated values:

  • XA
  • FREE
  • NO_DTX

ultimate_optimize

No

String

Whether the SQL execution plan is optimized based on parameter values.

Enumerated values:

  • OFF
  • ON

Response Parameters

Status code: 200

Table 5 Response body parameters

Parameter

Type

Description

nodeList

String

DDM instance nodes

needRestart

Boolean

Whether the instance needs to be restarted

jobId

String

Task ID

configId

String

Parameter group ID

configName

String

Parameter group name

Status code: 400

Table 6 Response body parameters

Parameter

Type

Description

errCode

String

Service error code

externalMessage

String

Error message

Status code: 500

Table 7 Response body parameters

Parameter

Type

Description

errCode

String

Service error code

externalMessage

String

Error message

Example Request

PUT https://{endpoint}/v3/{project_id}/instances/{instance_id}/configurations

{
  "values" : {
    "long_query_time" : 2
  }
}

Example Response

Status code: 200

OK

{
  "nodeList" : null,
  "needRestart" : "false",
  "jobId" : "9fe84a77-6a6b-4b03-9a3e-db910a548657",
  "configId" : null,
  "configName" : null
}

Status code: 400

bad request

{
  "externalMessage" : "Parameter error.",
  "errCode" : "DBS.280001"
}

Status code: 500

server error

{
  "externalMessage" : "Server failure.",
  "errCode" : "DBS.200412"
}

Status Codes

Status Code

Description

200

OK

400

bad request

500

server error

Error Codes

For details, see Error Codes.