[fix](fe) Guard query instance metric before metric repo init - #62762
[fix](fe) Guard query instance metric before metric repo init#62762seawinde wants to merge 1 commit into
Conversation
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
FE Regression Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
1 similar comment
FE Regression Coverage ReportIncrement line coverage |
…#62766) ### What problem does this PR solve? Related PR: #62599 Problem Summary: The `partition_curd_union_rewrite` test intermittently fails in `cloud_p0` CI because `mv_rewrite_success` calls after data modifications (insert/delete) do not pass `is_partition_statistics_ready`. Without this check, the function defaults to `true` and asserts that CBO chose the MV. In cloud mode, partition statistics propagation can be slower, so CBO may not select the MV, causing the test to fail. The first two `mv_rewrite_success` calls (before any DML) already pass `is_partition_statistics_ready` correctly. This fix applies the same pattern to the remaining six calls that follow insert/delete operations. **Observed failures:** - PR #62599 — cloud_p0 ❌ - PR #62762 — cloud_p0 ❌
69c0184 to
01fd96e
Compare
|
run buildall |
TPC-H: Total hot run time: 31353 ms |
TPC-DS: Total hot run time: 169302 ms |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
…apache#62766) ### What problem does this PR solve? Related PR: apache#62599 Problem Summary: The `partition_curd_union_rewrite` test intermittently fails in `cloud_p0` CI because `mv_rewrite_success` calls after data modifications (insert/delete) do not pass `is_partition_statistics_ready`. Without this check, the function defaults to `true` and asserts that CBO chose the MV. In cloud mode, partition statistics propagation can be slower, so CBO may not select the MV, causing the test to fail. The first two `mv_rewrite_success` calls (before any DML) already pass `is_partition_statistics_ready` correctly. This fix applies the same pattern to the remaining six calls that follow insert/delete operations. **Observed failures:** - PR apache#62599 — cloud_p0 ❌ - PR apache#62762 — cloud_p0 ❌
### What problem does this PR solve? Issue Number: N/A Related PR: N/A Problem Summary: Avoid NPE when query instance metrics are updated before MetricRepo initialization completes during FE startup or role switch. ### Release note None ### Check List (For Author) - Test: Attempted `./run-fe-ut.sh --run org.apache.doris.qe.QeProcessorImplTest` and `./build.sh --fe`, but FE clean build is currently blocked by an existing upstream/master fe-core pattern-generator compilation issue unrelated to this change - Behavior changed: Yes (avoid NPE before metric initialization) - Does this need documentation: No
01fd96e to
1d461e7
Compare
|
run buildall |
|
/review |
|
Codex automated review failed and did not complete. Error: All Codex review accounts are usage-limited; earliest retry is 2026-08-20T03:35:00Z. Please trigger /review again after that time. |
|
run buildall |
TPC-H: Total hot run time: 17279 ms |
TPC-DS: Total hot run time: 82781 ms |
ClickBench: Total hot run time: 14.67 s |
FE UT Coverage ReportIncrement line coverage |
FE Regression Coverage ReportIncrement line coverage |
What problem does this PR solve?
Issue Number: N/A
Related PR: N/A
Problem Summary:
CIR-20036 reports that FE may throw a
NullPointerExceptionwhileregistering query instances during startup or role switch.
Root cause: In
QeProcessorImpl.registerInstances()(
fe/fe-core/src/main/java/org/apache/doris/qe/QeProcessorImpl.java:164),query instance accounting always updates
MetricRepo.USER_COUNTER_QUERY_INSTANCE_BEGIN, butMetricRepo.init()maynot have completed yet, so the metric mapping is still unavailable.
This PR keeps the existing query-instance accounting logic unchanged and
only skips the metric increment until the metric repo is initialized.
Change Summary:
fe/fe-core/src/main/java/org/apache/doris/qe/QeProcessorImpl.javaUSER_COUNTER_QUERY_INSTANCE_BEGINupdate withMetricRepo.isInitso FE does not dereference an uninitialized metric during startup or role switchfe/fe-core/src/test/java/org/apache/doris/qe/QeProcessorImplTest.javaregisterInstances()pathsRelease note
Fixed an issue where FE could hit a
NullPointerExceptionwhen queryinstance metrics were updated before
MetricRepoinitialization completed.Check List (For Author)
Test
Regression test
Unit Test
Manual test (add detailed scripts or steps below)
No need to test or manual test. Explain why:
Added
QeProcessorImplTest, but./run-fe-ut.sh --run org.apache.doris.qe.QeProcessorImplTestis currently blocked on upstream
masterby an unrelated FEcompilation failure in
fe-coregenerate-patterns(
PatternDescribableProcessor->ExpressionTypeMappingGeneratorNoClassDefFoundError).Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)