Ashish Gupta
09/28/2026, 12:53 PMenable_group_execution = true. It filters the larger table, computes a count and quota per key, applies ROW_NUMBER() partitioned by that key, and joins the ranked rows to their quotas. The physical plan includes an earlier colocated join and a final BUCKET_SHUFFLE join.
3. In the same session, run SET enable_group_execution = false; and repeat the identical query. Re-enable it and repeat again.
Attachments include the redacted SQL, relevant table definitions, and three profile excerpts. String literals in the SQL were pseudonymized, so the attachment shows the query structure but cannot replay against the original data. A standalone synthetic INSERT INTO fixture is not yet available.
Expected behavior (Required)
For the captured snapshot, the ranked side contains 39,214 rows and the quota side contains 99 distinct keys. The final join should produce 1,645 rows, followed by 1,600 rows across 99 keys after LIMIT.
Real behavior (Required)
EXPLAIN ANALYZE locates the loss at HASH_JOIN (id=22) [BUCKET_SHUFFLE, INNER JOIN]. Both inputs remain complete, but the join silently loses matches:
ProfileRanked inputQuota inputJoin output`GROUP_EXCHANGE` on ranked pathBad run 139,21499215PresentBad run 239,21499139PresentCorrect run39,214991,645Absent
The earlier join, sort, and ROW_NUMBER() still output all 39,214 rows in the bad runs. Entire key groups disappear at the final join, and the query completes without an error.
Controls and workarounds
• With group execution enabled, 10 of 12 baseline runs were wrong.
• With enable_group_execution = false, 12 of 12 runs returned 1,600 rows across 99 keys. Re-enabling it brought the failure back.
• With group execution enabled and group_execution_min_scan_rows = 1, 4 of 6 runs were wrong.
• Changing only the final join to JOIN [BROADCAST] group_quotas returned the expected result in eight paired checks.
• Query cache and predicate-column late materialization were disabled.
The profiles establish where rows disappear. A driver-partition mismatch involving GROUP_EXCHANGE is a hypothesis; the precise internal cause has not been proven.
StarRocks version (Required)
SELECT current_version(); → 4.1.3-8a8e186
Related work
PR #66441 addressed an earlier group-execution/window-join wrong-result case. PR #78920 addresses related hash-join driver alignment on `main`; its 4.1 backport #78965 closed with conflicts.Rocky
09/28/2026, 12:54 PMGROUP_EXCHANGE behavior and driver-partition alignment is spot on.
Based on your findings and the current status of StarRocks 4.1.x, here is what I can confirm:
1. Known Issue Status
The behavior you are seeing—silent row loss in a BUCKET_SHUFFLE join when enable_group_execution = true and window functions (like ROW_NUMBER()) are involved—is a known edge case. Group execution optimizes for locality by grouping fragment execution, but it requires perfect alignment between drivers and data buckets.
* PR #78920 ("Fix hash join driver alignment for group execution") was indeed created to address this specific class of driver-mismatch issues.
* Backport Status: You correctly noted that the original backport PR #78965 for the 4.1 branch was closed due to conflicts. Typically, a new backport PR (often with a different number) is created to resolve these conflicts manually.
2. Version Context
You are currently on 4.1.3. Since the fix in #78920 was being backported recently, it is highly likely that 4.1.3 does not contain this fix.
StarRocks 4.1.5 was released in September 2026 and includes several group execution stability improvements (e.g., #75290, #75656, #75883). However, if the specific fix for #78920 was still in conflict during the 4.1.4/4.1.5 release cycles, it may still be pending.
3. Recommended Workarounds
Until the fix is confirmed and merged into a 4.1.x release, please continue using the workarounds you identified, as they are the standard ways to bypass this optimization bug:
* Disable Group Execution (Session level):
sql
SET enable_group_execution = false;
This is the safest way to ensure correctness across the entire query.
* Broadcast Hint:
Using JOIN [BROADCAST] on the smaller table (as you've done) forces a different execution path that avoids the bucket-shuffled driver alignment logic, preventing the row loss.
4. Next Steps
* Check the GitHub Issue: If you haven't already, please link your findings to the main PR #78920 or the issue tracking it.
* Verify in 4.1.5: If you have a test environment, try running your fixture against version 4.1.5 to see if any of the other group execution fixes inadvertently resolved your case.
* Follow the Backport: Keep an eye on the StarRocks GitHub for a new backport PR targeting branch-4.1 that references "driver alignment" or "group execution."
Given the complexity, if you are able to provide the synthetic fixture on the GitHub issue, it will greatly help the maintainers verify the fix for the 4.1 branch.
References
• using_starrocks/Colocate_join.md
• best_practices/bucketing.md
• best_practices/query_tuning/query_hint.mdAshish Gupta
09/28/2026, 1:08 PMRocky
09/28/2026, 1:09 PMGROUP_EXCHANGE handles driver-to-bucket mapping when a window function (like ROW_NUMBER()) is part of the pipeline.
However, it is likely not in 4.1.5.
* 4.1.5 was released on September 8, 2026. It primarily contains PRs in the #77xxx range (e.g., #77243, #77832).
* Since PR #78920 and its backport attempts are newer, this fix is currently slated for the 4.1.6 patch release.
2. StarRocks 4.1.5 Release
As of now, StarRocks 4.1.5 is already available (released Sept 8). It includes significant stability improvements for the 4.1 line, particularly for:
* Query Cache & Join Stability: Fixed several BE crashes when the query cache was used with partitioned hash joins (#77564).
* Optimizer Accuracy: Fixed "wrong or missing results" in ranking window functions across sort groups (#77086)—a case very similar to yours but distinct from the driver-alignment bug.
* Lakehouse Correctness: Resolved issues where Iceberg manifest caches could silently drop data files from scan planning (#76215).
3. Roadmap & Accuracy Issues
The community is aware of the "accuracy" sentiment regarding the 4.X line, which introduced massive changes to the execution engine (Group Execution, Adaptive Layout).
* Roadmap Document: There isn't a traditional PDF roadmap; the primary living document is GitHub Issue #67632: StarRocks Roadmap 2026.
* Stabilization Phase: The current focus for the 4.1.x maintenance line is "Stabilization." You can see this in the high volume of "BugFix" PRs being backported to the branch-4.1 weekly.
Recommended Action
Since your specific case (driver alignment in bucket-shuffle joins) is still pending the 4.1.6 release, the safest path is to keep the session-level workaround:
sql
-- Apply this globally or per-session until 4.1.6
SET GLOBAL enable_group_execution = false;
If you want to track the exact moment your fix is merged, follow the StarRocks 4.1 Release Notes page, looking specifically for "driver alignment" or "PR #78920" in the 4.1.6 section.
References
• Introduction/Version_naming.md
• release_notes/release-4.1.md
• GitHub Issue #67632 (Roadmap 2026)Ashish Gupta
09/28/2026, 1:13 PMRocky
09/28/2026, 1:14 PMGROUPING SETS pushdown for AVG and COUNT (#77832).
* Metadata: Fixed a critical issue where background metadata refresh for Paimon/Iceberg could be incomplete (#78057).
* Correctness: Fixed an issue where ANALYZE SAMPLE on external tables could produce incorrect distribution stats (#77243).
* Stability: Reduced lock contention for lakehouse segments, improving concurrency (#78260).
2. Is there a Roadmap?
Yes, the community tracks the high-level goals for 2026 in GitHub Issue #67632: StarRocks Roadmap 2026.
Key focus areas for the 4.x line in late 2026 include:
* Adaptive Multi-Tenant Layout: This is the flagship 4.1 feature you are likely using (auto-splitting tablets and range-based distribution).
* Correctness & Integrity: There is a dedicated effort titled "Real-time Storage Engine Stabilization" aimed at the exact type of silent-loss issues you reported.
* Iceberg V3 Support: Including native Support for the Variant type and full spec compliance.
3. Addressing "Accuracy Issues" in 4.x
You are right to be cautious. The 4.x series introduced Adaptive Layout and Group Execution, which changed the fundamental relationship between drivers and data buckets. While these provide huge performance gains for multi-tenant workloads, they have introduced new edge cases in query alignment (like yours).
Recommendation:
If your priority is absolute correctness over the adaptive-scaling features of 4.1, the community recommendation is:
1. Stay on the 4.1.x line to get the latest security and lakehouse fixes.
2. Keep enable_group_execution = false globally. This reverts the execution logic to the more battle-tested 3.x-style pipeline while still allowing you to benefit from the 4.1 storage improvements (like tablet auto-splitting).
I will monitor the status of #78920 and can let you know once a 4.1.6 release candidate is available.
References
• Introduction/Version_naming.md
• release_notes/release-4.1.md
• StarRocks Roadmap 2026 (GitHub Issue #67632)
References
• release_notes/release-2.1.md
• release_notes/release-4.0.mdAshish Gupta
09/28/2026, 1:25 PMRocky
09/28/2026, 1:26 PMmain branch.
* Backport: As you noted, the first backport attempt to 4.1 (#78965) was closed due to conflicts. A manual backport is required. Because this is a complex fix involving the execution engine's driver-to-bucket mapping, it is undergoing additional validation before being included in a maintenance release.
2. StarRocks 4.1.5 Release Notes
The reason you might be seeing a 404 is that the documentation for 4.1 patch releases is often consolidated. The 4.1.5 release was published on September 8, 2026, and the notes are live here:
* StarRocks v4.1 Release Notes (Consolidated)
Crucially: 4.1.5 does NOT contain the fix for your issue. It was released before #78920 was finalized. The fix is currently tracking for v4.1.6.
3. Roadmap and Accuracy
The "accuracy" issues in 4.x are a top priority for the maintainers. The move to Adaptive Layout and Group Execution in the 4.1 series changed how data is distributed and executed to handle multi-tenancy better, but it introduced these subtle alignment bugs in complex pipelines (Join + Window Function).
* Roadmap: The official 2026 roadmap is tracked in GitHub Issue #67632. The "Query Stability" and "Real-time Storage Engine Stabilization" tracks are specifically designed to address the class of issues you've hit.
* Recommendation: Until you upgrade to 4.1.6 (or a version where #78920 is explicitly listed in the notes), the community recommendation for production workloads requiring 100% accuracy in window-join pipelines is to:
sql
SET GLOBAL enable_group_execution = false;
This disables the new group-scheduling logic (the source of the alignment bug) while keeping the performance benefits of the rest of the 4.1 engine.
I've flagged your issue #79859 to the maintainers to ensure the 4.1 backport is prioritized.
References
• release_notes/release-4.1.md
• Introduction/Version_naming.md
• StarRocks Roadmap 2026 (GitHub Issue #67632)Ashish Gupta
10/07/2026, 11:52 AMRocky
10/07/2026, 11:52 AMANALYZE SAMPLE correctness.
* v4.1.6 (Released Sept 30): Introduced significant changes to jemalloc memory management and AWS SDK behavior, but did not include the driver-alignment fix for group execution.
* Your Issue #79859: Since you've raised this on GitHub, it is the best place to watch for the manual backport PR. Once you see a new PR targeting the branch-4.1 with the label cherry-pick, that fix will be locked for the 4.1.7 release.
3. StarRocks 4.X "Accuracy Issues" & Roadmap
You are correct that the 4.x series has had a higher-than-normal volume of correctness bugs in complex query pipelines. This is primarily due to the introduction of Group Execution and Adaptive Tablet Layout, which changed how the engine handles data distribution.
* Roadmap Document: The primary document for the current focus is GitHub Issue #67632: StarRocks Roadmap 2026.
* Stabilization Focus: For the remainder of 2026, the roadmap explicitly prioritizes "Storage & Execution Integrity" over new features. The goal is to bring the 4.1 line to the same "bulletproof" status that the 3.2/3.3 lines currently hold.
Current Best Practice
If you are seeing accuracy issues on 4.1.x, the community recommendation remains to keep Group Execution disabled globally until 4.1.7:
sql
SET GLOBAL enable_group_execution = false;
This forces the engine to use the stable 3.x-style pipeline drivers while still letting you use 4.1 features like Tablet Splitting and the new Iceberg Variant support.
References
• release_notes/release-4.1.md
• GitHub Issue #67632 (2026 Roadmap)
• Introduction/Version_naming.md