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

   ### What problem does this PR solve?
   
   The `nereids_syntax_p0/distribute/shuffle_left_join` regression test is 
flaky.
   
   With the nereids distribute planner enabled, the join in this suite can be
   planned either as `INNER JOIN(PARTITIONED)` or as a left-to-right
   `INNER JOIN(BUCKET_SHUFFLE)` — the aggregated left side shuffled onto the 
right
   table's storage buckets — and the two candidates are chosen by cost. That 
cost
   is not stable during the test:
   
   - the scan row count is reported asynchronously after the insert, so an
     unreported count clamps to 1 (which favors a partitioned shuffle), while 
the
     real count favors a bucket shuffle;
   - the bucket-shuffle downgrade gate (`isBucketShuffleDownGrade`) turns bucket
     shuffle back into a partitioned shuffle when the bucket count is small
     relative to the instance count, so the plan also depends on the number of
     backends.
   
   As a result the asserted plan flips between `INNER JOIN(PARTITIONED)` and
   `INNER JOIN(BUCKET_SHUFFLE)` depending on timing and cluster topology.
   
   The suite is meant to assert the left-to-right bucket shuffle, which saves 
one
   exchange versus a plain partitioned shuffle. This PR restores that assertion 
and
   makes it deterministic:
   
   - `analyze table ... with sync` fixes the row count instead of racing the 
async
     tablet report (the count is then read from the collected column stats);
   - `set bucket_shuffle_downgrade_ratio=0` removes the dependency on the 
number of
     backends.
   
   Verified on a 4-backend cluster: the suite now stably produces
   `INNER JOIN(PARTITIONED)` for the legacy-planner leg and
   `INNER JOIN(BUCKET_SHUFFLE)` for the distribute-planner leg across 
parallelism
   1/4/8 and both before/after stats reporting; the suite was run 3 times, all
   green.
   
   ### Release note
   
   None
   
   ### Check List (For Committer)
   
   - [x] Regression test
   - [ ] Unit Test
   - [ ] Manual test (add detailed scripts or steps below)
   - [x] No need to test or manual test. Reason: regression-test-only change.
   


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