my-ship-it commented on code in PR #1304:
URL: https://github.com/apache/cloudberry/pull/1304#discussion_r2268754177


##########
src/backend/utils/mmgr/portalmem.c:
##########
@@ -587,7 +588,7 @@ PortalDrop(Portal portal, bool isTopCommit)
        if (portal->resowner &&
                (!isTopCommit || portal->status == PORTAL_FAILED))
        {
-               bool            isCommit = (portal->status != PORTAL_FAILED);
+               bool            isCommit = (portal->status != PORTAL_FAILED) && 
!portal->stop_requested_in_motion;

Review Comment:
   For SQL like `SELECT * FROM tbl limit 1;`
   
   ```
   postgres=# explain select * from tbl limit 1;
                                        QUERY PLAN
   
------------------------------------------------------------------------------------
    Limit  (cost=0.00..431.00 rows=1 width=4)
      ->  Gather Motion 3:1  (slice1; segments: 3)  (cost=0.00..431.00 rows=1 
width=4)
            ->  Seq Scan on tbl  (cost=0.00..431.00 rows=1 width=4)
    Optimizer: GPORCA
   ```
   The executor Limit on QD also calls ExecSquelchMotion which sets 
node->stopRequested.
   Should we do cleanup in AtAbort_Portals?



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