[improvement](topn) check multiget result rows against request row id count and add be UT#61758
Conversation
… count and add be UT Also add comments.
|
Thank you for your contribution to Apache Doris. Please clearly describe your PR:
|
|
run buildall |
|
/review |
|
run buildall |
There was a problem hiding this comment.
Code Review Summary
This PR adds a row count validation check in merge_multi_response() to catch mismatches between requested row IDs and returned rows, adds a LOG(INFO) for observability when id_file_map is null, adds extensive comments throughout the materialization operator code, and includes good unit test coverage. The const-correctness and pointer type improvements (auto → auto*, auto& → const auto&) are welcome cleanups.
Critical Checkpoint Conclusions
- Goal & correctness: The PR achieves its goal of validating multiget response row counts against request row ID counts. The validation is placed at the right point (after deserialization, before use). Tests prove the error path works.
- Modification focus: The PR is reasonably focused — validation check + comments + tests + const-correctness cleanups. Acceptable scope.
- Concurrency: No concurrency changes.
merge_multi_response()is called aftercounter.wait()serializes all RPCs. No new thread safety concerns. - Lifecycle management: No lifecycle changes.
- Configuration items: None added.
- Incompatible changes: None — this is purely a client-side validation, no protocol changes.
- Parallel code paths: The old
RowIDFetcherpath (non-V2) is not modified, but it appears to be a separate code path. No issue. - Special conditional checks: Two comments have minor inaccuracies (see inline comments below).
- Test coverage: Good — 3 new test cases covering the happy path fix, the error detection case, and the stale-block_maps regression case. Tests are well-commented.
- Observability: The
LOG(INFO)addition forid_file_mapnull is appropriate for this error scenario. - Performance: No performance concerns. The validation is O(1) per backend per relation.
- Other issues: Two stale/misleading comments identified (see inline).
Issues Found
-
[Minor] Stale comment in
materialization_opertor.cpp: The comment says empty blocks can occur "if the id_file_map was GC'd", but the new row count validation now catches that case earlier, so this comment describes unreachable behavior. -
[Minor] Misleading test comment in
TestMergeMultiResponseBackendNotFound: The top-level comment says the test expectsInternalError("backend_id {} not found in block_maps"), but the actual assertion checks for"not match request row id count"— the new error message, not the old one.
|
run buildall |
|
run buildall |
TPC-H: Total hot run time: 26435 ms |
TPC-DS: Total hot run time: 170318 ms |
|
PR approved by at least one committer and no changes requested. |
|
PR approved by anyone and no changes requested. |
BE UT Coverage ReportIncrement line coverage Increment coverage report
|
BE Regression && UT Coverage ReportIncrement line coverage Increment coverage report
|
|
skip buildall |
… count and add be UT (#61758) Check multiget result rows matches request row id count when doing merge_multi_response: 1. A BE may return an empty block event if request.request_block_descs(i).row_id_size() != 0: If the id_file_map was GC'd on the BE before it could process the request, refer 'if (!id_file_map)' in RowIdStorageReader::read_by_rowids. 2. Report error in any case where the row count doesn't match, even if it's not empty, since that indicates a bug in BE's row fetching logic or serialization logic. Also add comments. ### What problem does this PR solve? Issue Number: close #xxx Related PR: #xxx Problem Summary: ### Release note None ### Check List (For Author) - Test <!-- At least one of them must be included. --> - [ ] 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 <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> ### Check List (For Reviewer who merge this PR) - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
… count and add be UT (apache#61758) Check multiget result rows matches request row id count when doing merge_multi_response: 1. A BE may return an empty block event if request.request_block_descs(i).row_id_size() != 0: If the id_file_map was GC'd on the BE before it could process the request, refer 'if (!id_file_map)' in RowIdStorageReader::read_by_rowids. 2. Report error in any case where the row count doesn't match, even if it's not empty, since that indicates a bug in BE's row fetching logic or serialization logic. Also add comments. Issue Number: close #xxx Related PR: #xxx Problem Summary: None - Test <!-- At least one of them must be included. --> - [ ] 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 <!-- Add your reason? --> - Behavior changed: - [ ] No. - [ ] Yes. <!-- Explain the behavior change --> - Does this need documentation? - [ ] No. - [ ] Yes. <!-- Add document PR link here. eg: apache/doris-website#1214 --> - [ ] Confirm the release note - [ ] Confirm test cases - [ ] Confirm document - [ ] Add branch pick label <!-- Add branch pick label that this PR should merge into -->
Check multiget result rows matches request row id count when doing merge_multi_response:
If the id_file_map was GC'd on the BE before it could process the request, refer 'if (!id_file_map)' in RowIdStorageReader::read_by_rowids.
since that indicates a bug in BE's row fetching logic or serialization logic.
Also add comments.
What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
Release note
None
Check List (For Author)
Test
Behavior changed:
Does this need documentation?
Check List (For Reviewer who merge this PR)