This is an automated email from the ASF dual-hosted git repository.

yiguolei pushed a commit to branch branch-4.1
in repository https://gitbox.apache.org/repos/asf/doris.git


The following commit(s) were added to refs/heads/branch-4.1 by this push:
     new 052eb8ded8c branch-4.1: [test](regression) Stabilize search score 
cache test #65894 (#68252)
052eb8ded8c is described below

commit 052eb8ded8c1f023b04acb6943af865c595bd9a4
Author: Jack <[email protected]>
AuthorDate: Sun Sep 20 19:49:48 2026 +0800

    branch-4.1: [test](regression) Stabilize search score cache test #65894 
(#68252)
    
    ### What problem does this PR solve?
    
    Issue Number: N/A
    
    Related PR: #65894
    
    Problem Summary:
    
    Backport of apache/doris#65894 to `branch-4.1`. Test-only change.
    
    `search/test_search_score_cache` fails intermittently when the
    regression cluster runs with fuzzy session variables.
    `SessionVariable.initFuzzyModeVariables()` randomizes the VARIANT
    defaults used at CREATE TABLE time: doc mode is enabled with 50%
    probability, and `default_variant_doc_materialization_min_rows` is then
    set to `nextInt(20)` with 50% probability. The suite inserts only 8
    rows, so whenever the threshold lands in 9..19 the `host` path is kept
    only in the doc-value column, is not materialized as a subcolumn and
    gets no inverted index. `CAST(v["host"] AS STRING) MATCH_PHRASE ...`
    then falls back to the non-index match path, no BM25 scorer runs,
    `score()` is filled with 0 and the `score() > 0` assertion fails at
    `test_search_score_cache.groovy:24 / :36 / :189`.
    
    The backport pins the three VARIANT session variables before CREATE
    TABLE so `v.host` is always materialized as an indexed subcolumn. It is
    unrelated to the inverted index query cache.
    
    Source PR: https://github.com/apache/doris/pull/65894
    
    Source commit: `1197ae1fa9800b7026317e3bd2fd2f26b527053b` (squash merge,
    single parent), picked with `git cherry-pick -x`, no conflict, original
    author preserved.
    
    No revert or follow-up fix of #65894 exists on master. #66858 later
    touched the same suite, but it is the "Variant V2 by default" feature,
    not a fix of this change, and is not part of this backport.
    
    ### Backport hunk audit
    
    | # | Source file and hunk | Result | Target evidence |
    | --- | --- | --- | --- |
    | 1 | `regression-test/suites/search/test_search_score_cache.groovy @@
    -43,6 +43,11 @@ suite("test_search_score_cache", "p0") {` | Ported
    (verbatim) | Target context lines 43-46 are identical to the source; the
    resulting hunk is byte-for-byte equal to the source diff. All three
    session variables exist in `SessionVariable.java` on `branch-4.1`. |
    
    ### Verification
    
    Format, compile and unit tests do not apply: the only changed file is a
    Groovy regression suite. Because the source PR changes a regression
    suite, the suite was actually run on the target branch.
    
    Cluster: single FE + single BE, shared-nothing, fuzzy session variables
    off, binaries `doris-4.1.4-rc04` (built from branch-4.1 on 2026-09-16;
    the change is test-only, so no rebuild is needed). Command:
    `./run-regression-test.sh --run --conf <conf> -d search -s
    test_search_score_cache`.
    
    | Step | Setup | Result |
    | --- | --- | --- |
    | RED | Unpatched suite from `origin/branch-4.1`; `set global
    default_variant_enable_doc_mode=true`,
    `default_variant_max_subcolumns_count=0`,
    `default_variant_doc_materialization_min_rows=10` | `Test 1 suites,
    failed 1 suites`; stack `test_search_score_cache.groovy:24` -> `:36` ->
    `:189`. The table is created with `variant_enable_doc_mode=true`,
    `variant_doc_materialization_min_rows=10`; the score query returns ids 4
    and 2 with `score() = 0`; BE logs `collection_statistics.cpp:63] Index
    statistics collection failed: [E-6003] ... No index with id ...`. |
    | GREEN | This PR's suite, same forced globals | `Test 1 suites, failed
    0 suites` |
    | GREEN | This PR's suite, default globals | `Test 1 suites, failed 0
    suites` |
    
    ### Release note
    
    None
    
    ### Check List (For Author)
    
    - Test
        - [x] 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:
        - [x] No.
        - [ ] Yes.
    
    - Does this need documentation?
        - [x] No.
        - [ ] Yes.
    
    ### Check List (For Reviewer who merge this PR)
    
    - [ ] Confirm the release note
    - [ ] Confirm test cases
    - [ ] Confirm document
    - [ ] Add branch pick label
    
    Co-authored-by: liangj777 
<[email protected]>
---
 regression-test/suites/search/test_search_score_cache.groovy | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/regression-test/suites/search/test_search_score_cache.groovy 
b/regression-test/suites/search/test_search_score_cache.groovy
index caa3259195d..5c393980a5e 100644
--- a/regression-test/suites/search/test_search_score_cache.groovy
+++ b/regression-test/suites/search/test_search_score_cache.groovy
@@ -43,6 +43,11 @@ suite("test_search_score_cache", "p0") {
         """)
     }
 
+    // Keep v.host materialized as an indexed scalar subcolumn so score() can 
collect BM25.
+    sql """ set default_variant_enable_doc_mode = false """
+    sql """ set default_variant_max_subcolumns_count = 0 """
+    sql """ set default_variant_doc_materialization_min_rows = 0 """
+
     sql "DROP TABLE IF EXISTS ${tableName}"
     sql """
         CREATE TABLE ${tableName} (


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

Reply via email to