Skip to content

Commit b439db6

Browse files
committed
Merge remote-tracking branch 'origin/master' into fix-log-throttling
# Conflicts: # iotdb-core/confignode/src/main/java/org/apache/iotdb/confignode/manager/subscription/SubscriptionMetaSyncer.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/protocol/thrift/impl/DataNodeInternalRPCServiceImpl.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/service/metrics/IoTDBInternalLocalReporter.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/tsfile/generator/TsFileNameGenerator.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/WALManager.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/dataregion/wal/allocation/AbstractNodeAllocationStrategy.java # iotdb-core/datanode/src/main/java/org/apache/iotdb/db/storageengine/load/active/ActiveLoadDirScanner.java # iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/disk/FolderManager.java # iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/disk/strategy/MinFolderOccupiedSpaceFirstStrategy.java # iotdb-core/node-commons/src/main/java/org/apache/iotdb/commons/utils/JVMCommonUtils.java # iotdb-core/node-commons/src/test/java/org/apache/iotdb/commons/utils/JVMCommonUtilsTest.java
2 parents 903f2ff + 797319b commit b439db6

1,786 files changed

Lines changed: 55287 additions & 10631 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

.github/scripts/package-client-cpp-manylinux228.sh

100755100644
File mode changed.
Lines changed: 74 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,74 @@
1+
# This workflow verifies that the project compiles with the Chinese (zh) locale.
2+
#
3+
# IoTDB uses compile-time i18n (build-helper-maven-plugin): each participating module has
4+
# twin EN/ZH Messages classes under src/main/i18n/{en,zh}/, swapped via the i18n.locale
5+
# property. The default CI builds compile the EN locale only. This job activates the
6+
# `with-zh-locale` profile (i18n.locale=zh) so the ZH source roots are compiled across
7+
# the whole reactor, catching:
8+
# - constants present in EN but missing in ZH (key-parity regressions),
9+
# - constants present in ZH but not referenced / removed from EN,
10+
# - format-specifier or type errors in the ZH Message classes,
11+
# - source files that reference a constant only defined under the EN root.
12+
13+
name: ZH-Locale-Compile
14+
15+
on:
16+
push:
17+
branches:
18+
- master
19+
- "rel/*"
20+
- "rc/*"
21+
paths-ignore:
22+
- "docs/**"
23+
- "site/**"
24+
- "iotdb-client/client-cpp/**"
25+
- ".github/workflows/client-cpp-package.yml"
26+
- ".github/scripts/package-client-cpp-*.sh"
27+
- ".github/workflows/multi-language-client.yml"
28+
pull_request:
29+
branches:
30+
- master
31+
- "rel/*"
32+
- "rc/*"
33+
- "force_ci/**"
34+
paths-ignore:
35+
- "docs/**"
36+
- "site/**"
37+
- "iotdb-client/client-cpp/**"
38+
- ".github/workflows/client-cpp-package.yml"
39+
- ".github/scripts/package-client-cpp-*.sh"
40+
- ".github/workflows/multi-language-client.yml"
41+
# allow manually run the action:
42+
workflow_dispatch:
43+
44+
concurrency:
45+
group: ${{ github.workflow }}-${{ github.ref }}
46+
cancel-in-progress: true
47+
48+
env:
49+
MAVEN_OPTS: -Xms2g -Xmx4g -Dhttp.keepAlive=false -Dmaven.wagon.http.pool=false -Dmaven.wagon.http.retryHandler.class=standard -Dmaven.wagon.http.retryHandler.count=3
50+
MAVEN_ARGS: --batch-mode --no-transfer-progress
51+
DEVELOCITY_ACCESS_KEY: ${{ secrets.DEVELOCITY_ACCESS_KEY }}
52+
53+
jobs:
54+
zh-locale-compile:
55+
runs-on: ubuntu-latest
56+
57+
steps:
58+
- uses: actions/checkout@v5
59+
- name: Set up JDK 17
60+
uses: actions/setup-java@v5
61+
with:
62+
distribution: corretto
63+
java-version: 17
64+
env:
65+
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
66+
- name: Cache Maven packages
67+
uses: actions/cache@v5
68+
with:
69+
path: ~/.m2
70+
key: ${{ runner.os }}-m2-${{ hashFiles('**/pom.xml') }}
71+
restore-keys: ${{ runner.os }}-m2-
72+
- name: Compile with ZH locale
73+
shell: bash
74+
run: mvn clean test-compile -P with-zh-locale -DskipTests

CLAUDE.md

Lines changed: 11 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ This file provides guidance to Claude Code (claude.ai/code) when working with co
2525

2626
## Project Overview
2727

28-
Apache IoTDB is a time series database for IoT data. It uses a distributed architecture with ConfigNodes (metadata/coordination) and DataNodes (storage/query). Data is stored in TsFile columnar format (separate repo: https://github.com/apache/tsfile). Current version is 2.0.7-SNAPSHOT.
28+
Apache IoTDB is a time series database for IoT data. It uses a distributed architecture with ConfigNodes (metadata/coordination) and DataNodes (storage/query). Data is stored in TsFile columnar format (separate repo: https://github.com/apache/tsfile). Current version is 2.0.11-SNAPSHOT.
2929

3030
## Build Commands
3131

@@ -172,11 +172,21 @@ Generated source directories that need to be on the source path:
172172

173173
- **Missing Thrift compiler**: The local machine may not have the `thrift` binary installed. Running `mvn clean package -pl <module> -am -DskipTests` will fail at the `iotdb-thrift` module. **Workaround**: To verify your changes compile, use `mvn compile -pl <module>` (without `-am` or `clean`) to leverage existing target caches.
174174
- **Pre-existing compilation errors in unrelated modules**: The datanode module may have pre-existing compile errors in other subsystems (e.g., pipe, copyto) that cause `mvn clean test -pl iotdb-core/datanode -Dtest=XxxTest` to fail during compilation. **Workaround**: First run `mvn compile -pl iotdb-core/datanode` to confirm your changed files compile successfully. If the errors are in files you did not modify, they are pre-existing and do not affect your changes.
175+
- **Single-module / no-`clean` compiles hide cross-module and i18n errors**: `mvn compile -pl <module>` (the thrift workaround above) builds only that module against the **installed** jars in `~/.m2` and the existing `target/` classes; an incremental `mvn test-compile` without `clean` reuses stale `target/*.class`. If you add/rename a `*Messages` constant (or any cross-module API) in module B but `~/.m2`/`target/` still holds B's old artifact, module A referencing the new symbol compiles fine against the stale class — the real `cannot find symbol` only surfaces in CI or a clean build. **Workaround**: for i18n / cross-module edits, verify with a full-reactor compile (no `-pl`, no `clean`): `mvn test-compile -DskipTests` and `mvn test-compile -DskipTests -P with-zh-locale`. Capture the maven exit code directly (`mvn ... ; echo $?`), not via `mvn ... && echo OK``set -e` does NOT fail on a command inside a `&&` list, so a `&&` chain can print a false success.
175176

176177
### i18n (Chinese Messages)
177178

178179
The project uses compile-time i18n via the `build-helper-maven-plugin`. The property `i18n.locale` (default: `en`) controls which source directory is added: `src/main/i18n/${i18n.locale}`. Activating `-P with-zh-locale` sets `i18n.locale=zh`, swapping English message constant classes for Chinese ones. Each module that participates has both `src/main/i18n/en/` and `src/main/i18n/zh/` directories containing Java classes with identical structure but different string literals.
179180

181+
**Rule — never inline a user-facing English string literal.** Every string a user, operator, or log reader will see MUST be a `public static final String` constant in the module's `*Messages` class (e.g. `DataNodeQueryMessages`), referenced as `MessagesClass.CONSTANT` — never a `"raw literal"`. This applies to: `LOGGER/log.info|warn|error|debug|trace(...)`, `throw new …Exception(…)`, `super(…)` in exception constructors, `resp.setMessage(…)`, the message arg of `requireNonNull/checkArgument/checkState/checkNotNull`, and the template of `String.format(…)`. A raw literal is invisible to the zh build and renders English under `-P with-zh-locale` — that is the bug this rule prevents. (`toString()` debug output is exempt.) Reviewers and AI agents must reject/fix any new code that introduces such a literal.
182+
183+
**Naming a new constant** (deterministic, matches existing files): `<PREFIX>_<NORMALIZED>_<HASH>` where `PREFIX` is `LOG_` for `LOGGER`/log calls, `MESSAGE_` for `setMessage(...)`, and `EXCEPTION_` for `throw new …(…)`, `super(…)`, and the message arg of `requireNonNull/checkArgument/checkState/checkNotNull` (the three prefixes the codebase already uses — ~`LOG_`/`MESSAGE_`/`EXCEPTION_`); `NORMALIZED` is the English value uppercased with non-alphanumeric runs collapsed to `_` and `%s`/`%d`/`{}` replaced by `ARG`; `HASH` is the first 8 hex chars of `md5(englishValue)`, uppercased — compute with `python3 -c "import hashlib;print(hashlib.md5(b'the english').hexdigest()[:8].upper())"`. Add the constant to **both** the `en` and `zh` files under the **same name** (zh gets a natural Chinese translation; preserve every `%s`/`%d`/`{}` exactly; keep config keys, SQL keywords, class/method names, and product terms like TsFile/DataRegion/Consensus/ConfigNode in English inside the Chinese string). Reuse an existing same-named constant instead of duplicating. **Pure-punctuation fragments** (`. `, `, `, `: `, `.`, etc.) are **exempt** — inline them, do not create a constant (punctuation does not localize, and a hashed `. ` constant hurts readability). A single message that is built from several pieces should be ONE constant holding the full template, not several fragments concatenated at the call site.
184+
185+
**Verify before commit**:
186+
- `mvn spotless:apply -pl <module>` (the PostToolUse formatter does not add the i18n import; spotless does).
187+
- Compile **both** locales: `mvn test-compile -DskipTests` AND `mvn test-compile -P with-zh-locale -DskipTests` (the `.github/workflows/zh-locale-compile.yml` CI enforces the zh build).
188+
- The `en` and `zh` files must stay in key parity (same constant names) with identical format-specifier counts; a raw-literal scan of main java must return nothing.
189+
180190
### Code Style
181191

182192
- **Always run `mvn spotless:apply` after editing Java files**: Spotless runs `spotless:check` automatically during the `compile` phase. Format violations cause an immediate BUILD FAILURE. Make it a habit to run `mvn spotless:apply -pl <module>` right after editing, not at the end. For files under `integration-test/`, add `-P with-integration-tests`.

code-coverage/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.iotdb</groupId>
2626
<artifactId>iotdb-parent</artifactId>
27-
<version>2.0.7-SNAPSHOT</version>
27+
<version>2.0.11-SNAPSHOT</version>
2828
</parent>
2929
<artifactId>iotdb-code-coverage</artifactId>
3030
<packaging>pom</packaging>

distribution/pom.xml

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.iotdb</groupId>
2626
<artifactId>iotdb-parent</artifactId>
27-
<version>2.0.7-SNAPSHOT</version>
27+
<version>2.0.11-SNAPSHOT</version>
2828
</parent>
2929
<artifactId>iotdb-distribution</artifactId>
3030
<packaging>pom</packaging>
@@ -36,36 +36,36 @@
3636
<dependency>
3737
<groupId>org.apache.iotdb</groupId>
3838
<artifactId>iotdb-server</artifactId>
39-
<version>2.0.7-SNAPSHOT</version>
39+
<version>2.0.11-SNAPSHOT</version>
4040
<type>zip</type>
4141
</dependency>
4242
<dependency>
4343
<groupId>org.apache.iotdb</groupId>
4444
<artifactId>iotdb-cli</artifactId>
45-
<version>2.0.7-SNAPSHOT</version>
45+
<version>2.0.11-SNAPSHOT</version>
4646
<type>zip</type>
4747
</dependency>
4848
<dependency>
4949
<groupId>org.apache.iotdb</groupId>
5050
<artifactId>iotdb-confignode</artifactId>
51-
<version>2.0.7-SNAPSHOT</version>
51+
<version>2.0.11-SNAPSHOT</version>
5252
<type>zip</type>
5353
</dependency>
5454
<dependency>
5555
<groupId>org.apache.iotdb</groupId>
5656
<artifactId>library-udf</artifactId>
57-
<version>2.0.7-SNAPSHOT</version>
57+
<version>2.0.11-SNAPSHOT</version>
5858
</dependency>
5959
<dependency>
6060
<groupId>org.apache.iotdb</groupId>
6161
<artifactId>mqtt</artifactId>
62-
<version>2.0.7-SNAPSHOT</version>
62+
<version>2.0.11-SNAPSHOT</version>
6363
<scope>provided</scope>
6464
</dependency>
6565
<dependency>
6666
<groupId>org.apache.iotdb</groupId>
6767
<artifactId>rest</artifactId>
68-
<version>2.0.7-SNAPSHOT</version>
68+
<version>2.0.11-SNAPSHOT</version>
6969
<scope>provided</scope>
7070
</dependency>
7171
</dependencies>
@@ -251,7 +251,7 @@
251251
<dependency>
252252
<groupId>org.apache.iotdb</groupId>
253253
<artifactId>iotdb-ainode</artifactId>
254-
<version>2.0.7-SNAPSHOT</version>
254+
<version>2.0.11-SNAPSHOT</version>
255255
</dependency>
256256
</dependencies>
257257
<build>

docker/ReadMe.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -108,7 +108,7 @@ docker run -d \
108108
-e AIN_CLUSTER_INGRESS_PORT=6667 \
109109
-e AIN_CLUSTER_INGRESS_USERNAME=root \
110110
-e AIN_CLUSTER_INGRESS_PASSWORD=root \
111-
apache/iotdb:2.0.7-SNAPSHOT-ainode
111+
apache/iotdb:2.0.11-SNAPSHOT-ainode
112112
```
113113

114114
## Quick start

example/jdbc/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.iotdb</groupId>
2626
<artifactId>iotdb-examples</artifactId>
27-
<version>2.0.7-SNAPSHOT</version>
27+
<version>2.0.11-SNAPSHOT</version>
2828
</parent>
2929
<artifactId>jdbc-example</artifactId>
3030
<name>IoTDB: Example: JDBC</name>

example/mqtt-customize/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.iotdb</groupId>
2626
<artifactId>iotdb-examples</artifactId>
27-
<version>2.0.7-SNAPSHOT</version>
27+
<version>2.0.11-SNAPSHOT</version>
2828
</parent>
2929
<artifactId>customize-mqtt-example</artifactId>
3030
<name>IoTDB: Example: Customized MQTT</name>

example/mqtt/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.iotdb</groupId>
2626
<artifactId>iotdb-examples</artifactId>
27-
<version>2.0.7-SNAPSHOT</version>
27+
<version>2.0.11-SNAPSHOT</version>
2828
</parent>
2929
<artifactId>mqtt-example</artifactId>
3030
<name>IoTDB: Example: MQTT</name>

example/pipe-count-point-processor/pom.xml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@
2424
<parent>
2525
<groupId>org.apache.iotdb</groupId>
2626
<artifactId>iotdb-examples</artifactId>
27-
<version>2.0.7-SNAPSHOT</version>
27+
<version>2.0.11-SNAPSHOT</version>
2828
</parent>
2929
<artifactId>pipe-count-point-processor-example</artifactId>
3030
<name>IoTDB: Example: Pipe: Count Point Processor</name>

0 commit comments

Comments
 (0)