From c83b1834d1fb75f08baefe0847487eb367095f52 Mon Sep 17 00:00:00 2001 From: linghengqian Date: Sun, 18 Aug 2024 11:29:49 +0800 Subject: [PATCH] Prevent use of GraalVM Native Build Tools Maven Plugin in parallel builds of project --- .github/workflows/graalvm.yml | 3 ++- .github/workflows/nightly-build.yml | 9 ++------- .github/workflows/nightly-ci-dynamic.yml | 11 +++-------- .github/workflows/nightly-ci.yml | 11 +++-------- .../proxy/src/main/release-docs/LICENSE | 2 +- .../graalvm-native-image/_index.cn.md | 18 ++++++++++++------ .../graalvm-native-image/_index.en.md | 18 +++++++++++------- .../EspressoInlineExpressionParserTest.java | 5 ++--- pom.xml | 6 +++--- 9 files changed, 39 insertions(+), 44 deletions(-) diff --git a/.github/workflows/graalvm.yml b/.github/workflows/graalvm.yml index 5e18a18001f4f..b50bf4e50906e 100644 --- a/.github/workflows/graalvm.yml +++ b/.github/workflows/graalvm.yml @@ -54,5 +54,6 @@ jobs: distribution: 'graalvm-community' github-token: ${{ secrets.GITHUB_TOKEN }} cache: 'maven' + native-image-job-reports: 'true' - name: Run nativeTest with GraalVM CE for ${{ matrix.java-version }} - run: ./mvnw -PnativeTestInShardingSphere -T1C -e clean test + run: ./mvnw -PnativeTestInShardingSphere -e clean test diff --git a/.github/workflows/nightly-build.yml b/.github/workflows/nightly-build.yml index 56d8f88c53b67..f409d3b26c274 100644 --- a/.github/workflows/nightly-build.yml +++ b/.github/workflows/nightly-build.yml @@ -123,13 +123,8 @@ jobs: java-version: '22.0.2' distribution: 'graalvm-community' github-token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-cache-${{ github.sha }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-cache- - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- + cache: 'maven' + native-image-job-reports: 'true' - uses: docker/login-action@v3 with: registry: ${{ env.HUB }} diff --git a/.github/workflows/nightly-ci-dynamic.yml b/.github/workflows/nightly-ci-dynamic.yml index ca6b480f57461..984d519026062 100644 --- a/.github/workflows/nightly-ci-dynamic.yml +++ b/.github/workflows/nightly-ci-dynamic.yml @@ -129,12 +129,7 @@ jobs: java-version: '22.0.2' distribution: 'graalvm-community' github-token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-cache-${{ github.sha }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-cache- - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- + cache: 'maven' + native-image-job-reports: 'true' - name: Run nativeTest with GraalVM CE - run: ./mvnw -PnativeTestInShardingSphere -T1C -e clean test + run: ./mvnw -PnativeTestInShardingSphere -e clean test diff --git a/.github/workflows/nightly-ci.yml b/.github/workflows/nightly-ci.yml index 2691845de1b65..7416ed6c1324d 100644 --- a/.github/workflows/nightly-ci.yml +++ b/.github/workflows/nightly-ci.yml @@ -118,12 +118,7 @@ jobs: java-version: '22.0.2' distribution: 'graalvm-community' github-token: ${{ secrets.GITHUB_TOKEN }} - - uses: actions/cache@v4 - with: - path: ~/.m2/repository - key: ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-cache-${{ github.sha }} - restore-keys: | - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party-cache- - ${{ needs.global-environment.outputs.GLOBAL_CACHE_PREFIX }}-maven-third-party- + cache: 'maven' + native-image-job-reports: 'true' - name: Run nativeTest with GraalVM CE - run: ./mvnw -PnativeTestInShardingSphere -T1C -e clean test + run: ./mvnw -PnativeTestInShardingSphere -e clean test diff --git a/distribution/proxy/src/main/release-docs/LICENSE b/distribution/proxy/src/main/release-docs/LICENSE index 7ac53fa78a35a..902e41064f467 100644 --- a/distribution/proxy/src/main/release-docs/LICENSE +++ b/distribution/proxy/src/main/release-docs/LICENSE @@ -240,7 +240,7 @@ The text of each license is the standard Apache 2.0 license. failsafe 2.4.4: https://github.com/jhalterman/failsafe, Apache 2.0 failureaccess 1.0.1: https://github.com/google/guava, Apache 2.0 freemarker 2.3.31: https://freemarker.apache.org/, Apache 2.0 - groovy 4.0.19: https://groovy.apache.org/, Apache 2.0 + groovy 4.0.22: https://groovy.apache.org/, Apache 2.0 grpc-api 1.65.1: https://github.com/grpc/grpc-java, Apache 2.0 grpc-context 1.65.1: https://github.com/grpc/grpc-java, Apache 2.0 grpc-core 1.65.1: https://github.com/grpc/grpc-java, Apache 2.0 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 00e3b8d6c8dbc..a25a5f041a93a 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 @@ -393,7 +393,7 @@ ClickHouse 不支持 ShardingSphere 集成级别的本地事务,XA 事务和 S io.github.linghengqian hive-server2-jdbc-driver-thin - 1.0.0 + 1.2.0 com.fasterxml.woodstox @@ -442,8 +442,7 @@ Args=--initialize-at-run-time=\ 用户应当考虑在 ShardingSphere JDBC 中仅使用支持 ACID 的表。`apache/hive` 提供了多种事务解决方案。 第1种选择是使用 ACID 表,可能的建表流程如下。 -如果用户在 ACID 表上频繁更新和删除数据,用户可能不得不在 DML 语句执行前后进行等待, -以让 HiveServer2 完成低效的 DML 操作,因为 ACID 表中数据是在文件夹级别跟踪。 +由于其过时的基于目录的表格式,用户可能不得不在 DML 语句执行前后进行等待,以让 HiveServer2 完成低效的 DML 操作。 ```sql set metastore.compactor.initiator.on=true; @@ -465,7 +464,9 @@ CREATE TABLE IF NOT EXISTS t_order ) CLUSTERED BY (order_id) INTO 2 BUCKETS STORED AS ORC TBLPROPERTIES ('transactional' = 'true'); ``` -第2种选择是使用 Iceberg 表,可能的建表流程如下。`apache/iceberg` 表格式有望在未来几年取代传统的 Hive 表格式。 +第2种选择是使用 Iceberg 表,可能的建表流程如下。 +Apache Iceberg 表格式有望在未来几年取代传统的 Hive 表格式, +参考 https://blog.cloudera.com/from-hive-tables-to-iceberg-tables-hassle-free/ 。 ```sql set iceberg.mr.schema.auto.conversion=true; @@ -510,7 +511,7 @@ sudo apt-get install build-essential zlib1g-dev -y git clone git@github.com:apache/shardingsphere.git cd ./shardingsphere/ -./mvnw -PnativeTestInShardingSphere -T1C -e clean test +./mvnw -PnativeTestInShardingSphere -e clean test ``` 当贡献者发现缺少与 ShardingSphere 无关的第三方库的 GraalVM Reachability Metadata 时,应当在 @@ -539,5 +540,10 @@ Reachability Metadata 位于 `shardingsphere-infra-reachability-metadata` 子模 ```bash git clone git@github.com:apache/shardingsphere.git cd ./shardingsphere/ -./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C clean test native:metadata-copy +./mvnw -PgenerateMetadata -DskipNativeTests -e clean test native:metadata-copy ``` + +在使用 GraalVM Native Build Tools 的 Maven Plugin 时, +贡献者应避免使用 Maven 的并行构建功能。 +GraalVM Native Build Tools 的 Maven Plugin并不是线程安全的, +它与 https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3 不兼容。 \ No newline at end of file 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 8b21583c66a00..f2596cbe2a921 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 @@ -409,7 +409,7 @@ An example of a possible configuration is as follows, io.github.linghengqian hive-server2-jdbc-driver-thin - 1.0.0 + 1.2.0 com.fasterxml.woodstox @@ -459,8 +459,8 @@ In order to be able to use DML SQL statements such as `delete`, when connecting users should consider using only ACID-supported tables in ShardingSphere JDBC. `apache/hive` provides a variety of transaction solutions. The first option is to use ACID tables, and the possible table creation process is as follows. -If users frequently update and delete data on ACID tables, users may have to wait before and after the execution of DML statements, -to allow HiveServer2 to complete inefficient DML operations, because data in ACID tables is tracked at the folder level. +Due to its outdated catalog-based table format, +users may have to wait before and after DML statement execution to let HiveServer2 complete the inefficient DML operations. ```sql set metastore.compactor.initiator.on=true; @@ -482,8 +482,9 @@ CREATE TABLE IF NOT EXISTS t_order ) CLUSTERED BY (order_id) INTO 2 BUCKETS STORED AS ORC TBLPROPERTIES ('transactional' = 'true'); ``` -The second option is to use Iceberg table. The possible table creation process is as follows. -The `apache/iceberg` table format is expected to replace the traditional Hive table format in the next few years. +The second option is to use Iceberg table. The possible table creation process is as follows. +Apache Iceberg table format is poised to replace the traditional Hive table format in the coming years, +see https://blog.cloudera.com/from-hive-tables-to-iceberg-tables-hassle-free/ . ```sql set iceberg.mr.schema.auto.conversion=true; @@ -530,7 +531,7 @@ sudo apt-get install build-essential zlib1g-dev -y git clone git@github.com:apache/shardingsphere.git cd ./shardingsphere/ -./mvnw -PnativeTestInShardingSphere -T1C -e clean test +./mvnw -PnativeTestInShardingSphere -e clean test ``` When contributors discover that GraalVM Reachability Metadata is missing for a third-party library not related to ShardingSphere, @@ -560,5 +561,8 @@ contributors should place it on the classpath of the `shardingsphere-test-native ```bash git clone git@github.com:apache/shardingsphere.git cd ./shardingsphere/ -./mvnw -PgenerateMetadata -DskipNativeTests -e -T1C clean test native:metadata-copy +./mvnw -PgenerateMetadata -DskipNativeTests -e clean test native:metadata-copy ``` + +Contributors should avoid using Maven's parallel builds feature when using the Maven Plugin for GraalVM Native Build Tools. +The Maven Plugin for GraalVM Native Build Tools is not thread-safe and is incompatible with https://cwiki.apache.org/confluence/display/MAVEN/Parallel+builds+in+Maven+3 . diff --git a/infra/expr/type/espresso/src/test/java/org/apache/shardingsphere/infra/expr/espresso/EspressoInlineExpressionParserTest.java b/infra/expr/type/espresso/src/test/java/org/apache/shardingsphere/infra/expr/espresso/EspressoInlineExpressionParserTest.java index 2af84254d2341..7d97b17e1f3f4 100644 --- a/infra/expr/type/espresso/src/test/java/org/apache/shardingsphere/infra/expr/espresso/EspressoInlineExpressionParserTest.java +++ b/infra/expr/type/espresso/src/test/java/org/apache/shardingsphere/infra/expr/espresso/EspressoInlineExpressionParserTest.java @@ -20,9 +20,8 @@ import org.apache.shardingsphere.infra.expr.spi.InlineExpressionParser; import org.apache.shardingsphere.infra.spi.type.typed.TypedSPILoader; import org.junit.jupiter.api.Test; -import org.junit.jupiter.api.condition.EnabledForJreRange; +import org.junit.jupiter.api.condition.EnabledIfSystemProperty; import org.junit.jupiter.api.condition.EnabledOnOs; -import org.junit.jupiter.api.condition.JRE; import org.junit.jupiter.api.condition.OS; import java.util.Collections; @@ -34,7 +33,7 @@ import static org.hamcrest.MatcherAssert.assertThat; import static org.junit.jupiter.api.Assertions.assertThrows; -@EnabledForJreRange(min = JRE.JAVA_22) +@EnabledIfSystemProperty(named = "java.vm.vendor", matches = "GraalVM Community", disabledReason = "Github Actions device performance is too low") @EnabledOnOs(value = OS.LINUX, architectures = "amd64", disabledReason = "See https://www.graalvm.org/jdk21/reference-manual/java-on-truffle/faq/#does-java-running-on-truffle-run-on-hotspot-too") class EspressoInlineExpressionParserTest { diff --git a/pom.xml b/pom.xml index 45cf9cbb3fb3e..aa1b4f46a4dbb 100644 --- a/pom.xml +++ b/pom.xml @@ -84,7 +84,7 @@ 2.4.10 2.4.9 9.3 - 4.0.19 + 4.0.22 2.3.31 1.14.13 @@ -126,7 +126,7 @@ 2.4.2 0.6.3 4.0.0 - 1.0.0 + 1.2.0 0.282 4.0.3 @@ -140,7 +140,7 @@ 2.2 4.11.0 4.2.0 - 1.20.0 + 1.20.1 1.9.0 24.0.2