Skip to content

[Chore](runtime-filter) replace DCHECK/CHECK with Error Status or Exceptions#60563

Open
BiteTheDDDDt wants to merge 3 commits intoapache:masterfrom
BiteTheDDDDt:dev_0206
Open

[Chore](runtime-filter) replace DCHECK/CHECK with Error Status or Exceptions#60563
BiteTheDDDDt wants to merge 3 commits intoapache:masterfrom
BiteTheDDDDt:dev_0206

Conversation

@BiteTheDDDDt
Copy link
Contributor

What problem does this PR solve?

This pull request replaces many DCHECK assertions with explicit error handling throughout the runtime filter codebase. The changes improve robustness by converting failed internal assumptions into meaningful error statuses or exceptions, which helps prevent silent failures and makes debugging easier.

Error handling improvements for runtime filter logic:

  • Replaced DCHECK assertions with status checks and error returns for null pointers, invalid states, and filter type mismatches in runtime_filter.cpp, runtime_filter.h, runtime_filter_consumer.cpp, runtime_filter_mgr.cpp, and runtime_filter_producer.cpp. This includes checks for serialization data, filter dependencies, and filter merge conditions. [1] [2] [3] [4] [5] [6] [7] [8] [9] [10] [11] [12]

Error handling for producer and helper classes:

  • Added error returns for invalid result column IDs and broadcast join conditions in runtime_filter_producer_helper.cpp and runtime_filter_producer_helper_cross.h. Checks ensure correct filter construction and insertion logic. [1] [2] [3] [4]

Error handling for filter merging and assignment:

  • Replaced assertions with error returns for filter state and type mismatches in runtime_filter_wrapper.cpp during merging. Added exceptions for failed string parsing in filter assignment for various types. Checks for null filter functions and parsing failures in min/max filter assignment. [1] [2] [3] [4] [5] [6] [7]

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:
      • This is a refactor/code format and no logic has been changed.
      • Previous test can cover this change.
      • No code files have been changed.
      • Other reason
  • Behavior changed:

    • No.
    • Yes.
  • Does this need documentation?

    • No.
    • Yes.

Check List (For Reviewer who merge this PR)

  • Confirm the release note
  • Confirm test cases
  • Confirm document
  • Add branch pick label

Copilot AI review requested due to automatic review settings February 6, 2026 03:58
@hello-stephen
Copy link
Contributor

Thank you for your contribution to Apache Doris.
Don't know what should be done next? See How to process your PR.

Please clearly describe your PR:

  1. What problem was fixed (it's best to include specific error reporting information). How it was fixed.
  2. Which behaviors were modified. What was the previous behavior, what is it now, why was it modified, and what possible impacts might there be.
  3. What features were added. Why was this function added?
  4. Which code was refactored and why was this part of the code refactored?
  5. Which functions were optimized and what is the difference before and after the optimization?

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request improves robustness in the runtime filter subsystem by replacing internal assertion checks (DCHECK/CHECK) with explicit error handling. The changes convert potential silent failures into actionable error statuses or exceptions, making debugging easier and improving production stability.

Changes:

  • Replaced DCHECK assertions with Status::InternalError returns in functions that return Status
  • Replaced DCHECK assertions with throw Exception in constructors, void functions, and lambdas where Status cannot be returned
  • Added comprehensive error messages with contextual information (filter IDs, states, debug strings) for all converted checks

Reviewed changes

Copilot reviewed 8 out of 8 changed files in this pull request and generated no comments.

Show a summary per file
File Description
runtime_filter_wrapper.cpp Added error handling for filter merging state checks, type mismatches, string parsing failures, and missing filter data in assignment operations
runtime_filter_producer_helper_cross.h Added error handling for invalid result column IDs in cross join filter processing
runtime_filter_producer_helper.cpp Added error handling for invalid result column IDs, broadcast join validation checks, and null profile pointer handling
runtime_filter_producer.cpp Added error handling for broadcast join expectations, null dependency checks in latch/send/sync operations
runtime_filter_mgr.cpp Added error handling for null merger checks and empty target info validation
runtime_filter_consumer.cpp Added error handling for null-aware filter type mismatches and null profile pointer handling
runtime_filter.h Added error handling for conflicting remote/local target flags in constructor and null data pointer checks
runtime_filter.cpp Added error handling for null data pointer after serialization

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@BiteTheDDDDt
Copy link
Contributor Author

run buildall

@BiteTheDDDDt
Copy link
Contributor Author

run buildall

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 20.57% (36/175) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.27% (26489/36155)
Line Coverage 56.37% (281245/498909)
Region Coverage 54.04% (235172/435168)
Branch Coverage 55.68% (101232/181800)

@hello-stephen
Copy link
Contributor

BE Regression && UT Coverage Report

Increment line coverage 20.57% (36/175) 🎉

Increment coverage report
Complete coverage report

Category Coverage
Function Coverage 73.30% (26500/36155)
Line Coverage 56.40% (281406/498909)
Region Coverage 54.06% (235273/435168)
Branch Coverage 55.72% (101290/181800)

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.

2 participants