airborne12 commented on PR #62301:
URL: https://github.com/apache/doris/pull/62301#issuecomment-4219164804
run buildall
The previous CI run flagged 4 "new" failures in
`Doris_DorisRegression_P0Regression` and `Doris_DorisRegression_CloudP0`, all
in search tests that exercise compound `NOT`/`AND` on top of `search()`:
- `search/test_search_null_regression` (line 115)
- `search/test_search_dsl_syntax` (line 305)
- `search/test_search_vs_match_consistency` (line 200)
- `search/test_search_not_null_bitmap` (line 79)
Root cause: the previous commit included a `std::move(result_bitmap)`
micro-optimization in `VSearchExpr::evaluate_inverted_index`. At that point the
DSL result cache (`InvertedIndexQueryCache`) already holds a `shared_ptr` to
the same underlying `roaring::Roaring` as `result_bitmap._data_bitmap`. Moving
(instead of lvalue-copying) into `set_index_result_for_expr` makes the
per-segment expr-context map entry alias the cached Roaring, and
`VCompoundPred::COMPOUND_NOT` then calls `InvertedIndexResultBitmap::op_not()`
— which is declared `const` but writes through the shared_ptr (`*_data_bitmap =
*universe - *_data_bitmap - *_null_bitmap`). That mutation corrupts the cached
bitmap, so the next segment that hits the cache observes the *negated* SEARCH
result.
Fixed in b53104b: revert to the lvalue form, so the value-by-copy parameter
of `set_index_result_for_expr` deep-copies the Roaring and isolates the cache
from per-segment mutations.
Verified locally: `WHERE not search('content:Round', '{"mode":"standard"}')`
returns the expected rows `{1, 2, 5, 11, 13}` and stays stable across 5
repeated invocations (previously drifted as the cache got corrupted on
segment-2+).
--
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]