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


Welcome To openGauss Community
Hey @jyn88 , 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: StorageEngine ,
and any of the maintainers: @CarrotGo, @chendong76, @chenxiaobin19, @congzhou2603, @dodders, @hwworkholic, @jemappellehc, @muyulinzhong, @quemingjian, @shenzheng4, @shirley_zhengx, @superlchf, @totaj, @wlff234, @wofanzheng, @ywzq1161327784 ,
and any of the committers: @CityYard, @libiao2024, @lijieac, @theothersideofsea, @wang_bowen, @weithu, @xiong_xjun, @yuanyazhi, @zhangzq131 .



关键点有两处:
1)加载分区时,desc.cr_mode 会被改成索引上的值
(*index_part)->desc.cr_mode = index->desc.cr_mode;
影子分区也有:
shadow_part->desc.cr_mode = index->desc.cr_mode;
所以 DC 侧看到的是 当前 index 描述里的 cr_mode。
2)建 btree segment 时,写的是当时 desc->cr_mode
segment->cr_mode = desc->cr_mode;
集群场景下建索引还会强制 PCR:
} else if (DB_ATTR_CLUSTER(session)) {
idx_desc->cr_mode = CR_PAGE;
}
于是很典型的一种情况是:
索引/分区目录里仍是 CR_ROW
↓ rebuild 建 shadow btree 时按 PCR 写出 segment(CR_PAGE)
↓ 再 load 时用 index->desc.cr_mode(=CR_ROW) 填 part->desc
↓ 和 segment(CR_PAGE) 一对,panic
也就是:segment 已经是 PCR,DC 仍按 RCR 去认。


(gdb) p part->btree.index->btree.is_shadow
$52 = 1 '\001'
(gdb) p part->btree.index->btree.index == part->btree.index
$53 = 1
(gdb) p part->btree.index
$54 = (struct st_index *) 0xfffbe6b1d510
(gdb) p part->btree.index->btree.index
$55 = (struct st_index *) 0xfffbe6b1d510
(gdb) p part->btree.is_shadow
$56 = 1 '\001'
(gdb) p part->desc.name
$57 = "PART_1", '\000' <repeats 61 times>
(gdb) p part->desc.index_id
$58 = 0
(gdb)
$59 = 0
(gdb) p part->btree.index->entity->table.shadow_index
$60 = (shadow_index_t *) 0xfffbe6b1d500
(gdb) f 10
#10 0x0000aaaad77cb3bc in db_alter_index_rebuild (session=session@entry=0xfff91b5f2000, def=def@entry=0xfffbe1a25ff0, dc=dc@entry=0xfff924a79f20,
old_index=old_index@entry=0xfffbe698ab58) at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/kernel/table/knl_table.c:14285
warning: Source file is more recent than executable.
14285 status = db_rebuild_index(session, cursor, dc, rebuild_info.parts_loc.part[part_index]);
(gdb) p &index
$61 = (index_t *) 0xfff924a79b28


转测包自验证截图



转测包自验证截图



转测包自验证截图



回归版本:b020转测包双集群
回归结论:通过
该用例测试通过,符合预期




测试类型
SQL功能
测试版本
7.0.0LTS
问题描述
操作系统和硬件信息
cat /etc/system-release
openEuler release 22.03 (LTS-SP4)
测试环境
oGRAC双节点
被测功能
预置条件
操作步骤
前置用例:
tc_dss_user_000
oracle/hash_tbl/xatransaction/tc_dss_acid_hash_dml_000
问题用例:
oracle/hash_tbl/xatransaction_ddl/tc_dss_acid_hash_sig_ddl_035
重启数据库后的alter index rebuild发生core,目前测试几次必现
预期输出
实际输出
发生core
日志信息
数据库日志:
UTC+08:00 2026-08-12 15:41:06.741|MES|00000|2848122|ERROR>[mes] dst node return false, cmd=142. [mes_func.c:1628]
UTC+08:00 2026-08-12 15:41:06.741|COMMON|00000|2848122|INFO>[RC] broadcast reform status[6] finish, ret(-1), alive_bitmap(3) [rc_reform.c:1310]
UTC+08:00 2026-08-12 15:41:06.741|CLUSTER|00000|2848122|INFO>[RC] drc_broadcast_change_status ret=-1, curr=5, notify=6 [dtc_reform.c:1276]
UTC+08:00 2026-08-12 15:41:06.746|COMMON|00000|2848122|INFO>[RC] finish reform, reform status:6, mode:1, master_changed:0, [rc_reform.c:1033]
UTC+08:00 2026-08-12 15:41:19.021|DC|00366|2851144|ERROR>cr_mode is not match, panic info: index_part PART_1 [dc_part.c:1060]
UTC+08:00 2026-08-12 15:41:19.023|DC|00366|2851144|ERROR>Assertion throws an exception at line 1060 [dc_part.c:1060]
core堆栈:, siginfo=0xfff95591e140, context=0xfff95591e1c0), cursor=0xaaaaeb4b40c0, index=0xfffc197362f8,
(gdb) bt
#0 0x0000ffffb53e4020 in ?? () from /usr/lib64/libc.so.6
#1 0x0000ffffb539cfbc in raise () from /usr/lib64/libc.so.6
#2 0x0000ffffb538ad70 in abort () from /usr/lib64/libc.so.6
#3 0x0000aaaabe918108 in proc_sign_func (sig_num=
at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/server/srv_blackbox.c:740
#4
#5 0x0000aaaabed3996c in dc_load_index_part_segment (session=session@entry=0xfff95aad5000, dc_entity=0xfffc19635028,
part=0xfffc19755000) at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/kernel/catalog/dc_part.c:1060
#6 0x0000aaaabed3cd18 in dc_load_shwidx_part (part_pos=
session=0xfff95aad5000) at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/kernel/catalog/dc_part.c:1863
#7 dc_load_shadow_indexparts (session=session@entry=0xfff95aad5000, cursor=cursor@entry=0xaaaaeb4b40c0,
index=index@entry=0xfffc197362f8) at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/kernel/catalog/dc_part.c:1920
#8 0x0000aaaabed50cc0 in dc_load_shadow_index (session=session@entry=0xfff95aad5000, dc=dc@entry=0xfff95591f660)
at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/kernel/catalog/dc_tbl.c:2629
#9 0x0000aaaabeee27ec in db_rebuild_index (session=session@entry=0xfff95aad5000, cursor=cursor@entry=0xaaaaeb4c6ba8,
dc=dc@entry=0xfff95591ff20, part_loc=...)
at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/kernel/table/knl_table.c:13862
#10 0x0000aaaabef072fc in db_alter_index_rebuild (session=session@entry=0xfff95aad5000, def=def@entry=0xfffc1408dff0,
dc=dc@entry=0xfff95591ff20, old_index=old_index@entry=0xfffc18e72b58)
at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/kernel/table/knl_table.c:14285
#11 0x0000aaaabef99e90 in knl_alter_index_with_action (index=0xfffc18e72b58, dc=0xfff95591ff20, def=0xfffc1408dff0,
session=0xfff95aad5000) at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/kernel/knl_interface.c:6948
#12 knl_alter_index (session=0xfff95aad5000, stmt=stmt@entry=0xaaaaea85a400, def=0xfffc1408dff0)
at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/kernel/knl_interface.c:7059
#13 0x0000aaaabe95fc4c in sql_execute_alter_index (ogsql_stmt=ogsql_stmt@entry=0xaaaaea85a400)
at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/ogsql/executor/ddl_executor.c:679
#14 0x0000aaaabe960494 in sql_execute_ddl (ogsql_stmt=ogsql_stmt@entry=0xaaaaea85a400)
at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/ogsql/executor/ddl_executor.c:1065
(gdb) f 5
#5 0x0000aaaaab84996c in dc_load_index_part_segment (session=session@entry=0xfffac8d5a000, dc_entity=0xfffbf5c15028,
part=0xfffbf5d0d000) at /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/kernel/catalog/dc_part.c:1060
1060 /home/czk/workspace/workspace/oGRAC_pkg_v1/oGRAC/pkg/src/kernel/catalog/dc_part.c: No such file or directory.
(gdb) p part->desc.cr_mode
$1 = CR_ROW
(gdb) p (part->btree.segment)->cr_mode
$2 = 1 '\001'
提单组织
内部开发
测试代码