已关闭
[资料issue]: 资源池化 query_all_drc_info(0) 按文档执行报 return row 类型不匹配 #8485
wuchenlong创建于  9月7日关闭于  9月14日
wuchenlong
wuchenlong成员
9月7日 创建

测试类型

资料
SQL功能

测试版本

7.0.0LTS

操作系统和硬件信息

openEuler 20.03 aarch64(20.20.20.104/106)

测试环境

资源池化

操作步骤

环境:openGauss 7.0.0 资源池化双节点(ss_enable_dms/dss=on,集群 Normal)。

文档依据:
image.png

预期输出

query_all_drc_info(0) 按手册可正常返回 DRC 页面/锁信息行。

实际输出

image.png

日志信息

由临时仓 https://gitcode.com/wuchenlong/openGauss-issue-temp/issues/7 确认后转正式仓。

提单组织

测试团队

likedislike
wuchenlongwuchenlong成员
9月7日 添加了label:bug
opengauss_bot
opengauss_bot成员
9月7日 评论:

This issue requires an assignee. Since you haven't specified one, we've assigned TestManager as the default assignee for this issue.

likedislike
opengauss_botopengauss_bot成员
9月7日 将 TestManager 设为负责人
opengauss_bot
opengauss_bot成员
9月7日 评论:

Welcome To openGauss Community

Hey @wuchenlong , 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. You can self-configure the PR merge rules for this repository. For more details, please refer to Here.

Contact Guide

If you have any questions, please contact the SIG: StorageEngine, AI, CM, CloudNative, SecurityTechnology, SQLEngine ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @libiao2024, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @Igali, @bihua111, @cailei19, @h_ray, @levy53071, @libiao2024, @lihaixiao, @mrzack, @wangfeihuo, @wuyuechuan, @xiong_xjun, @zhangfengzhi123, @zhangxubo, @zhangzq131, @zjh_hw .

likedislike
opengauss_botopengauss_bot成员
9月7日 添加了label:sig/StorageEngine
wuchenlongwuchenlong成员
9月7日 issue优先级由 无优先级 改变为 主要
wuchenlongwuchenlong成员
9月7日 关联了看板:openGauss 7.0.0-LTS
muyulinzhongmuyulinzhong成员
9月9日 移除了负责人 TestManager
opengauss_bot
opengauss_bot成员
9月9日 评论:

This issue requires an assignee. Since you haven't specified one, we've assigned TestManager as the default assignee for this issue.

likedislike
opengauss_botopengauss_bot成员
9月9日 将 TestManager 设为负责人
muyulinzhongmuyulinzhong成员
9月9日 将 hejiahuan11 设为负责人,移除负责人 TestManager
hejiahuan11hejiahuan11成员
9月11日 issue状态由 待办的 改变为 已完成
hejiahuan11
hejiahuan11成员
9月12日 评论:

自验证:
image.png

likedislike
hejiahuan11hejiahuan11成员
9月12日 issue状态由 已完成 改变为 待回归
wuchenlong
wuchenlong成员
9月14日 评论:

回归版本:7.0.0-B023
回归环境:224 LTS B023,cluster_state=Normal
结论:通过

likedislike
wuchenlongwuchenlong成员
9月14日 issue状态由 待回归 改变为 已验收
wuchenlongwuchenlong成员
9月14日 关闭了 issue
hejiahuan11
hejiahuan11成员
7 天前 评论:

2026年10月10日自验证:
image.png

likedislike
wuchenlong
wuchenlong成员
5 天前 评论:

回归版本:8.0.0-RC1.B001(select version() = (openGauss 7.0.0 build 6a41b1ba) compiled at 2026-10-10 13:02:14;8.0.0-RC1 内部版本号仍为 7.0.0,属正常)
回归环境:224 lts wcl0623:15600(传统主备,非资源池化)+ master 文档/目录/代码静态核对
结论:本环境无法验证(运行态被 [SS] 入口拦截,需资源池化共享存储环境终验;文档与 pg_proc/tupdesc 静态侧已对齐)

说明与验证明细

  • 验证环境:224 lts wcl0623:15600(传统主备,非资源池化)
  • 验证方式:手册原文 + 目录契约 + 已安装二进制 pg_proc/tupdesc 三方静态核对;运行态尝试实跑

1) 运行态(本环境受限)

select * from query_all_drc_info(0);
ERROR:  [SS] cannot query query_all_drc_info without shared storage deployment!

非共享存储部署下函数入口即拦截,未进入执行器 tupledesc_match 校验,故本环境无法复现「return row 类型不匹配」是否消失,需要资源池化双节点环境才能完成终验。

2) 静态侧已对齐

  • 目录契约 builtin_funcs.ini(第 13698 行):18 个 OUT 列中 in_recovery/recycling = BPCHAR、part_id/len = int4;本机 pg_proc.proallargtypes = {23,25,23,20,23,23,23,23,1042,23,23,20,20,23,23,1042,23,23,23} 与之一致。
  • !9747 修复 C 运行时 tupdesc 向目录对齐:第 8 列 IN_RECOVERY INT4OID→BPCHAROID、第 10 列 PART_ID INT2OID→INT4OID、第 13 列 LEN INT2OID→INT4OID、第 15 列 RECYCLING INT4OID→BPCHAROID,并在 fill_drc_info_to_values 增加 bpchar 转换。
  • 按安装版本 build 6a41b1ba 取源码核对,该修复已包含在 8.0.0-RC1.B001 中。
  • 手册 docs/zh/sql_reference/resource_pooling_function.md 第 300/308/310–342 行:入参 type INT4、返回值类型 record、18 个返回列与目录声明列名/顺序一致,示例 select * from query_all_drc_info(0) limit 1; 输出 18 列。

关联 MR:!9747(master,2026-09-11 合入)、!9754(7.0.0,2026-09-11 合入)。

likedislike
wuchenlong
wuchenlong成员
5 天前 评论:

回归版本:8.0.0-RC1.B001(select version() = (openGauss 7.0.0 build 6a41b1ba) compiled at 2026-10-10 13:02:41 commit 0 last mr 9772;8.0.0-RC1 内部版本号仍为 7.0.0,属正常)
回归环境:资源池化双节点集群(20.20.20.104 主 / 20.20.20.106 备,openEuler 20.03 aarch64),cluster_state=Normal,CM/DMS/DSS 均 OnLine,ss_enable_dss=on、ss_enable_dms=on,gsql 端口 15400
结论:通过(select * from query_all_drc_info(0) 正常返回 18 列 DRC 行,不再报 return row 类型不匹配;type=0 共 333 行,type=1 锁信息同样正常)

完整回归 SQL

-- 资源池化集群(ss_enable_dms / ss_enable_dss = on)
select version();
show ss_enable_dss;
show ss_enable_dms;

-- 1) 手册原始写法
select * from query_all_drc_info(0);

-- 2) type=0 全量计数 / type=1 锁信息
select count(*) as rows_from_drc_info_0 from query_all_drc_info(0);
select * from query_all_drc_info(1) limit 1;

-- 3) 目录声明(返回值类型与 OUT 参数个数)
select proname, prorettype::regtype as rettype,
       array_length(proallargtypes,1) as n_args, proargmodes
from pg_proc where proname = 'query_all_drc_info';

-- 4) 按文档列名显式取值
select resource_id, master_id, copy_insts, part_id, len, in_recovery, recycling
from query_all_drc_info(0) limit 3;

实际输出

version: (openGauss 7.0.0 build 6a41b1ba) compiled at 2026-10-10 13:02:41 commit 0 last mr 9772
ss_enable_dss = on     ss_enable_dms = on

-- 1) 18 列正常返回,无 “return row 类型不匹配”
         resource_id         | master_id | copy_insts | claimed_owner | lock_mode | last_edp | type | in_recovery | copy_promote | part_id | edp_map | lsn | len | recovery_skip | recycling | converting_inst_id | converting_curr_mode | converting_req_mode
-----------------------------+-----------+------------+---------------+-----------+----------+------+-------------+--------------+---------+---------+-----+-----+---------------+-----------+--------------------+----------------------+---------------------
 1663/15789/4399/16384/0 0-0 |         0 |          2 |             0 |         1 |      255 |    1 | 0           |            0 |      34 |       0 |   0 |  24 |             0 | 0         |                255 |                    0 |                   0
(1 row)

-- 2) type=0 全量 333 行;type=1 锁信息同样 18 列
 rows_from_drc_info_0
----------------------
                  333
(1 row)

 resource_id  | master_id | copy_insts | claimed_owner | lock_mode | last_edp | type | in_recovery | ... | part_id | len | recovery_skip | recycling
 0/0/0/1260/0 |         0 |          0 |             1 |         1 |        0 |    2 | 0           |     |       8 |  24 |             0 | 0

-- 3) 目录:record + 19 个参数(1 in + 18 out)
      proname       | rettype | n_args |               proargmodes
 query_all_drc_info | record  |     19 | {i,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o,o}

-- 4) 文档列名可直接引用
         resource_id         | master_id | copy_insts | part_id | len | in_recovery | recycling
 1663/15789/4399/16384/0 0-0 |         0 |          2 |      34 |  24 | 0           | 0
 1664/0/4169/16384/0 0-0     |         0 |          0 |      55 |  24 | 0           | 0
 1664/0/1/16384/0 0-4161     |         0 |          2 |      61 |  24 | 0           | 0

说明:本构建的 C 侧 tupdesc 与 pg_proc 目录声明已一致(!9747/!9754 已合入),手册 select * from query_all_drc_info(0) limit 1; 可直接执行并返回预期列。

likedislike