apache / apache/cloudberry

[Bug] Parallel query plan changes, plan is unstable

Open
#1,593 2 comments 0 reactions 1 assignee Claimed by @aviralgarg05 View on GitHub
type: Bug
Dominant language
C
Stars
1.4k
Forks
247
Avg merge
4d 3h
Merged PRs (30d)
39

Description

### Apache Cloudberry version

Latest main branch

### What happened

```
======================================================================
DIFF FILE: /workspace/database/src/test/regress/regression.diffs
----------------------------------------------------------------------
diff -I HINT: -I CONTEXT: -I GP_IGNORE: -U3 /workspace/database/src/test/regress/expected/orca_parallel.out /workspace/database/src/test/regress/results/orca_parallel.out
--- /workspace/database/src/test/regress/expected/orca_parallel.out 2026-03-02 14:57:53.726035231 +0800
+++ /workspace/database/src/test/regress/results/orca_parallel.out 2026-03-02 14:57:53.754037247 +0800
@@ -690,18 +690,30 @@
___________
Gather Motion 6:1 (slice1; segments: 6)
Output: pidx1.a, pidx1.b
- -> Parallel Hash Semi Join
+ -> Result
Output: pidx1.a, pidx1.b
- Hash Cond: (pidx1.a = pidx2.c)
- -> Parallel Index Scan using pidx1_a_idx on orca_parallel.pidx1
- Output: pidx1.a, pidx1.b
- Index Cond: (pidx1.a < 500)
- -> Parallel Hash
- Output: pidx2.c
- -> Parallel Index Only Scan using pidx2_c_idx on orca_parallel.pidx2
- Output: pidx2.c
- Index Cond: (pidx2.c < 500)
-GP_IGNORE:(15 rows)
+ -> Unique
+ Output: pidx1.a, pidx1.b, (RowIdExpr)
+ Group Key: (RowIdExpr)
+ -> Sort
+ Output: pidx1.a, pidx1.b, (RowIdExpr)
+ Sort Key: (RowIdExpr)
+ -> Redistribute Motion 6:6 (slice2; segments: 6)
+ Output: pidx1.a, pidx1.b, (RowIdExpr)
+ Hash Key: (RowIdExpr)
+ Hash Module: 3
+ -> Parallel Hash Join
+ Output: pidx1.a, pidx1.b, (RowIdExpr)
+ Hash Cond: (pidx2.c = pidx1.a)
+ -> Parallel Index Only Scan using pidx2_c_idx on orca_parallel.pidx2
+ Output: pidx2.c
+ Index Cond: (pidx2.c < 500)
+ -> Parallel Hash
+ Output: pidx1.a, pidx1.b, (RowIdExpr)
+ -> Parallel Index Scan using pidx1_a_idx on orca_parallel.pidx1
+ Output: pidx1.a, pidx1.b, RowIdExpr
+ Index Cond: (pidx1.a < 500)
+GP_IGNORE:(27 rows)
```

### What you think should happen instead

_No response_

### How to reproduce

CI test error, instability occurs

### Operating System

aarch64

### Anything else

_No response_

### Are you willing to submit PR?

- [ ] Yes, I am willing to submit a PR!

### Code of Conduct

- [x] I agree to follow this project's [Code of Conduct](https://github.com/apache/cloudberry/blob/main/CODE_OF_CONDUCT.md).

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.