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

avamingli pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/main by this push:
     new 9d86458739c Fix parallel worker assignment for partial paths
9d86458739c is described below

commit 9d86458739ce31871b9c7b2f81bf3343243e3de0
Author: Zhang Mingli <[email protected]>
AuthorDate: Mon Sep 22 16:21:50 2025 +0800

    Fix parallel worker assignment for partial paths
    
    fix https://github.com/apache/cloudberry/issues/1366
    
    Update parallel_workers assignment to handle cases where partial paths
    may have
    parallel_workers = 0 after parallel-oblivious append. Move assignment
    before
    assertion and use pathnode->parallel_workers in the check.
    
    Authored-by: Zhang Mingli [email protected]
---
 src/backend/optimizer/util/pathnode.c | 9 +++++++--
 1 file changed, 7 insertions(+), 2 deletions(-)

diff --git a/src/backend/optimizer/util/pathnode.c 
b/src/backend/optimizer/util/pathnode.c
index 0347fe5030c..24b795dde17 100644
--- a/src/backend/optimizer/util/pathnode.c
+++ b/src/backend/optimizer/util/pathnode.c
@@ -2156,12 +2156,17 @@ set_append_path_locus(PlannerInfo *root, Path 
*pathnode, RelOptInfo *rel,
         * Partially fixed append issue.
         * But there are still several locus can't be parallel so that we can't 
handle it currently.
         */
-       AssertImply(parallel_workers > 1 &&
+       /*
+        * After we try parallel-bolivious append, there could be possible that 
partial paths with
+        * parallel_workers = 0, ex: a partial path and Motion to a path with 
parallel_workers = 0.
+        */
+       pathnode->parallel_workers = targetlocus.parallel_workers;
+
+       AssertImply(pathnode->parallel_workers > 1 &&
                                !CdbPathLocus_IsEntry(targetlocus) &&
                                !CdbPathLocus_IsOuterQuery(targetlocus) &&
                                !CdbPathLocus_IsGeneral(targetlocus) &&
                                !CdbPathLocus_IsSingleQE(targetlocus), 
targetlocus.parallel_workers > 1);
-       pathnode->parallel_workers = targetlocus.parallel_workers;
 
        *subpaths_out = new_subpaths;
 


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

Reply via email to