Pull Request已成功合入, 合并人@opengauss_bot
(感谢 totaj 的贡献)Welcome To openGauss Community
Hey @totaj , thanks for your contribution to the community.
Bot Usage Manual
I'm the Bot here serving you. You can find the instructions on how to interact with me at Here . That means you can comment below every pull request or issue to trigger Bot Commands.
Contact Guide
If you have any questions, please contact the SIG: Community ,
and any of the committers: @zhangfengzhi123, @wangfeihuo, @dodders, @libiao2024, @quemingjian, @totaj, @jemappellehc, @superlchf, @congzhou2603, @hwworkholic, @shenzheng4, @CarrotGo, @muyulinzhong, @chenxiaobin19, @ywzq1161327784, @chendong76 .


CLA Signature Pass
@totaj, thanks for your pull request. All authors of the commits have signed the CLA. 👋


Notice
@totaj , the pull request must be associated with at least one issue.
If it is already associated with an issue, but the needs-issue label also exists, you can comment on /check-issue to remove this label.


| Check Name | Build Result | Build Details |
|---|---|---|
| openGauss_server_pr | ✅ Success | #20611 |


/lgtm
/approve


/lgtm


【标题】(请简要描述下实现的内容)
修复存储过程中执行完单条SQL后没有释放smp相关资源的问题
【实现内容】:
修复存储过程中执行完单条SQL后没有释放smp相关资源的问题
【根因分析】:

根据issue中的用例跟踪代码可发现,在存储过程中执行第二条SQL时,在 pgxc_planner 处会执行 set_default_stream,判断能否支持SMP,此时和第一次执行SQL不同之处在于 u_sess->stream_cxt.global_obj 不为NULL,导致u_sess->opt_cxt.is_stream为false,后续无法使用SMP
【实现方案】:
在spi执行结束时的
_SPI_end_call处增加释放SMP group的逻辑。同时为了不释放外层的SMP,在smp里面新增变量记录SPI的_connected数量,当前smp对应的_connected必须大于等于 spi的_connected才能释放【关联需求或issue】:
https://gitcode.com/opengauss/openGauss-server/issues/7038
【开发自验报告】:
是,已添加
不涉及
不涉及
不涉及
不涉及
不涉及
【其他说明】: