From 0e9ab5499fd362be1fec669ba5a2c2c57c5cb874 Mon Sep 17 00:00:00 2001 From: JackieTien97 Date: Tue, 19 May 2026 10:46:47 +0800 Subject: [PATCH 1/4] feat: pass -Dtsfile.locale=zh to JVM under with-zh-locale build TsFile (apache/tsfile#820) selects its message locale at runtime via the -Dtsfile.locale system property. Wire IoTDB's with-zh-locale build to emit a filtered conf/iotdb-locale.{sh,bat} that the env scripts source on startup, appending -Dtsfile.locale=zh to IOTDB_JMX_OPTS / CONFIGNODE_JMX_OPTS so packaged Chinese builds also get Chinese log/exception messages from tsfile. --- distribution/src/assembly/all.xml | 12 +++++++++ distribution/src/assembly/confignode.xml | 10 ++++++++ distribution/src/assembly/datanode.xml | 10 ++++++++ integration-test/src/assembly/mpp-test.xml | 14 +++++++++++ .../confignode/src/assembly/confignode.xml | 10 ++++++++ iotdb-core/datanode/src/assembly/server.xml | 10 ++++++++ pom.xml | 2 ++ scripts/conf/confignode-env.sh | 10 ++++++++ scripts/conf/datanode-env.sh | 9 +++++++ scripts/conf/iotdb-locale.sh | 25 +++++++++++++++++++ scripts/conf/windows/confignode-env.bat | 9 +++++++ scripts/conf/windows/datanode-env.bat | 9 +++++++ scripts/conf/windows/iotdb-locale.bat | 24 ++++++++++++++++++ 13 files changed, 154 insertions(+) create mode 100644 scripts/conf/iotdb-locale.sh create mode 100644 scripts/conf/windows/iotdb-locale.bat diff --git a/distribution/src/assembly/all.xml b/distribution/src/assembly/all.xml index 1b2e1be054f3e..f6de84f22ad69 100644 --- a/distribution/src/assembly/all.xml +++ b/distribution/src/assembly/all.xml @@ -64,9 +64,21 @@ ainode-env.* **/ainode-env.* + iotdb-locale.* + **/iotdb-locale.* 0755 + + conf + ${project.basedir}/../scripts/conf + + iotdb-locale.sh + windows/iotdb-locale.bat + + true + 0755 + sbin ${project.basedir}/../scripts/sbin diff --git a/distribution/src/assembly/confignode.xml b/distribution/src/assembly/confignode.xml index 23665f09a2e99..0083dc8e3d6a5 100644 --- a/distribution/src/assembly/confignode.xml +++ b/distribution/src/assembly/confignode.xml @@ -55,6 +55,16 @@ 0755 + + ${project.basedir}/../scripts/conf + conf + + iotdb-locale.sh + windows/iotdb-locale.bat + + true + 0755 + ${project.basedir}/../scripts/sbin sbin diff --git a/distribution/src/assembly/datanode.xml b/distribution/src/assembly/datanode.xml index 225fa5a7e7d28..8ab582f304c67 100644 --- a/distribution/src/assembly/datanode.xml +++ b/distribution/src/assembly/datanode.xml @@ -51,6 +51,16 @@ 0755 + + ${project.basedir}/../scripts/conf + conf + + iotdb-locale.sh + windows/iotdb-locale.bat + + true + 0755 + ${project.basedir}/../scripts/sbin sbin diff --git a/integration-test/src/assembly/mpp-test.xml b/integration-test/src/assembly/mpp-test.xml index 3915c4593a946..5b54a9e203b01 100644 --- a/integration-test/src/assembly/mpp-test.xml +++ b/integration-test/src/assembly/mpp-test.xml @@ -49,6 +49,20 @@ conf ${project.basedir}/../scripts/conf + + iotdb-locale.* + **/iotdb-locale.* + + 0755 + + + conf + ${project.basedir}/../scripts/conf + + iotdb-locale.sh + windows/iotdb-locale.bat + + true 0755 diff --git a/iotdb-core/confignode/src/assembly/confignode.xml b/iotdb-core/confignode/src/assembly/confignode.xml index 0c2e66d8f9582..a88f54db469c5 100644 --- a/iotdb-core/confignode/src/assembly/confignode.xml +++ b/iotdb-core/confignode/src/assembly/confignode.xml @@ -45,6 +45,16 @@ 0755 + + ${project.basedir}/../../scripts/conf + conf + + iotdb-locale.sh + windows/iotdb-locale.bat + + true + 0755 + ${project.basedir}/../../scripts/sbin sbin diff --git a/iotdb-core/datanode/src/assembly/server.xml b/iotdb-core/datanode/src/assembly/server.xml index 0822b9ae568ba..ff2e704e33c3e 100644 --- a/iotdb-core/datanode/src/assembly/server.xml +++ b/iotdb-core/datanode/src/assembly/server.xml @@ -45,6 +45,16 @@ 0755 + + ${project.basedir}/../../scripts/conf + conf + + iotdb-locale.sh + windows/iotdb-locale.bat + + true + 0755 + ${project.basedir}/../../scripts/sbin sbin diff --git a/pom.xml b/pom.xml index 6fad8ff9407f0..e7e7efd7739e0 100644 --- a/pom.xml +++ b/pom.xml @@ -166,6 +166,7 @@ 1.5.6-3 2.3.0-260422-SNAPSHOT en + + ${project.basedir}/../../scripts/conf/iotdb-common.sh conf/iotdb-common.sh + true diff --git a/scripts/conf/confignode-env.sh b/scripts/conf/confignode-env.sh index 7f4eb40b98062..6cf29cb32da72 100644 --- a/scripts/conf/confignode-env.sh +++ b/scripts/conf/confignode-env.sh @@ -322,13 +322,10 @@ CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS -Djdk.nio.maxCachedBufferSize=${MAX_CA CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS -XX:+CrashOnOutOfMemoryError" CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS -Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8" -# Apply tsfile locale option populated by Maven at package time -# (see conf/iotdb-locale.sh; empty in default build, "-Dtsfile.locale=zh" under with-zh-locale). -if [ -f "${CONFIGNODE_CONF}/iotdb-locale.sh" ]; then - . "${CONFIGNODE_CONF}/iotdb-locale.sh" - if [ -n "$TSFILE_LOCALE_JVM_OPT" ]; then - CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS $TSFILE_LOCALE_JVM_OPT" - fi +# Append tsfile locale option populated by Maven at package time +# (see conf/iotdb-common.sh; empty in default build, "-Dtsfile.locale=zh" under with-zh-locale). +if [ -n "$TSFILE_LOCALE_JVM_OPT" ]; then + CONFIGNODE_JMX_OPTS="$CONFIGNODE_JMX_OPTS $TSFILE_LOCALE_JVM_OPT" fi # if you want to dump the heap memory while OOM happening, you can use the following command, remember to replace ${heap_dump_dir}/confignode_heapdump.hprof with your own file path and the folder where this file is located needs to be created in advance diff --git a/scripts/conf/datanode-env.sh b/scripts/conf/datanode-env.sh index 00c894e1fbbc2..f600066a8486e 100755 --- a/scripts/conf/datanode-env.sh +++ b/scripts/conf/datanode-env.sh @@ -339,13 +339,10 @@ IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:SafepointTimeoutDelay=1000" IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -XX:+SafepointTimeout" IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS -Dsun.jnu.encoding=UTF-8 -Dfile.encoding=UTF-8" -# Apply tsfile locale option populated by Maven at package time -# (see conf/iotdb-locale.sh; empty in default build, "-Dtsfile.locale=zh" under with-zh-locale). -if [ -f "${IOTDB_CONF}/iotdb-locale.sh" ]; then - . "${IOTDB_CONF}/iotdb-locale.sh" - if [ -n "$TSFILE_LOCALE_JVM_OPT" ]; then - IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS $TSFILE_LOCALE_JVM_OPT" - fi +# Append tsfile locale option populated by Maven at package time +# (see conf/iotdb-common.sh; empty in default build, "-Dtsfile.locale=zh" under with-zh-locale). +if [ -n "$TSFILE_LOCALE_JVM_OPT" ]; then + IOTDB_JMX_OPTS="$IOTDB_JMX_OPTS $TSFILE_LOCALE_JVM_OPT" fi # option below tries to optimize safepoint stw time for large counted loop. diff --git a/scripts/conf/iotdb-common.sh b/scripts/conf/iotdb-common.sh index 0236fef3f4139..057622f53f0ad 100755 --- a/scripts/conf/iotdb-common.sh +++ b/scripts/conf/iotdb-common.sh @@ -18,6 +18,12 @@ # under the License. # +# JVM option for selecting tsfile's runtime locale (log/exception messages). +# Filtered by Maven at package time: +# - Default build: empty (English). +# - `with-zh-locale` profile: "-Dtsfile.locale=zh". +TSFILE_LOCALE_JVM_OPT="@tsfile.locale.opt@" + # this function is for parsing the variables like "A=B" in `start-server.sh -D A=B` # The command just parse IOTDB-prefixed variables and ignore all other variables diff --git a/scripts/conf/iotdb-locale.sh b/scripts/conf/iotdb-locale.sh deleted file mode 100644 index f49b803057b8b..0000000000000 --- a/scripts/conf/iotdb-locale.sh +++ /dev/null @@ -1,25 +0,0 @@ -#!/bin/bash -# -# 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. -# - -# JVM option for selecting tsfile's runtime locale (log/exception messages). -# This file is filtered by Maven at package time: -# - Default build: TSFILE_LOCALE_JVM_OPT is empty (English). -# - `with-zh-locale` profile: TSFILE_LOCALE_JVM_OPT="-Dtsfile.locale=zh". -TSFILE_LOCALE_JVM_OPT="@tsfile.locale.opt@" From 8fb49b64d7b53b71b2dbb7f29827ea329b759653 Mon Sep 17 00:00:00 2001 From: JackieTien97 Date: Wed, 20 May 2026 12:20:02 +0800 Subject: [PATCH 3/4] Bump tsfile version to 2.3.1-260519-SNAPSHOT --- distribution/src/assembly/all.xml | 4 ++-- distribution/src/assembly/confignode.xml | 2 +- integration-test/src/assembly/mpp-test.xml | 4 ++-- iotdb-core/confignode/src/assembly/confignode.xml | 2 +- iotdb-core/datanode/src/assembly/server.xml | 2 +- pom.xml | 2 +- scripts/conf/windows/confignode-env.bat | 6 +++--- scripts/conf/windows/datanode-env.bat | 6 +++--- scripts/conf/windows/{iotdb-locale.bat => iotdb-common.bat} | 0 9 files changed, 14 insertions(+), 14 deletions(-) rename scripts/conf/windows/{iotdb-locale.bat => iotdb-common.bat} (100%) diff --git a/distribution/src/assembly/all.xml b/distribution/src/assembly/all.xml index b6bf8205de04c..c8b583de66460 100644 --- a/distribution/src/assembly/all.xml +++ b/distribution/src/assembly/all.xml @@ -65,7 +65,7 @@ ainode-env.* **/ainode-env.* iotdb-common.sh - **/iotdb-locale.* + **/iotdb-common.bat 0755 @@ -74,7 +74,7 @@ ${project.basedir}/../scripts/conf iotdb-common.sh - windows/iotdb-locale.bat + windows/iotdb-common.bat true 0755 diff --git a/distribution/src/assembly/confignode.xml b/distribution/src/assembly/confignode.xml index d7edb611f8fee..6c3d04558eb65 100644 --- a/distribution/src/assembly/confignode.xml +++ b/distribution/src/assembly/confignode.xml @@ -59,7 +59,7 @@ conf iotdb-common.sh - windows/iotdb-locale.bat + windows/iotdb-common.bat true 0755 diff --git a/integration-test/src/assembly/mpp-test.xml b/integration-test/src/assembly/mpp-test.xml index b7c532f8c58bf..58bb8da0e1562 100644 --- a/integration-test/src/assembly/mpp-test.xml +++ b/integration-test/src/assembly/mpp-test.xml @@ -51,7 +51,7 @@ ${project.basedir}/../scripts/conf iotdb-common.sh - **/iotdb-locale.* + **/iotdb-common.bat 0755 @@ -60,7 +60,7 @@ ${project.basedir}/../scripts/conf iotdb-common.sh - windows/iotdb-locale.bat + windows/iotdb-common.bat true 0755 diff --git a/iotdb-core/confignode/src/assembly/confignode.xml b/iotdb-core/confignode/src/assembly/confignode.xml index 5c9058470a40d..659b42fd14d09 100644 --- a/iotdb-core/confignode/src/assembly/confignode.xml +++ b/iotdb-core/confignode/src/assembly/confignode.xml @@ -49,7 +49,7 @@ ${project.basedir}/../../scripts/conf conf - windows/iotdb-locale.bat + windows/iotdb-common.bat true 0755 diff --git a/iotdb-core/datanode/src/assembly/server.xml b/iotdb-core/datanode/src/assembly/server.xml index a52202e1538d8..2e1dab2e5844d 100644 --- a/iotdb-core/datanode/src/assembly/server.xml +++ b/iotdb-core/datanode/src/assembly/server.xml @@ -49,7 +49,7 @@ ${project.basedir}/../../scripts/conf conf - windows/iotdb-locale.bat + windows/iotdb-common.bat true 0755 diff --git a/pom.xml b/pom.xml index d4b5a54e89090..702771f6a7925 100644 --- a/pom.xml +++ b/pom.xml @@ -164,7 +164,7 @@ 0.14.1 1.9 1.5.6-3 - 2.3.0-260422-SNAPSHOT + 2.3.1-260519-SNAPSHOT en diff --git a/scripts/conf/windows/confignode-env.bat b/scripts/conf/windows/confignode-env.bat index f47a52264a999..baeed00466779 100644 --- a/scripts/conf/windows/confignode-env.bat +++ b/scripts/conf/windows/confignode-env.bat @@ -153,9 +153,9 @@ IF "%JAVA_VERSION%" == "8" ( ) @REM Apply tsfile locale option populated by Maven at package time -@REM (see conf\windows\iotdb-locale.bat; empty in default build, -Dtsfile.locale=zh under with-zh-locale). -IF EXIST "%CONFIGNODE_CONF%\windows\iotdb-locale.bat" ( - CALL "%CONFIGNODE_CONF%\windows\iotdb-locale.bat" +@REM (see conf\windows\iotdb-common.bat; empty in default build, -Dtsfile.locale=zh under with-zh-locale). +IF EXIST "%CONFIGNODE_CONF%\windows\iotdb-common.bat" ( + CALL "%CONFIGNODE_CONF%\windows\iotdb-common.bat" IF NOT "%TSFILE_LOCALE_JVM_OPT%"=="" ( set CONFIGNODE_JMX_OPTS=%CONFIGNODE_JMX_OPTS% %TSFILE_LOCALE_JVM_OPT% ) diff --git a/scripts/conf/windows/datanode-env.bat b/scripts/conf/windows/datanode-env.bat index 9b7353af31933..ccaabf24bec0f 100644 --- a/scripts/conf/windows/datanode-env.bat +++ b/scripts/conf/windows/datanode-env.bat @@ -184,9 +184,9 @@ IF "%JAVA_VERSION%" == "8" ( ) @REM Apply tsfile locale option populated by Maven at package time -@REM (see conf\windows\iotdb-locale.bat; empty in default build, -Dtsfile.locale=zh under with-zh-locale). -IF EXIST "%IOTDB_CONF%\windows\iotdb-locale.bat" ( - CALL "%IOTDB_CONF%\windows\iotdb-locale.bat" +@REM (see conf\windows\iotdb-common.bat; empty in default build, -Dtsfile.locale=zh under with-zh-locale). +IF EXIST "%IOTDB_CONF%\windows\iotdb-common.bat" ( + CALL "%IOTDB_CONF%\windows\iotdb-common.bat" IF NOT "%TSFILE_LOCALE_JVM_OPT%"=="" ( set IOTDB_JMX_OPTS=%IOTDB_JMX_OPTS% %TSFILE_LOCALE_JVM_OPT% ) diff --git a/scripts/conf/windows/iotdb-locale.bat b/scripts/conf/windows/iotdb-common.bat similarity index 100% rename from scripts/conf/windows/iotdb-locale.bat rename to scripts/conf/windows/iotdb-common.bat From efb3be31a1619eff7c62499895ac829b9e11d35c Mon Sep 17 00:00:00 2001 From: JackieTien97 Date: Wed, 20 May 2026 12:25:07 +0800 Subject: [PATCH 4/4] Bump tsfile version to 2.3.1-260519-SNAPSHOT --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 702771f6a7925..b2591ac6730df 100644 --- a/pom.xml +++ b/pom.xml @@ -166,7 +166,7 @@ 1.5.6-3 2.3.1-260519-SNAPSHOT en - +