diff --git a/RELEASE-NOTES.md b/RELEASE-NOTES.md
index cf068e87abc92..4819f679f910d 100644
--- a/RELEASE-NOTES.md
+++ b/RELEASE-NOTES.md
@@ -33,6 +33,7 @@
1. Sharding: Support GroupConcat function for aggregating multiple shards in MySQL, OpenGauss, Doris - [#33808](https://github.com/apache/shardingsphere/pull/33808)
1. Proxy Native: Support Seata AT integration under Proxy Native in GraalVM Native Image - [#33889](https://github.com/apache/shardingsphere/pull/33889)
1. Agent: Simplify the use of Agent's Docker Image - [#33356](https://github.com/apache/shardingsphere/pull/33356)
+1. Metadata: Add load-table-metadata-batch-size props to concurrent load table metadata - [#34009](https://github.com/apache/shardingsphere/pull/34009)
### Bug Fixes
diff --git a/docs/document/content/user-manual/common-config/props.cn.md b/docs/document/content/user-manual/common-config/props.cn.md
index 09d5578287348..a07fa1fdded23 100644
--- a/docs/document/content/user-manual/common-config/props.cn.md
+++ b/docs/document/content/user-manual/common-config/props.cn.md
@@ -17,6 +17,7 @@ Apache ShardingSphere 提供属性配置的方式配置系统级配置。
| kernel-executor-size (?) | int | 用于设置任务处理线程池的大小
每个 ShardingSphereDataSource 使用一个独立的线程池,同一个 JVM 的不同数据源不共享线程池 | infinite |
| max-connections-size-per-query (?) | int | 一次查询请求在每个数据库实例中所能使用的最大连接数 | 1 |
| check-table-metadata-enabled (?) | boolean | 在程序启动和更新时,是否检查分片元数据的结构一致性 | false |
+| load-table-metadata-batch-size (?) | int | 在程序启动或刷新元数据时,单个批次加载表元数据的数量 | 1000 |
## 操作步骤
diff --git a/docs/document/content/user-manual/common-config/props.en.md b/docs/document/content/user-manual/common-config/props.en.md
index cb6fe6b06744f..64c5ff75039db 100644
--- a/docs/document/content/user-manual/common-config/props.en.md
+++ b/docs/document/content/user-manual/common-config/props.en.md
@@ -17,6 +17,7 @@ Apache ShardingSphere provides the way of property configuration to configure sy
| kernel-executor-size (?) | int | The max thread size of worker group to execute SQL. One ShardingSphereDataSource will use a independent thread pool, it does not share thread pool even different data source in same JVM | infinite |
| max-connections-size-per-query (?) | int | Max opened connection size for each query | 1 |
| check-table-metadata-enabled (?) | boolean | Whether validate table meta data consistency when application startup or updated | false |
+| load-table-metadata-batch-size (?) | int | The number of table metadata loaded at a time when application startup or refreshes table metadata | 1000 |
## Procedure
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
index 0734647e43f3e..4dfb2a24e62c2 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.cn.md
@@ -10,24 +10,25 @@ Apache ShardingSphere 提供了丰富的系统配置属性,用户可通过 `gl
## 参数解释
-| *名称* | *数据类型* | *说明* | *默认值* | *动态生效* |
-|-------------------------------------------|-----------|----------------------------------------------------------------------------------------------------------------------------------------|-----------------|--------|
-| system-log-level (?) | String | 系统日志输出级别,支持 DEBUG、INFO、WARN 和 ERROR,默认级别是 INFO。 | INFO | 是 |
-| sql-show (?) | boolean | 是否在日志中打印 SQL。
打印 SQL 可以帮助开发者快速定位系统问题。日志内容包含:逻辑 SQL,真实 SQL 和 SQL 解析结果。
如果开启配置,日志将使用 Topic `ShardingSphere-SQL`,日志级别是 INFO。 | false | 是 |
-| sql-simple (?) | boolean | 是否在日志中打印简单风格的 SQL。 | false | 是 |
-| kernel-executor-size (?) | int | 用于设置任务处理线程池的大小。每个 ShardingSphereDataSource 使用一个独立的线程池,同一个 JVM 的不同数据源不共享线程池。 | infinite | 否 |
-| max-connections-size-per-query (?) | int | 一次查询请求在每个数据库实例中所能使用的最大连接数。 | 1 | 是 |
-| check-table-metadata-enabled (?) | boolean | 在程序启动和更新时,是否检查分片元数据的结构一致性。 | false | 是 |
-| proxy-frontend-flush-threshold (?) | int | 在 ShardingSphere-Proxy 中设置传输数据条数的 IO 刷新阈值。 | 128 | 是 |
-| proxy-backend-query-fetch-size (?) | int | Proxy 后端与数据库交互的每次获取数据行数(使用游标的情况下)。数值增大可能会增加 ShardingSphere Proxy 的内存使用。默认值为 -1,代表设置为 JDBC 驱动的最小值。 | -1 | 是 |
-| proxy-frontend-executor-size (?) | int | Proxy 前端 Netty 线程池线程数量,默认值 0 代表使用 Netty 默认值。 | 0 | 否 |
-| proxy-frontend-max-connections (?) | int | 允许连接 Proxy 的最大客户端数量,默认值 0 代表不限制。 | 0 | 是 |
-| proxy-default-port (?) | String | Proxy 通过配置文件指定默认端口。 | 3307 | 否 |
-| proxy-netty-backlog (?) | int | Proxy 通过配置文件指定默认netty back_log参数。 | 1024 | 否 |
-| proxy-frontend-database-protocol-type (?) | String | Proxy 前端协议类型,支持 MySQL,PostgreSQL 和 openGauss | \"\" | 否 |
-| proxy-frontend-ssl-enabled (?) | boolean | Proxy 前端启用 SSL/TLS。 | false | 否 |
-| proxy-frontend-ssl-version (?) | String | 要启用的 SSL/TLS 协议。空白以使用默认值。 | TLSv1.2,TLSv1.3 | 否 |
-| proxy-frontend-ssl-cipher (?) | String | 按偏好顺序启用的密码套件。用逗号分隔的多密码套件。空白以使用默认值。 | \"\" | 否 |
+| *名称* | *数据类型* | *说明* | *默认值* | *动态生效* |
+|-------------------------------------------|---------|----------------------------------------------------------------------------------------------------------------------------------------|-----------------|--------|
+| system-log-level (?) | String | 系统日志输出级别,支持 DEBUG、INFO、WARN 和 ERROR,默认级别是 INFO。 | INFO | 是 |
+| sql-show (?) | boolean | 是否在日志中打印 SQL。
打印 SQL 可以帮助开发者快速定位系统问题。日志内容包含:逻辑 SQL,真实 SQL 和 SQL 解析结果。
如果开启配置,日志将使用 Topic `ShardingSphere-SQL`,日志级别是 INFO。 | false | 是 |
+| sql-simple (?) | boolean | 是否在日志中打印简单风格的 SQL。 | false | 是 |
+| kernel-executor-size (?) | int | 用于设置任务处理线程池的大小。每个 ShardingSphereDataSource 使用一个独立的线程池,同一个 JVM 的不同数据源不共享线程池。 | infinite | 否 |
+| max-connections-size-per-query (?) | int | 一次查询请求在每个数据库实例中所能使用的最大连接数。 | 1 | 是 |
+| check-table-metadata-enabled (?) | boolean | 在程序启动和更新时,是否检查分片元数据的结构一致性。 | false | 是 |
+| load-table-metadata-batch-size (?) | int | 在程序启动或刷新元数据时,单个批次加载表元数据的数量。 | 1000 | 是 |
+| proxy-frontend-flush-threshold (?) | int | 在 ShardingSphere-Proxy 中设置传输数据条数的 IO 刷新阈值。 | 128 | 是 |
+| proxy-backend-query-fetch-size (?) | int | Proxy 后端与数据库交互的每次获取数据行数(使用游标的情况下)。数值增大可能会增加 ShardingSphere Proxy 的内存使用。默认值为 -1,代表设置为 JDBC 驱动的最小值。 | -1 | 是 |
+| proxy-frontend-executor-size (?) | int | Proxy 前端 Netty 线程池线程数量,默认值 0 代表使用 Netty 默认值。 | 0 | 否 |
+| proxy-frontend-max-connections (?) | int | 允许连接 Proxy 的最大客户端数量,默认值 0 代表不限制。 | 0 | 是 |
+| proxy-default-port (?) | String | Proxy 通过配置文件指定默认端口。 | 3307 | 否 |
+| proxy-netty-backlog (?) | int | Proxy 通过配置文件指定默认netty back_log参数。 | 1024 | 否 |
+| proxy-frontend-database-protocol-type (?) | String | Proxy 前端协议类型,支持 MySQL,PostgreSQL 和 openGauss | \"\" | 否 |
+| proxy-frontend-ssl-enabled (?) | boolean | Proxy 前端启用 SSL/TLS。 | false | 否 |
+| proxy-frontend-ssl-version (?) | String | 要启用的 SSL/TLS 协议。空白以使用默认值。 | TLSv1.2,TLSv1.3 | 否 |
+| proxy-frontend-ssl-cipher (?) | String | 按偏好顺序启用的密码套件。用逗号分隔的多密码套件。空白以使用默认值。 | \"\" | 否 |
属性配置可以通过 [DistSQL#RAL](/cn/user-manual/shardingsphere-proxy/distsql/syntax/ral/) 在线修改。
其中支持动态修改的属性立即生效,不支持动态修改的属性在重启后生效。
diff --git a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
index a3627e5f571d1..4c31284cf6118 100644
--- a/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
+++ b/docs/document/content/user-manual/shardingsphere-proxy/yaml-config/props.en.md
@@ -18,6 +18,7 @@ Apache ShardingSphere provides a wealth of system configuration properties, whic
| kernel-executor-size (?) | int | Set the size of the thread pool for task processing. Each ShardingSphereDataSource uses an independent thread pool, and different data sources on the same JVM do not share thread pools. | infinite | False |
| max-connections-size-per-query (?) | int | The maximum number of connections that a query request can use in each database instance. | 1 | True |
| check-table-metadata-enabled (?) | boolean | Whether shard metadata is checked for structural consistency when the program is started and updated. | false | True |
+| load-table-metadata-batch-size (?) | int | The number of table metadata loaded at a time when application startup or refreshes table metadata. | 1000 | True |
| proxy-frontend-flush-threshold (?) | int | Set the I/O refresh threshold for the number of transmitted data items in ShardingSphere-Proxy. | 128 | True |
| proxy-backend-query-fetch-size (?) | int | The number of rows of data obtained when the backend Proxy interacts with databases (using a cursor). A larger number may increase the occupied memory of ShardingSphere-Proxy. The default value of -1 indicates the minimum value for JDBC driver. | -1 | True |
| proxy-frontend-executor-size (?) | int | The number of threads in the Netty thread pool of front-end Proxy. | 0 | False |
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
index b731cd9a2f883..b625aff625276 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/config/props/ConfigurationPropertyKey.java
@@ -64,6 +64,11 @@ public enum ConfigurationPropertyKey implements TypedPropertyKey {
*/
CHECK_TABLE_METADATA_ENABLED("check-table-metadata-enabled", String.valueOf(Boolean.FALSE), boolean.class, false),
+ /**
+ * Load table metadata batch size.
+ */
+ LOAD_TABLE_METADATA_BATCH_SIZE("load-table-metadata-batch-size", String.valueOf(1000), int.class, false),
+
/**
* Frontend database protocol for ShardingSphere-Proxy.
*/
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/GenericSchemaBuilder.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/GenericSchemaBuilder.java
index 603c1be4ed357..ec6c349bfa7f6 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/GenericSchemaBuilder.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/builder/GenericSchemaBuilder.java
@@ -19,7 +19,6 @@
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
-import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.database.core.metadata.data.loader.MetaDataLoader;
import org.apache.shardingsphere.infra.database.core.metadata.data.loader.MetaDataLoaderMaterial;
import org.apache.shardingsphere.infra.database.core.metadata.data.model.SchemaMetaData;
@@ -87,8 +86,7 @@ private static Collection getAllTableNames(final Collection loadSchemas(final Collection tableNames, final GenericSchemaBuilderMaterial material) throws SQLException {
- boolean checkMetaDataEnable = material.getProps().getValue(ConfigurationPropertyKey.CHECK_TABLE_METADATA_ENABLED);
- Collection materials = SchemaMetaDataUtils.getMetaDataLoaderMaterials(tableNames, material, checkMetaDataEnable);
+ Collection materials = SchemaMetaDataUtils.getMetaDataLoaderMaterials(tableNames, material);
return materials.isEmpty() ? Collections.emptyMap() : MetaDataLoader.load(materials);
}
diff --git a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtils.java b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtils.java
index 10571c905dd59..81e460adb3219 100644
--- a/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtils.java
+++ b/infra/common/src/main/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtils.java
@@ -17,8 +17,10 @@
package org.apache.shardingsphere.infra.metadata.database.schema.util;
+import com.google.common.collect.Lists;
import lombok.AccessLevel;
import lombok.NoArgsConstructor;
+import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.database.core.GlobalDataSourceRegistry;
import org.apache.shardingsphere.infra.database.core.metadata.data.loader.MetaDataLoaderMaterial;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
@@ -26,14 +28,16 @@
import org.apache.shardingsphere.infra.datanode.DataNode;
import org.apache.shardingsphere.infra.datanode.DataNodes;
import org.apache.shardingsphere.infra.exception.core.ShardingSpherePreconditions;
+import org.apache.shardingsphere.infra.exception.kernel.metadata.datanode.UnsupportedActualDataNodeStructureException;
import org.apache.shardingsphere.infra.metadata.database.resource.unit.StorageUnit;
import org.apache.shardingsphere.infra.metadata.database.schema.builder.GenericSchemaBuilderMaterial;
-import org.apache.shardingsphere.infra.exception.kernel.metadata.datanode.UnsupportedActualDataNodeStructureException;
import javax.sql.DataSource;
+import java.util.ArrayList;
import java.util.Collection;
import java.util.LinkedHashMap;
import java.util.LinkedList;
+import java.util.List;
import java.util.Map;
import java.util.Map.Entry;
import java.util.Optional;
@@ -50,13 +54,13 @@ public final class SchemaMetaDataUtils {
*
* @param tableNames table name collection
* @param material material
- * @param checkMetaDataEnable check meta data enable config
* @return meta data loader materials
*/
- public static Collection getMetaDataLoaderMaterials(final Collection tableNames, final GenericSchemaBuilderMaterial material, final boolean checkMetaDataEnable) {
+ public static Collection getMetaDataLoaderMaterials(final Collection tableNames, final GenericSchemaBuilderMaterial material) {
Map> dataSourceTableGroups = new LinkedHashMap<>();
Collection unsupportedThreeTierStorageStructureDatabaseTypes = getUnsupportedThreeTierStorageStructureDatabaseTypes(material.getStorageUnits().values());
DataNodes dataNodes = new DataNodes(material.getRules());
+ boolean checkMetaDataEnable = material.getProps().getValue(ConfigurationPropertyKey.CHECK_TABLE_METADATA_ENABLED);
for (String each : tableNames) {
checkDataSourceTypeIncludeInstanceAndSetDatabaseTableMap(unsupportedThreeTierStorageStructureDatabaseTypes, dataNodes, each);
if (checkMetaDataEnable) {
@@ -66,10 +70,21 @@ public static Collection getMetaDataLoaderMaterials(fina
}
}
Collection result = new LinkedList<>();
+ int loadTableMetadataBatchSize = material.getProps().getValue(ConfigurationPropertyKey.LOAD_TABLE_METADATA_BATCH_SIZE);
for (Entry> entry : dataSourceTableGroups.entrySet()) {
DatabaseType storageType = material.getStorageUnits().get(entry.getKey()).getStorageType();
String defaultSchemaName = getDefaultSchemaNameByStorageType(storageType, material.getDefaultSchemaName());
- result.add(new MetaDataLoaderMaterial(entry.getValue(), entry.getKey(), getDataSource(material, entry.getKey()), storageType, defaultSchemaName));
+ result.addAll(buildMaterials(material, entry.getKey(), entry.getValue(), storageType, defaultSchemaName, loadTableMetadataBatchSize));
+ }
+ return result;
+ }
+
+ private static Collection buildMaterials(final GenericSchemaBuilderMaterial material, final String dataSourceName, final Collection actualTableNames,
+ final DatabaseType storageType, final String defaultSchemaName, final int loadTableMetadataBatchSize) {
+ Collection result = new LinkedList<>();
+ DataSource dataSource = getDataSource(material, dataSourceName);
+ for (List each : Lists.partition(new ArrayList<>(actualTableNames), loadTableMetadataBatchSize)) {
+ result.add(new MetaDataLoaderMaterial(each, dataSourceName, dataSource, storageType, defaultSchemaName));
}
return result;
}
diff --git a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtilsTest.java b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtilsTest.java
index 63f64317c5a05..4ccd765c1692c 100644
--- a/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtilsTest.java
+++ b/infra/common/src/test/java/org/apache/shardingsphere/infra/metadata/database/schema/util/SchemaMetaDataUtilsTest.java
@@ -18,6 +18,7 @@
package org.apache.shardingsphere.infra.metadata.database.schema.util;
import org.apache.shardingsphere.infra.config.props.ConfigurationProperties;
+import org.apache.shardingsphere.infra.config.props.ConfigurationPropertyKey;
import org.apache.shardingsphere.infra.database.core.metadata.data.loader.MetaDataLoaderMaterial;
import org.apache.shardingsphere.infra.database.core.type.DatabaseType;
import org.apache.shardingsphere.infra.datanode.DataNode;
@@ -53,8 +54,11 @@ void assertGetSchemaMetaDataLoaderMaterialsWhenConfigCheckMetaDataEnable() {
when(rule0.getAttributes()).thenReturn(new RuleAttributes(ruleAttribute));
ShardingSphereRule rule1 = mock(ShardingSphereRule.class);
when(rule1.getAttributes()).thenReturn(new RuleAttributes());
- GenericSchemaBuilderMaterial material = new GenericSchemaBuilderMaterial(mockStorageUnits(), Arrays.asList(rule0, rule1), mock(ConfigurationProperties.class), "sharding_db");
- Collection actual = SchemaMetaDataUtils.getMetaDataLoaderMaterials(Collections.singleton("t_order"), material, true);
+ ConfigurationProperties props = mock(ConfigurationProperties.class);
+ when(props.getValue(ConfigurationPropertyKey.CHECK_TABLE_METADATA_ENABLED)).thenReturn(true);
+ when(props.getValue(ConfigurationPropertyKey.LOAD_TABLE_METADATA_BATCH_SIZE)).thenReturn(100);
+ GenericSchemaBuilderMaterial material = new GenericSchemaBuilderMaterial(mockStorageUnits(), Arrays.asList(rule0, rule1), props, "sharding_db");
+ Collection actual = SchemaMetaDataUtils.getMetaDataLoaderMaterials(Collections.singleton("t_order"), material);
assertThat(actual.size(), is(2));
Iterator iterator = actual.iterator();
MetaDataLoaderMaterial firstMaterial = iterator.next();
@@ -73,8 +77,11 @@ void assertGetSchemaMetaDataLoaderMaterialsWhenNotConfigCheckMetaDataEnable() {
when(rule0.getAttributes()).thenReturn(new RuleAttributes(ruleAttribute));
ShardingSphereRule rule1 = mock(ShardingSphereRule.class);
when(rule1.getAttributes()).thenReturn(new RuleAttributes());
- GenericSchemaBuilderMaterial material = new GenericSchemaBuilderMaterial(mockStorageUnits(), Arrays.asList(rule0, rule1), mock(ConfigurationProperties.class), "sharding_db");
- Collection actual = SchemaMetaDataUtils.getMetaDataLoaderMaterials(Collections.singleton("t_order"), material, false);
+ ConfigurationProperties props = mock(ConfigurationProperties.class);
+ when(props.getValue(ConfigurationPropertyKey.CHECK_TABLE_METADATA_ENABLED)).thenReturn(false);
+ when(props.getValue(ConfigurationPropertyKey.LOAD_TABLE_METADATA_BATCH_SIZE)).thenReturn(100);
+ GenericSchemaBuilderMaterial material = new GenericSchemaBuilderMaterial(mockStorageUnits(), Arrays.asList(rule0, rule1), props, "sharding_db");
+ Collection actual = SchemaMetaDataUtils.getMetaDataLoaderMaterials(Collections.singleton("t_order"), material);
assertThat(actual.size(), is(1));
Iterator iterator = actual.iterator();
MetaDataLoaderMaterial firstMaterial = iterator.next();
@@ -90,8 +97,11 @@ void assertGetSchemaMetaDataLoaderMaterialsWhenNotConfigCheckMetaDataEnableForSi
when(rule0.getAttributes()).thenReturn(new RuleAttributes(ruleAttribute));
ShardingSphereRule rule1 = mock(ShardingSphereRule.class);
when(rule1.getAttributes()).thenReturn(new RuleAttributes());
- GenericSchemaBuilderMaterial material = new GenericSchemaBuilderMaterial(mockStorageUnits(), Arrays.asList(rule0, rule1), mock(ConfigurationProperties.class), "public");
- Collection actual = SchemaMetaDataUtils.getMetaDataLoaderMaterials(Collections.singleton("t_single"), material, false);
+ ConfigurationProperties props = mock(ConfigurationProperties.class);
+ when(props.getValue(ConfigurationPropertyKey.CHECK_TABLE_METADATA_ENABLED)).thenReturn(false);
+ when(props.getValue(ConfigurationPropertyKey.LOAD_TABLE_METADATA_BATCH_SIZE)).thenReturn(100);
+ GenericSchemaBuilderMaterial material = new GenericSchemaBuilderMaterial(mockStorageUnits(), Arrays.asList(rule0, rule1), props, "public");
+ Collection actual = SchemaMetaDataUtils.getMetaDataLoaderMaterials(Collections.singleton("t_single"), material);
assertThat(actual.size(), is(1));
Iterator iterator = actual.iterator();
MetaDataLoaderMaterial firstMaterial = iterator.next();
diff --git a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutorTest.java b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutorTest.java
index 346651fe56dc9..6b58dc25f0ce4 100644
--- a/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutorTest.java
+++ b/proxy/backend/core/src/test/java/org/apache/shardingsphere/proxy/backend/handler/distsql/ral/queryable/ShowDistVariablesExecutorTest.java
@@ -57,7 +57,7 @@ void assertExecute() {
executor.setConnectionContext(new DistSQLConnectionContext(mock(QueryContext.class), 1,
mock(DatabaseType.class), mock(DatabaseConnectionManager.class), mock(ExecutorStatementManager.class)));
Collection actual = executor.getRows(mock(ShowDistVariablesStatement.class), contextManager);
- assertThat(actual.size(), is(21));
+ assertThat(actual.size(), is(22));
LocalDataQueryResultRow row = actual.iterator().next();
assertThat(row.getCell(1), is("agent_plugins_enabled"));
assertThat(row.getCell(2), is("true"));
diff --git a/test/e2e/sql/src/test/resources/cases/ral/dataset/empty_rules/show_dist_variables.xml b/test/e2e/sql/src/test/resources/cases/ral/dataset/empty_rules/show_dist_variables.xml
index 1e331d5c4b29c..ae994915738e7 100644
--- a/test/e2e/sql/src/test/resources/cases/ral/dataset/empty_rules/show_dist_variables.xml
+++ b/test/e2e/sql/src/test/resources/cases/ral/dataset/empty_rules/show_dist_variables.xml
@@ -25,6 +25,7 @@
+