airborne12 opened a new pull request, #71161:
URL: https://github.com/apache/doris/pull/71161

   ### Background
   
   A VARIANT values index (`variant_index_scope=values`) is written only in 
SNII segments. A V2 or V3 segment gets no values index, so when that is a 
table's only inverted index, the segment's `.idx` container is empty. 
`VariantValuesSegmentTestWithFormat.ValuesIndexExistsOnlyInSniiSegments` checks 
this layout for each storage format, with and without a sibling text index, and 
runs in the BE UT pipeline. Since #70788, `IndexFileReader::init` reports an 
empty V2/V3 container as `INVERTED_INDEX_FILE_NOT_FOUND` ("... is empty"), so 
every reader applies the missing-index policy to it, as it does to a missing 
file.
   
   ### What problem does this PR solve?
   
   Issue Number: None
   Related PR: #69761 (added the test), #70788 (changed the empty-container 
status the test asserts)
   PR Type: Test
   
   Problem Summary:
   
   
`StorageFormats/VariantValuesSegmentTestWithFormat.ValuesIndexExistsOnlyInSniiSegments/0`
 and `/2` (V2 and V3 without a sibling index) fail on master in every BE UT 
run. The test still expects `INVERTED_INDEX_BYPASS` from the empty container, 
but #70788, merged before #69761, changed that status to 
`INVERTED_INDEX_FILE_NOT_FOUND`. This PR updates the expectation to the current 
contract, as #70788 did in `EmptyIndexFileTest`, and also checks the `is empty` 
message so that the case still asserts an empty container rather than a missing 
file. No production code changes.
   
   ### Details
   
   - **Failure:** `variant_values_index_test.cpp:262: Value of: 
init_status.is<ErrorCode::INVERTED_INDEX_BYPASS>() Actual: false`, with 
`[E-6003]inverted index file .../1000_0.idx is empty.`, on every run: `/0` (V2) 
and `/2` (V3) fail, the other four cases pass. Seen in the BE UT builds of 
other master PRs (13995 for #71105 on 2026-11-29, 15108 for #71082) and of 
#71134 (15873, 16398, 16463), and reproduced locally on master dc5517d7afb. The 
older BE UT pipeline still reported some of those builds as passed; the sharded 
BE UT pipeline fails them.
   - **Cause:** a change made in another PR. #70788 made 
`IndexFileReader::_init_from` return `INVERTED_INDEX_FILE_NOT_FOUND` instead of 
`INVERTED_INDEX_BYPASS` for an empty V2/V3 container and updated the tests that 
existed then; #69761 merged afterwards with this test still expecting the old 
status. Only the test is stale: every caller of `IndexFileReader::init` on 
master accepts `INVERTED_INDEX_FILE_NOT_FOUND` for an empty container 
(`IndexBuilder`, `CollectionStatistics`, the index disk usage reader, and 
`SegmentIterator::_downgrade_without_index`), and a V2/V3 segment never opens 
the values index, since `ColumnReader::new_index_iterator` returns no iterator 
for it, which the test also asserts.
   - **Stability evidence:** the failure is deterministic. On master the two 
cases fail on every run (5 CI builds and the local run); with this change, the 
suite passed 20 consecutive local runs (`GTEST_REPEAT=20`).
   
   ### Testing
   
   - `GLIBC_COMPATIBILITY=OFF ./run-be-ut.sh --run 
--filter='StorageFormats/VariantValuesSegmentTestWithFormat.*'` on master 
dc5517d7afb (ASAN UT build, local): `/0` and `/2` fail at 
`variant_values_index_test.cpp:262` with the E-6003 `is empty` status, 4 pass.
   - The same build with this change, filter 
`StorageFormats/VariantValuesSegmentTestWithFormat.*:VariantValuesSegmentTest.*:*EmptyIndexFileTest*`:
 26 tests from 4 suites pass.
   - `GTEST_REPEAT=20` on 
`StorageFormats/VariantValuesSegmentTestWithFormat.*`: 20 of 20 iterations pass 
all 6 cases.
   - clang-format 16 reports no change for the file, and clang-tidy (ldb 
toolchain, `-p be/ut_build_ASAN`) reports no warning in it.
   
   ### Release note
   
   None
   
   ### Check List (For Author)
   
   - Behavior changed: No
   - Does this need documentation: No
   - Pre-submission status: Ready
   
   ### AI Disclosure
   
   - Tool: Claude Code (Claude Opus 5.5)
   - Generated: test, this description
   - Human review: pending author review
   
   
   🤖 Generated with [Claude Code](https://claude.com/claude-code)
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to