This is an automated email from the ASF dual-hosted git repository.
zhonghongsheng pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/shardingsphere.git
The following commit(s) were added to refs/heads/master by this push:
new 3af54758c1f Remove GraalVM Reachability Metadata and nativeTest
related to Etcd's Cluster mode integration (#37356)
3af54758c1f is described below
commit 3af54758c1fca79a21cc713f4d699a20378e0cfc
Author: Ling Hengqian <[email protected]>
AuthorDate: Fri Dec 12 10:47:43 2025 +0800
Remove GraalVM Reachability Metadata and nativeTest related to Etcd's
Cluster mode integration (#37356)
---
.../graalvm-native-image/_index.cn.md | 6 +
.../graalvm-native-image/_index.en.md | 6 +
.../graalvm-native-image/development/_index.cn.md | 5 +-
.../graalvm-native-image/development/_index.en.md | 5 +-
.../reachability-metadata.json | 343 ++++++---------------
test/native/pom.xml | 85 -----
.../test/natived/jdbc/modes/cluster/EtcdTest.java | 118 -------
.../reachability-metadata.json | 10 -
.../test-native/yaml/jdbc/modes/cluster/etcd.yaml | 78 -----
9 files changed, 109 insertions(+), 547 deletions(-)
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md
index 101232d35cc..d7944b233bb 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.cn.md
@@ -343,3 +343,9 @@ without it being registered as reachable. Add it to the
resource metadata to sol
10. 受 `apache/calcite` 使用的 `janino-compiler/janino` 的影响,
ShardingSphere 的 `SQL Federation` 功能在 GraalVM Native Image 下不可用。
这同样导致 ShardingSphere Proxy Native 无法使用 OpenGauss 集成。
+
+11. 受 https://github.com/oracle/graal/issues/11280 影响,
+ Etcd 的 Cluster 模式集成无法在通过 Windows 11 编译的 GraalVM Native Image 下使用,
+ 且 Etcd 的 Cluster 模式会与 GraalVM Tracing Agent 产生冲突。
+ 若开发者需要在通过 Linux 编译的 GraalVM Native Image 下使用 Etcd 的 Cluster 模式,
+ 需要自行提供额外的 GraalVM Reachability Metadata 相关的 JSON。
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md
index 2dc3ef32426..310639c02ae 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/_index.en.md
@@ -354,3 +354,9 @@ without it being registered as reachable. Add it to the
resource metadata to sol
10. Due to the use of `janino-compiler/janino` by `apache/calcite`,
ShardingSphere's `SQL Federation` feature is unavailable in the GraalVM
Native Image.
This also prevents ShardingSphere Proxy Native from integrating with
OpenGauss.
+
+11. Due to the issue at https://github.com/oracle/graal/issues/11280,
+ Etcd's Cluster mode integration cannot be used on GraalVM Native Images
compiled via Windows 11,
+ and Etcd's Cluster mode will conflict with the GraalVM Tracing Agent.
+ If developers need to use Etcd's Cluster mode on GraalVM Native Images
compiled via Linux,
+ they need to provide additional GraalVM Reachability Metadata related JSON
themselves.
\ No newline at end of file
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/development/_index.cn.md
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/development/_index.cn.md
index 777b12f020f..2d69c3bd05b 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/development/_index.cn.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/development/_index.cn.md
@@ -184,7 +184,7 @@ cd ./shardingsphere/
而
`META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/`
中的条目仅应由 `generateMetadata` 的 Maven Profile 生成。
对于测试类和测试文件独立使用的 GraalVM Reachability Metadata,贡献者应该放置到
`shardingsphere-test-native` 子模块的 classpath 的
-`META-INF/native-image/shardingsphere-test-native-test-metadata/` 下。
+`META-INF/native-image/shardingsphere-test-native/` 下。
## 已知限制
@@ -277,9 +277,6 @@ class SolutionTest {
### 单元测试的已知问题
-受 https://github.com/apache/shardingsphere/issues/35052 影响,
-`org.apache.shardingsphere.test.natived.jdbc.modes.cluster.EtcdTest`
的单元测试无法在通过 `Windows 11 Home 24H2` 编译的 GraalVM Native Image 下运行。
-
受 https://github.com/apache/incubator-seata/issues/7523 影响,
`org.apache.shardingsphere.test.natived.proxy.transactions.base.SeataTest`
已被禁用,
因为在 Github Actions Runner 执行此单元测试将导致其他单元测试出现 JDBC 连接泄露。
diff --git
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/development/_index.en.md
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/development/_index.en.md
index 157ded10ae1..e14ae3f20d6 100644
---
a/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/development/_index.en.md
+++
b/docs/document/content/user-manual/shardingsphere-jdbc/graalvm-native-image/development/_index.en.md
@@ -192,7 +192,7 @@ and modified JSON entries should be located in the
`META-INF/native-image/org.ap
while the entries in
`META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/`
should only be generated by the Maven Profile of `generateMetadata`.
For GraalVM Reachability Metadata used independently by test classes and test
files,
-developer should place it in the classpath of the `shardingsphere-test-native`
submodule under
`META-INF/native-image/shardingsphere-test-native-test-metadata/`.
+developer should place it in the classpath of the `shardingsphere-test-native`
submodule under `META-INF/native-image/shardingsphere-test-native/`.
## Known limitations
@@ -286,9 +286,6 @@ class SolutionTest {
### Known issues with unit testing
-Affected by https://github.com/apache/shardingsphere/issues/35052 ,
-the unit test of
`org.apache.shardingsphere.test.natived.jdbc.modes.cluster.EtcdTest` cannot be
run under GraalVM Native Image compiled by `Windows 11 Home 24H2`.
-
Due to https://github.com/apache/incubator-seata/issues/7523 ,
`org.apache.shardingsphere.test.natived.proxy.transactions.base.SeataTest` has
been disabled.
This is because executing this unit test in the Github Actions Runner will
cause JDBC connection leaks in other unit tests.
diff --git
a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json
b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json
index 76c5169626b..527f97c5363 100644
---
a/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json
+++
b/infra/reachability-metadata/src/main/resources/META-INF/native-image/org.apache.shardingsphere/generated-reachability-metadata/reachability-metadata.json
@@ -56,7 +56,7 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.proxy.frontend.ShardingSphereProxy"
},
"type": "java.io.FileDescriptor"
},
@@ -134,7 +134,7 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"
},
"type": "java.lang.BaseVirtualThread"
},
@@ -356,7 +356,8 @@
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.database.metadata.TableChangedHandler"
},
- "type": "java.lang.Object"
+ "type": "java.lang.Object",
+ "allDeclaredFields": true
},
{
"condition": {
@@ -453,29 +454,21 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.type.table.CreateTablePushDownMetaDataRefresher"
+ "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.PushDownMetaDataRefreshEngine"
},
"type": "java.lang.Object"
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.node.rule.tuple.YamlRuleNodeTupleSwapperEngine"
+ "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.type.table.CreateTablePushDownMetaDataRefresher"
},
"type": "java.lang.Object"
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type": "java.lang.Object",
- "allDeclaredFields": true
- },
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository"
+ "typeReached":
"org.apache.shardingsphere.mode.node.rule.tuple.YamlRuleNodeTupleSwapperEngine"
},
- "type": "java.lang.Object",
- "allDeclaredFields": true
+ "type": "java.lang.Object"
},
{
"condition": {
@@ -552,6 +545,22 @@
},
"type": "java.lang.Process"
},
+ {
+ "condition": {
+ "typeReached":
"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"
+ },
+ "type": "java.lang.ProcessHandle",
+ "methods": [
+ {
+ "name": "current",
+ "parameterTypes": []
+ },
+ {
+ "name": "pid",
+ "parameterTypes": []
+ }
+ ]
+ },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser"
@@ -608,44 +617,13 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"
},
"type": "java.lang.Thread",
"methods": [
{
"name": "isVirtual",
"parameterTypes": []
- },
- {
- "name": "ofVirtual",
- "parameterTypes": []
- }
- ]
- },
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type": "java.lang.Thread$Builder",
- "methods": [
- {
- "name": "factory",
- "parameterTypes": []
- }
- ]
- },
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type": "java.lang.Thread$Builder$OfVirtual",
- "methods": [
- {
- "name": "name",
- "parameterTypes": [
- "java.lang.String",
- "long"
- ]
}
]
},
@@ -681,7 +659,7 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"
},
"type": "java.lang.management.ManagementFactory",
"methods": [
@@ -693,7 +671,7 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"
},
"type": "java.lang.management.RuntimeMXBean",
"methods": [
@@ -753,13 +731,13 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"
},
"type": "java.nio.Bits"
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"
},
"type": "java.nio.Buffer",
"fields": [
@@ -770,25 +748,25 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.sqlfederation.compiler.sql.function.mysql.impl.MySQLNotFunction"
},
"type": "java.nio.ByteBuffer"
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.sqlfederation.compiler.sql.function.mysql.impl.MySQLNotFunction"
+ "typeReached":
"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"
},
"type": "java.nio.ByteBuffer"
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"
},
"type": "java.nio.DirectByteBuffer"
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.proxy.frontend.ShardingSphereProxy"
},
"type": "java.nio.channels.FileChannel"
},
@@ -798,6 +776,12 @@
},
"type": "java.nio.channels.spi.SelectorProvider"
},
+ {
+ "condition": {
+ "typeReached":
"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"
+ },
+ "type": "java.nio.channels.spi.SelectorProvider"
+ },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser"
@@ -848,12 +832,6 @@
},
"type": "java.sql.Timestamp"
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type": "java.time.Instant"
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.infra.expr.groovy.GroovyInlineExpressionParser"
@@ -1208,30 +1186,6 @@
},
"type": "java.util.concurrent.Future"
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.manager.cluster.dispatch.listener.DataChangedEventListenerRegistry"
- },
- "type": "java.util.concurrent.atomic.LongAdder"
- },
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type": "java.util.concurrent.atomic.LongAdder",
- "methods": [
- {
- "name": "<init>",
- "parameterTypes": []
- },
- {
- "name": "add",
- "parameterTypes": [
- "long"
- ]
- }
- ]
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.sqlfederation.compiler.sql.function.mysql.impl.MySQLNotFunction"
@@ -3929,18 +3883,6 @@
},
"type":
"org.apache.shardingsphere.infra.expr.literal.LiteralInlineExpressionParser"
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.global.node.compute.type.ComputeNodeOnlineHandler"
- },
- "type":
"org.apache.shardingsphere.infra.instance.yaml.YamlComputeNodeData",
- "methods": [
- {
- "name": "<init>",
- "parameterTypes": []
- }
- ]
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.manager.cluster.persist.service.ClusterComputeNodePersistService"
@@ -4348,7 +4290,8 @@
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.database.metadata.TableChangedHandler"
},
- "type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereColumn"
+ "type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereColumn",
+ "allDeclaredFields": true
},
{
"condition": {
@@ -4411,20 +4354,6 @@
}
]
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereColumn",
- "allDeclaredFields": true
- },
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository"
- },
- "type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereColumn",
- "allDeclaredFields": true
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.infra.metadata.database.schema.builder.SystemSchemaBuilder"
@@ -4447,7 +4376,8 @@
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.database.metadata.TableChangedHandler"
},
- "type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndex"
+ "type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndex",
+ "allDeclaredFields": true
},
{
"condition": {
@@ -4474,20 +4404,6 @@
}
]
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndex",
- "allDeclaredFields": true
- },
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository"
- },
- "type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereIndex",
- "allDeclaredFields": true
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.infra.metadata.database.schema.builder.SystemSchemaBuilder"
@@ -4523,6 +4439,7 @@
"typeReached":
"org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.database.metadata.TableChangedHandler"
},
"type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereTable",
+ "allDeclaredFields": true,
"methods": [
{
"name": "setType",
@@ -4598,23 +4515,15 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.type.table.CreateTablePushDownMetaDataRefresher"
+ "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.PushDownMetaDataRefreshEngine"
},
"type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereTable"
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereTable",
- "allDeclaredFields": true
- },
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository"
+ "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.type.table.CreateTablePushDownMetaDataRefresher"
},
- "type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereTable",
- "allDeclaredFields": true
+ "type":
"org.apache.shardingsphere.infra.yaml.schema.pojo.YamlShardingSphereTable"
},
{
"condition": {
@@ -5255,12 +5164,7 @@
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.database.metadata.TableChangedHandler"
},
- "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.DatabaseMetaDataNodePath",
- "fields": [
- {
- "name": "databaseName"
- }
- ]
+ "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.DatabaseMetaDataNodePath"
},
{
"condition": {
@@ -5427,16 +5331,27 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.type.table.CreateTablePushDownMetaDataRefresher"
+ "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.PushDownMetaDataRefreshEngine"
},
"type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.DatabaseMetaDataNodePath"
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.type.table.CreateTablePushDownMetaDataRefresher"
},
"type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.DatabaseMetaDataNodePath"
},
+ {
+ "condition": {
+ "typeReached":
"org.apache.shardingsphere.mode.node.path.engine.searcher.NodePathSearcher"
+ },
+ "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.DatabaseMetaDataNodePath",
+ "fields": [
+ {
+ "name": "databaseName"
+ }
+ ]
+ },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository"
@@ -5493,12 +5408,6 @@
}
]
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.datasource.StorageNodeNodePath"
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository"
@@ -5569,12 +5478,6 @@
}
]
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.datasource.StorageUnitNodePath"
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository"
@@ -5702,12 +5605,6 @@
}
]
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.rule.DatabaseRuleNodePath"
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository"
@@ -5748,15 +5645,7 @@
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.database.metadata.TableChangedHandler"
},
- "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.schema.SchemaMetaDataNodePath",
- "fields": [
- {
- "name": "database"
- },
- {
- "name": "schemaName"
- }
- ]
+ "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.schema.SchemaMetaDataNodePath"
},
{
"condition": {
@@ -5852,16 +5741,30 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.type.table.CreateTablePushDownMetaDataRefresher"
+ "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.PushDownMetaDataRefreshEngine"
},
"type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.schema.SchemaMetaDataNodePath"
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.type.table.CreateTablePushDownMetaDataRefresher"
},
"type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.schema.SchemaMetaDataNodePath"
},
+ {
+ "condition": {
+ "typeReached":
"org.apache.shardingsphere.mode.node.path.engine.searcher.NodePathSearcher"
+ },
+ "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.schema.SchemaMetaDataNodePath",
+ "fields": [
+ {
+ "name": "database"
+ },
+ {
+ "name": "schemaName"
+ }
+ ]
+ },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository"
@@ -5896,15 +5799,7 @@
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.database.metadata.TableChangedHandler"
},
- "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.schema.TableMetaDataNodePath",
- "fields": [
- {
- "name": "schema"
- },
- {
- "name": "tableName"
- }
- ]
+ "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.schema.TableMetaDataNodePath"
},
{
"condition": {
@@ -5974,16 +5869,30 @@
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.type.table.CreateTablePushDownMetaDataRefresher"
+ "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.PushDownMetaDataRefreshEngine"
},
"type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.schema.TableMetaDataNodePath"
},
{
"condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
+ "typeReached":
"org.apache.shardingsphere.mode.metadata.refresher.pushdown.type.table.CreateTablePushDownMetaDataRefresher"
},
"type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.schema.TableMetaDataNodePath"
},
+ {
+ "condition": {
+ "typeReached":
"org.apache.shardingsphere.mode.node.path.engine.searcher.NodePathSearcher"
+ },
+ "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.schema.TableMetaDataNodePath",
+ "fields": [
+ {
+ "name": "schema"
+ },
+ {
+ "name": "tableName"
+ }
+ ]
+ },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository"
@@ -6048,12 +5957,6 @@
}
]
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "type":
"org.apache.shardingsphere.mode.node.path.type.database.metadata.schema.ViewMetaDataNodePath"
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.repository.cluster.zookeeper.ZookeeperRepository"
@@ -6655,20 +6558,6 @@
}
]
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.manager.cluster.dispatch.handler.global.node.compute.type.ComputeNodeOnlineHandler"
- },
- "type":
"org.apache.shardingsphere.mode.node.path.type.global.node.compute.status.OnlineNodePath",
- "fields": [
- {
- "name": "instanceId"
- },
- {
- "name": "instanceType"
- }
- ]
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.mode.manager.cluster.dispatch.listener.DataChangedEventListenerRegistry"
@@ -11285,18 +11174,6 @@
},
"glob": "META-INF/services/com.atomikos.recovery.OltpLogFactory"
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "glob": "META-INF/services/io.grpc.LoadBalancerProvider"
- },
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "glob": "META-INF/services/io.grpc.NameResolverProvider"
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.transaction.base.seata.at.SeataATShardingSphereTransactionManager"
@@ -11327,18 +11204,6 @@
},
"glob": "META-INF/services/io.seata.discovery.registry.RegistryProvider"
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "glob": "META-INF/services/io.vertx.core.spi.VerticleFactory"
- },
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "glob": "META-INF/services/io.vertx.core.spi.VertxServiceProvider"
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.proxy.backend.config.ProxyConfigurationLoader"
@@ -11825,12 +11690,6 @@
},
"glob": "current-git-commit.properties"
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "glob": "jndi.properties"
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.transaction.xa.atomikos.manager.AtomikosTransactionManagerProvider"
@@ -13241,12 +13100,6 @@
},
"glob": "test-native/yaml/jdbc/features/sharding.yaml"
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.infra.url.classpath.ClassPathLocalFileURLLoader"
- },
- "glob": "test-native/yaml/jdbc/modes/cluster/etcd.yaml"
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.infra.url.classpath.ClassPathLocalFileURLLoader"
@@ -13282,12 +13135,6 @@
"typeReached":
"org.apache.shardingsphere.transaction.xa.atomikos.manager.AtomikosTransactionManagerProvider"
},
"glob": "transactions.properties"
- },
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository"
- },
- "glob": "vertx-default-jul-logging.properties"
}
],
"bundles": []
diff --git a/test/native/pom.xml b/test/native/pom.xml
index cd83cfd24f0..8061aab15f8 100644
--- a/test/native/pom.xml
+++ b/test/native/pom.xml
@@ -33,24 +33,12 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-jdbc</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-proxy-bootstrap</artifactId>
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
-
<artifactId>shardingsphere-infra-data-source-pool-hikari</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-jdbc-dialect-clickhouse</artifactId>
@@ -81,12 +69,6 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-authority-simple</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.apache.shardingsphere</groupId>
<artifactId>shardingsphere-transaction-xa-atomikos</artifactId>
@@ -105,46 +87,7 @@
<version>${project.version}</version>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-sharding-core</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.apache.shardingsphere</groupId>
- <artifactId>shardingsphere-encrypt-core</artifactId>
- <version>${project.version}</version>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>io.vertx</groupId>
- <artifactId>vertx-grpc</artifactId>
- <version>${vertx.version}</version>
- <scope>test</scope>
- </dependency>
-
- <dependency>
- <groupId>com.h2database</groupId>
- <artifactId>h2</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.mysql</groupId>
- <artifactId>mysql-connector-j</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.postgresql</groupId>
- <artifactId>postgresql</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>org.opengauss</groupId>
- <artifactId>opengauss-jdbc</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>com.microsoft.sqlserver</groupId>
<artifactId>mssql-jdbc</artifactId>
@@ -172,16 +115,6 @@
</exclusion>
</exclusions>
</dependency>
- <dependency>
- <groupId>org.firebirdsql.jdbc</groupId>
- <artifactId>jaybird</artifactId>
- <scope>test</scope>
- </dependency>
- <dependency>
- <groupId>com.facebook.presto</groupId>
- <artifactId>presto-jdbc</artifactId>
- <scope>test</scope>
- </dependency>
<dependency>
<groupId>org.testcontainers</groupId>
@@ -208,25 +141,7 @@
<artifactId>curator-test</artifactId>
<scope>test</scope>
</dependency>
- <dependency>
- <groupId>io.etcd</groupId>
- <artifactId>jetcd-test</artifactId>
- <version>${jetcd.version}</version>
- <scope>test</scope>
- <exclusions>
- <!-- See
https://github.com/testcontainers/testcontainers-java/issues/8338 -->
- <exclusion>
- <groupId>org.apache.commons</groupId>
- <artifactId>commons-compress</artifactId>
- </exclusion>
- </exclusions>
- </dependency>
- <dependency>
- <groupId>ch.qos.logback</groupId>
- <artifactId>logback-classic</artifactId>
- </dependency>
</dependencies>
-
<build>
<plugins>
<plugin>
diff --git
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/modes/cluster/EtcdTest.java
b/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/modes/cluster/EtcdTest.java
deleted file mode 100644
index 098fefc93b5..00000000000
---
a/test/native/src/test/java/org/apache/shardingsphere/test/natived/jdbc/modes/cluster/EtcdTest.java
+++ /dev/null
@@ -1,118 +0,0 @@
-/*
- * Licensed to the Apache Software Foundation (ASF) under one or more
- * contributor license agreements. See the NOTICE file distributed with
- * this work for additional information regarding copyright ownership.
- * The ASF licenses this file to You under the Apache License, Version 2.0
- * (the "License"); you may not use this file except in compliance with
- * the License. You may obtain a copy of the License at
- *
- * http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.apache.shardingsphere.test.natived.jdbc.modes.cluster;
-
-import com.zaxxer.hikari.HikariConfig;
-import com.zaxxer.hikari.HikariDataSource;
-import io.etcd.jetcd.test.EtcdClusterExtension;
-import org.apache.shardingsphere.test.natived.commons.TestShardingService;
-import org.apache.shardingsphere.test.natived.commons.util.ResourceUtils;
-import org.awaitility.Awaitility;
-import org.junit.jupiter.api.AfterEach;
-import org.junit.jupiter.api.BeforeEach;
-import org.junit.jupiter.api.Test;
-import org.junit.jupiter.api.condition.DisabledOnOs;
-import org.junit.jupiter.api.condition.EnabledInNativeImage;
-import org.junit.jupiter.api.condition.OS;
-import org.junit.jupiter.api.extension.RegisterExtension;
-
-import javax.sql.DataSource;
-import java.net.URI;
-import java.sql.Connection;
-import java.sql.SQLException;
-import java.time.Duration;
-import java.util.List;
-
-import static org.hamcrest.MatcherAssert.assertThat;
-import static org.hamcrest.Matchers.is;
-import static org.hamcrest.Matchers.nullValue;
-
-/**
- * TODO This unit test cannot be run under GraalVM Native Image compiled with
Windows 11, pending investigation.
- */
-@SuppressWarnings("SqlNoDataSourceInspection")
-@EnabledInNativeImage
-@DisabledOnOs(OS.WINDOWS)
-class EtcdTest {
-
- @RegisterExtension
- public static final EtcdClusterExtension CLUSTER =
EtcdClusterExtension.builder()
- .withNodes(1)
- .withMountDirectory(false)
- .build();
-
- private final String systemPropKeyPrefix =
"fixture.test-native.yaml.mode.cluster.etcd.";
-
- private DataSource logicDataSource;
-
- private TestShardingService testShardingService;
-
- @BeforeEach
- void beforeEach() {
- assertThat(System.getProperty(systemPropKeyPrefix + "server-lists"),
is(nullValue()));
- }
-
- @AfterEach
- void afterEach() throws SQLException {
- ResourceUtils.closeJdbcDataSource(logicDataSource);
- System.clearProperty(systemPropKeyPrefix + "server-lists");
- }
-
- @Test
- void assertShardingInLocalTransactions() throws SQLException {
- logicDataSource = createDataSource(CLUSTER.clientEndpoints());
- testShardingService = new TestShardingService(logicDataSource);
- initEnvironment();
- testShardingService.processSuccess();
- testShardingService.cleanEnvironment();
- }
-
- /**
- * TODO On low-performance devices in Github Actions, `TRUNCATE TABLE`
related SQLs may throw a `java.sql.SQLException: Table or view 't_address' does
not exist.` error under nativeTest.
- * So that we need to wait for a period of time after executing `CREATE
TABLE` related SQLs before executing `TRUNCATE TABLE` related SQLs.
- * This may mean that the implementation of {@link
org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository} needs
optimization.
- *
- * @see
org.apache.shardingsphere.mode.repository.cluster.etcd.EtcdRepository
- * @throws SQLException SQL exception
- */
- private void initEnvironment() throws SQLException {
-
testShardingService.getOrderRepository().createTableIfNotExistsInMySQL();
-
testShardingService.getOrderItemRepository().createTableIfNotExistsInMySQL();
-
testShardingService.getAddressRepository().createTableIfNotExistsInMySQL();
-
Awaitility.await().atMost(Duration.ofMinutes(2L)).ignoreExceptions().until(()
-> {
- try (Connection connection = logicDataSource.getConnection()) {
- connection.createStatement().execute("SELECT * FROM t_order");
- connection.createStatement().execute("SELECT * FROM
t_order_item");
- connection.createStatement().execute("SELECT * FROM
t_address");
- }
- return true;
- });
- testShardingService.getOrderRepository().truncateTable();
- testShardingService.getOrderItemRepository().truncateTable();
- testShardingService.getAddressRepository().truncateTable();
- }
-
- private DataSource createDataSource(final List<URI> clientEndpoints) {
- URI clientEndpoint = clientEndpoints.get(0);
- HikariConfig config = new HikariConfig();
-
config.setDriverClassName("org.apache.shardingsphere.driver.ShardingSphereDriver");
-
config.setJdbcUrl("jdbc:shardingsphere:classpath:test-native/yaml/jdbc/modes/cluster/etcd.yaml?placeholder-type=system_props");
- System.setProperty(systemPropKeyPrefix + "server-lists",
clientEndpoint.toString());
- return new HikariDataSource(config);
- }
-}
diff --git
a/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/reachability-metadata.json
b/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native/reachability-metadata.json
similarity index 96%
rename from
test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/reachability-metadata.json
rename to
test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native/reachability-metadata.json
index dcbca4c61eb..f775cf3df0a 100644
---
a/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native-test-metadata/reachability-metadata.json
+++
b/test/native/src/test/resources/META-INF/native-image/shardingsphere-test-native/reachability-metadata.json
@@ -54,16 +54,6 @@
"allPublicMethods": true,
"allDeclaredFields": true
},
- {
- "condition": {
- "typeReached":
"org.apache.shardingsphere.test.natived.jdbc.modes.cluster.EtcdTest"
- },
- "type":
"org.apache.shardingsphere.test.natived.jdbc.modes.cluster.EtcdTest",
- "allDeclaredConstructors": true,
- "allDeclaredMethods": true,
- "allPublicMethods": true,
- "allDeclaredFields": true
- },
{
"condition": {
"typeReached":
"org.apache.shardingsphere.test.natived.jdbc.features.EncryptTest"
diff --git
a/test/native/src/test/resources/test-native/yaml/jdbc/modes/cluster/etcd.yaml
b/test/native/src/test/resources/test-native/yaml/jdbc/modes/cluster/etcd.yaml
deleted file mode 100644
index 3f5fec30ab7..00000000000
---
a/test/native/src/test/resources/test-native/yaml/jdbc/modes/cluster/etcd.yaml
+++ /dev/null
@@ -1,78 +0,0 @@
-#
-# Licensed to the Apache Software Foundation (ASF) under one or more
-# contributor license agreements. See the NOTICE file distributed with
-# this work for additional information regarding copyright ownership.
-# The ASF licenses this file to You under the Apache License, Version 2.0
-# (the "License"); you may not use this file except in compliance with
-# the License. You may obtain a copy of the License at
-#
-# http://www.apache.org/licenses/LICENSE-2.0
-#
-# Unless required by applicable law or agreed to in writing, software
-# distributed under the License is distributed on an "AS IS" BASIS,
-# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-# See the License for the specific language governing permissions and
-# limitations under the License.
-#
-
-mode:
- type: Cluster
- repository:
- type: etcd
- props:
- namespace: governance-etcd-data-source
- server-lists:
$${fixture.test-native.yaml.mode.cluster.etcd.server-lists::}
-
-dataSources:
- ds_0:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: org.h2.Driver
- jdbcUrl:
jdbc:h2:mem:cluster_etcd_ds_0;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: sa
- password:
- ds_1:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: org.h2.Driver
- jdbcUrl:
jdbc:h2:mem:cluster_etcd_ds_1;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: sa
- password:
- ds_2:
- dataSourceClassName: com.zaxxer.hikari.HikariDataSource
- driverClassName: org.h2.Driver
- jdbcUrl:
jdbc:h2:mem:cluster_etcd_ds_2;MODE=MYSQL;IGNORECASE=TRUE;CASE_INSENSITIVE_IDENTIFIERS=TRUE
- username: sa
- password:
-
-rules:
- - !SHARDING
- tables:
- t_order:
- actualDataNodes: <LITERAL>ds_0.t_order, ds_1.t_order, ds_2.t_order
- keyGenerateStrategy:
- column: order_id
- keyGeneratorName: snowflake
- t_order_item:
- actualDataNodes: <LITERAL>ds_0.t_order_item, ds_1.t_order_item,
ds_2.t_order_item
- keyGenerateStrategy:
- column: order_item_id
- keyGeneratorName: snowflake
- defaultDatabaseStrategy:
- standard:
- shardingColumn: user_id
- shardingAlgorithmName: inline
- shardingAlgorithms:
- inline:
- type: CLASS_BASED
- props:
- strategy: STANDARD
- algorithmClassName:
org.apache.shardingsphere.test.natived.commons.algorithm.ClassBasedInlineShardingAlgorithmFixture
- keyGenerators:
- snowflake:
- type: SNOWFLAKE
- auditors:
- sharding_key_required_auditor:
- type: DML_SHARDING_CONDITIONS
-
- - !BROADCAST
- tables:
- - t_address