已合并
修复存储过程中执行完单条SQL后没有释放smp相关资源的问题 #7757
totaj创建于 2025年5月22日
修复存储过程中执行完单条SQL后没有释放smp相关资源的问题 #7757
已合并
totaj创建于 2025年5月22日
totaj
totaj成员
2025年5月22日

【标题】(请简要描述下实现的内容)
修复存储过程中执行完单条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
image.png

【实现方案】:
在spi执行结束时的 _SPI_end_call处增加释放SMP group的逻辑。同时为了不释放外层的SMP,在smp里面新增变量记录SPI的_connected数量,当前smp对应的_connected必须大于等于 spi的_connected才能释放

【关联需求或issue】:
https://gitcode.com/opengauss/openGauss-server/issues/7038

【开发自验报告】:

  1. 请附上自验结果(内容或者截图)
    image.png
  2. 是否可以添加fastcheck测试用例,如是,请补充fastcheck用例
    是,已添加
  3. 是否涉及资料修改,如是,在docs仓库补充资料
    不涉及
  4. 是否考虑升级场景(系统表修改、日志持久化以及修改执行态数据格式)
    不涉及
  5. 是否考虑在线扩容等扩展场景
    不涉及
  6. 是否考虑异常场景/并发场景/前向兼容/性能场景
    不涉及
  7. 是否对其他模块产生影响
    不涉及
    【其他说明】:
likedislike
Pull Request已成功合入, 合并人@opengauss_bot
(感谢 totaj 的贡献)
totajtotaj成员
2025年5月22日 创建了 pull request,commit 8f8471b3
opengauss_botopengauss_bot成员
2025年5月22日 添加了label:sig/Community
opengauss_botopengauss_bot成员
2025年5月22日 删除了label:codecheck-failed
opengauss_bot
opengauss_bot成员
2025年5月22日 评论:

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 .

likedislike
opengauss_botopengauss_bot成员
2025年5月22日 删除了label:codecheck-success
opengauss_botopengauss_bot成员
2025年5月22日 添加了label:opengauss-cla/yes
opengauss_botopengauss_bot成员
2025年5月22日 添加了label:codecheck-running
opengauss_bot
opengauss_bot成员
2025年5月22日 评论:

CLA Signature Pass

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

likedislike
opengauss_botopengauss_bot成员
2025年5月22日 删除了label:ci-pipeline-success
opengauss_botopengauss_bot成员
2025年5月22日 删除了label:ci-pipeline-failed
opengauss_botopengauss_bot成员
2025年5月22日 删除了label:lite-ci-success
opengauss_botopengauss_bot成员
2025年5月22日 添加了label:ci-pipeline-running
opengauss_botopengauss_bot成员
2025年5月22日 删除了label:lite-ci-failed
opengauss_botopengauss_bot成员
2025年5月22日 添加了label:needs-issue
opengauss_bot
opengauss_bot成员
2025年5月22日 评论:

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.

likedislike
opengauss_botopengauss_bot成员
2025年5月22日 添加了label:lite-ci-running
totajtotaj成员
2025年5月22日 修改标题为 “bugfix:修复存储过程中执行完单条SQL后没有释放smp相关资源的问题”,原标题为“test”
totajtotaj成员
2025年5月22日 修改标题为 “修复存储过程中执行完单条SQL后没有释放smp相关资源的问题”,原标题为“bugfix:修复存储过程中执行完单条SQL后没有释放smp相关资源的问题”
opengauss_bot
opengauss_bot成员
2025年5月22日 评论:

静态检查

Check Name Build Details Check Result Check Detail
CodeCheck #46078 ✅ 通过 >>>
likedislike
opengauss_botopengauss_bot成员
2025年5月22日 添加了label:codecheck-success
此处折叠了12条事件消息 查看更多
opengauss_botopengauss_bot成员
2025年5月22日 添加了label:ci-pipeline-success
opengauss_bot
opengauss_bot成员
2025年5月22日 评论:
Check Name Build Result Build Details
openGauss_server_pr Success #20611
likedislike
ywzq1161327784
ywzq1161327784成员
2025年5月22日 评论:

/lgtm
/approve

likedislike
opengauss_botopengauss_bot成员
2025年5月22日 添加了label:lgtm-ywzq1161327784
opengauss_bot
opengauss_bot成员
2025年5月22日 评论:

Review Code Feedback

  • The label lgtm-ywzq1161327784 was added to this pull request. It means that ywzq1161327784 reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
opengauss_botopengauss_bot成员
2025年5月22日 添加了label:approved
opengauss_bot
opengauss_bot成员
2025年5月22日 评论:

Review Code Feedback

  • The label approved was added to this pull request. It means that ywzq1161327784 reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
chenxiaobin19
chenxiaobin19成员
2025年5月22日 评论:

/lgtm

likedislike
opengauss_botopengauss_bot成员
2025年5月22日 添加了label:lgtm-chenxiaobin19
opengauss_bot
opengauss_bot成员
2025年5月22日 评论:

Review Code Feedback

  • The label lgtm-chenxiaobin19 was added to this pull request. It means that chenxiaobin19 reviewed the code changes. 👋
Tips
  • If this pull request is not merged while all conditions are met, comment /check-pr to try again. 😄
likedislike
opengauss_botopengauss_bot成员
2025年5月22日 合入了pull request,合并节点 SHA:67536d2cf2998f1af22971f3ec6cb1b863315728
opengauss_botopengauss_bot成员
2025年5月22日 删除了label:codecheck-failed
opengauss_botopengauss_bot成员
2025年5月22日 删除了label:codecheck-success
opengauss_bot
opengauss_bot成员
2025年5月22日 评论:

静态检查

Check Name Build Details Check Result Check Detail
CodeCheck #46084 ✅ 通过 >>>
likedislike
opengauss_botopengauss_bot成员
2025年5月22日 删除了label:codecheck-running