Skip to content

[To dev/1.3] Fix retry bug in tree model query which ignores the time filter#18201

Merged
JackieTien97 merged 4 commits into
dev/1.3from
codex/backport-pr-18179-dev-1.3
Jul 15, 2026
Merged

[To dev/1.3] Fix retry bug in tree model query which ignores the time filter#18201
JackieTien97 merged 4 commits into
dev/1.3from
codex/backport-pr-18179-dev-1.3

Conversation

@JackieTien97

Copy link
Copy Markdown
Contributor

Summary

Backport #18179 to dev/1.3.

  • preserve parser-owned tree query state across analysis retries
  • restore time predicates and other normalized query components before retrying
  • add regression coverage for predicate extraction, templated analysis, logical planning, and query execution retry lifecycle
  • adapt the changes to the dev/1.3 APIs and code structure

Root cause

Tree-model query analysis mutates the parsed statement while extracting time predicates and normalizing query components. When dispatch fails and the same statement is analyzed again, the retry can observe the mutated state and lose the original time filter.

Backport notes

The master PR also contains table-model changes. Those classes do not exist on the dev/1.3 codebase, so this backport intentionally includes only the applicable tree-model changes.

Validation

  • mvn -pl iotdb-core/datanode -am -DskipTests package
  • PredicateUtilsTest: 8 tests passed
  • TemplatedAnalyzeRetryTest: 2 tests passed
  • QueryExecutionRetryTest: 2 tests passed
  • LogicalPlanBuilderTest: 2 tests passed

@sonarqubecloud

Copy link
Copy Markdown

@codecov

codecov Bot commented Jul 14, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 74.24242% with 85 lines in your changes missing coverage. Please review.
✅ Project coverage is 43.64%. Comparing base (f0e8ba2) to head (d0a0733).
⚠️ Report is 2 commits behind head on dev/1.3.

Files with missing lines Patch % Lines
...gine/plan/analyze/TreeAnalysisMutationJournal.java 72.47% 30 Missing ⚠️
.../db/queryengine/plan/execution/QueryExecution.java 63.33% 11 Missing ⚠️
...gine/plan/analyze/TemplatedAggregationAnalyze.java 64.00% 9 Missing ⚠️
...ression/visitor/predicate/PredicateSimplifier.java 70.96% 9 Missing ⚠️
...db/db/queryengine/plan/analyze/PredicateUtils.java 85.45% 8 Missing ⚠️
.../db/queryengine/plan/planner/TreeModelPlanner.java 0.00% 8 Missing ⚠️
...b/queryengine/plan/analyze/ConcatPathRewriter.java 50.00% 3 Missing ⚠️
...he/iotdb/db/queryengine/plan/planner/IPlanner.java 0.00% 3 Missing ⚠️
.../db/queryengine/plan/analyze/TemplatedAnalyze.java 0.00% 2 Missing ⚠️
...ine/plan/statement/component/GroupByComponent.java 0.00% 2 Missing ⚠️
Additional details and impacted files
@@              Coverage Diff              @@
##             dev/1.3   #18201      +/-   ##
=============================================
+ Coverage      43.53%   43.64%   +0.11%     
  Complexity       198      198              
=============================================
  Files           3631     3633       +2     
  Lines         243791   243987     +196     
  Branches       29753    29780      +27     
=============================================
+ Hits          106134   106491     +357     
+ Misses        137657   137496     -161     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@JackieTien97
JackieTien97 marked this pull request as ready for review July 15, 2026 02:40
@JackieTien97
JackieTien97 merged commit 21c9f9d into dev/1.3 Jul 15, 2026
19 checks passed
@JackieTien97
JackieTien97 deleted the codex/backport-pr-18179-dev-1.3 branch July 15, 2026 02:41
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant