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 @jiangyan_jack , 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, @ywzq1161327784 ,
and any of the committers: @CityYard, @libiao2024, @lijieac, @theothersideofsea, @wang_bowen, @weithu, @xiong_xjun, @yuanyazhi .


ogsql / as sysdba -q -c "SELECT SID, EVENT#, EVENT, WAIT_CLASS, STATE, WAIT_TIME_MIRCO, SECONDS_IN_WAIT FROM SYS.DV_SESSION_WAITS WHERE STATE = 'WAITING';"
connected.
SQL>
SID EVENT# EVENT WAIT_CLASS STATE WAIT_TIME_MIRCO SECONDS_IN_WAIT
------------ ------------ ---------------------------------------------------------------- ---------------------------------------------------------------- ---------------------------------------------------------------- -------------------- --------------------
48 8 log file sync Commit WAITING 555 0
1 rows fetched.
log file sync卡住
卡死的线程堆栈间歇性的会出现如下两种,3453435为Ogracd进程号
for tid in /proc/3453435/task/*/; do tid=$(basename $tid); state=$(cat /proc/3453435/task/$tid/stat 2>/dev/null | awk '{print $3}'); wchan=$(cat /proc/3453435/task/$tid/wchan 2>/dev/null); if [ "$state" = "D" ]; then echo "=== TID: $tid STATE: $state WCHAN: $wchan ==="; cat /proc/3453435/task/$tid/stack 2>/dev/null | head -5; echo ""; fi; done
=== TID: 3457073 STATE: D WCHAN: futex_wait_queue_me ===
[<0>] __switch_to+0xf0/0x158
[<0>] __blkdev_direct_IO_simple+0x1a8/0x370
[<0>] blkdev_direct_IO+0x38c/0x400
[<0>] generic_file_direct_write+0x94/0x1a0
[<0>] __generic_file_write_iter+0xb0/0x1c8
for tid in /proc/3453435/task/*/; do tid=$(basename $tid); state=$(cat /proc/3453435/task/$tid/stat 2>/dev/null | awk '{print $3}'); wchan=$(cat /proc/3453435/task/$tid/wchan 2>/dev/null); if [ "$state" = "D" ]; then echo "=== TID: $tid STATE: $state WCHAN: $wchan ==="; cat /proc/3453435/task/$tid/stack 2>/dev/null | head -5; echo ""; fi; done
=== TID: 3457073 STATE: D WCHAN: __blkdev_direct_IO_simple ===
[<0>] __switch_to+0xf0/0x158
[<0>] futex_wait_queue_me+0xd4/0x158
[<0>] futex_wait+0xf4/0x230
[<0>] do_futex+0x440/0x8c8
[<0>] __arm64_sys_futex+0x13c/0x188
同时,dmesg -T | tail -100有回显如下
[Sat Jun 20 14:17:39 2026] sd 6:0:8:0: reservation conflict
[Sat Jun 20 14:17:39 2026] sd 6:0:10:0: reservation conflict
[Sat Jun 20 14:17:39 2026] sd 6:0:11:0: reservation conflict
[Sat Jun 20 14:28:05 2026] systemd-fstab-generator[3563746]: Failed to create unit file /run/systemd/generator/usr1.mount, as it already exists. Duplicate entry in /etc/fstab?
[Sat Jun 20 14:28:05 2026] systemd-rc-local-generator[3563750]: /etc/rc.d/rc.local is not marked executable, skipping.
[6:0:8:0][6:0:10:0][6:0:11:0]分别是三个dss disk
__blkdev_direct_IO_simple,说明请求已经下发到块设备层,正在等待磁盘返回。
待进一步分析确认修改方式


7.21
dmesg并没有任何输出,但该问题仍然复现,发现ogracd的stack中D状态可能由于futex_wait导致
[<0>] futex_wait_queue_me+0xd4/0x158
[<0>] futex_wait+0xf4/0x230
[<0>] do_futex+0x440/0x8c8
空表的动态采样会走进stats_gather_empty_table,会启动自治事务更新sys_columns、sys_index、sys_tablepart、sys_table,自治事务提交会产生redo
然后在ogracd的多个dbwr_proc线程中看到显示在libpthread的锁等待位
暂时怀疑是该场景稳定引起死锁,计划尝试debug环境复现,确认一下锁类型和拥有者、等待链


自验证:



回归日期:2026年7月30日
回归版本:openGauss7.0.0LTS
验证截图



测试类型
SQL功能
测试版本
7.0.0LTS
问题描述
打开动态采样参数,select *from空表会卡住
操作系统和硬件信息
NAME="openEuler"
VERSION="22.03 (LTS-SP4)"
ID="openEuler"
VERSION_ID="22.03"
PRETTY_NAME="openEuler 22.03 (LTS-SP4)"
ANSI_COLOR="0;31"
测试环境
企业版主备
被测功能
动态采样
预置条件
操作步骤
ALTER SYSTEM SET _opt_cbo_stat_sampling_level = 1;
drop table test_3;
create table test_3 (a int);
select *from test_3;
预期输出
Succeed
实际输出
SQL卡住
日志信息
绿区机器
堆栈路径/home/ograc
日志路径/data/ograc_install/ograc/log/ograc/run
提单组织
测试团队
测试代码