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

   ## Problem
   
   `test_backup_restore_colocate_with_partition` (in 
`regression-test/suites/backup_restore/test_backup_restore_colocate.groovy`) 
flakily fails right after a `RESTORE`:
   
   ```
   Explain and check failed, expect contains 'COLOCATE', but actual explain 
string is:
     HAS_COLO_PLAN_NODE: false
     3:VHASH JOIN(331)
     |  join op: INNER JOIN(BROADCAST)[]
     TABLE: ..._db_new..._table1
   ```
   
   (reproduced deterministically in an isolated run on a 4-BE / force-3 
cluster; failure was on the restore-to-new-db case.)
   
   ## Root cause — a case timing bug, not a plan regression
   
   After `RESTORE` the restored colocate group needs a moment to become 
**stable**, and the planner only emits a `COLOCATE` join once the group is 
stable (otherwise it falls back to `BROADCAST`/shuffle). The suite ran `explain 
... contains("COLOCATE")` **immediately** after `waitAllRestoreFinish`, racing 
the stabilization. The existing `checkColocateTabletHealth` (a single-shot 
`ColocateMismatchNum == 0` assert) sat *after* the assertion, so it didn't gate 
the explain.
   
   ## Fix
   
   - Add a bounded poll `waitColocatePlan(query)` (60 × 1s) that waits for the 
explain plan to actually contain `COLOCATE`, and call it before each 
`contains("COLOCATE")` assertion.
   - Turn `checkColocateTabletHealth` into a bounded poll as well, so the 
health check waits for stabilization instead of racing it.
   - Applied symmetrically to both suites in the file; the 
`notContains("COLOCATE")` assertions are untouched.
   
   If `COLOCATE` never appears within the timeout, the assertion still fails — 
so a genuine regression would not be masked.
   
   ## Verification
   
   Run isolated on the cluster where the original case failed 
deterministically: the fixed case passes (`Test 1 suites, failed 0 suites`).


-- 
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