398 Star 1.4K Fork 1.6K

GVPopenGauss / openGauss-server

 / 详情

分区表,全表更新时存在内存泄露

已完成
缺陷
创建于  
2023-04-26 16:46

【标题描述】:分区表,全表更新时存在内存泄露
【测试类型:SQL功能】【测试版本:3.1.0】 分区表,全表更新时存在内存泄露

【操作系统和硬件信息】(查询命令: cat /etc/system-release, uname -a):
输入图片说明
【测试环境】(单机/1主x备x级联备):
单机
【被测功能】:
update
【测试类型】:
功能测试
【数据库版本】(查询命令: gaussdb -V):
输入图片说明
【预置条件】:

【操作步骤】(请填写详细的操作步骤):
create table t_1143478(
id serial NOT NULL,
res_id varchar(255) NOT NULL DEFAULT '33' ,
batch_id bigint NOT NULL DEFAULT 0 ,
ds_id bigint ,
db_name varchar(64) NOT NULL DEFAULT '1',primary key (id) )
partition by range(id) (
partition p1 values less than (2001),
partition p2 values less than (4001),
partition p3 values less than (6001),
partition p4 values less than (8001),
partition p5 values less than (MAXVALUE)
);

insert into t_1143478 (res_id,batch_id,db_name) values(generate_series(1, 10000000),generate_series(1, 10000000),generate_series(1, 10000000));
insert into t_1143478 (res_id,batch_id,db_name) values(generate_series(1, 10000000),generate_series(1, 10000000),generate_series(1, 10000000));
insert into t_1143478 (res_id,batch_id,db_name) values(generate_series(1, 10000000),generate_series(1, 10000000),generate_series(1, 10000000));
insert into t_1143478 (res_id,batch_id,db_name) values(generate_series(1, 10000000),generate_series(1, 10000000),generate_series(1, 10000000));

update t_1143478 set db_name = 2 ;

【预期输出】:
观察内存使用,内存没有持续增长
【实际输出】:
输入图片说明
【原因分析】:

  1. 这个问题的根因
  2. 问题推断过程
  3. 还有哪些原因可能造成类似现象
  4. 该问题是否有临时规避措施
  5. 问题解决方案
  6. 预计修复问题时间

【日志信息】(请附上日志文件、截图、coredump信息):

【测试代码】:

评论 (3)

清风 创建了缺陷

Hey @清风, Welcome to openGauss Community.
All of the projects in openGauss Community are maintained by @opengauss-bot.
That means the developers can comment below every pull request or issue to trigger Bot Commands.
Please follow instructions at Here to find the details.

Hi @清风, please use the command /sig xxx to add a SIG label to this issue.
For example: /sig sqlengine or /sig storageengine or /sig om or /sig ai and so on.
You can find more SIG labels from Here.
If you have no idea about that, please contact with @xiangxinyong , @zhangxubo .

yansong_lee 负责人设置为pengjiong
yansong_lee 优先级设置为主要
pengjiong 任务状态待办的 修改为已完成
pengjiong 负责人pengjiong 修改为未设置

5.0.1验证通过

test1=# create table t_1143478(
id serial NOT NULL,
res_id varchar(255) NOT NULL DEFAULT '33' ,
batch_id bigint NOT NULL DEFAULT 0 ,
ds_id bigint ,
db_name varchar(64) NOT NULL DEFAULT '1',primary key (id) )
partition by range(id) (
partition p1 values less than (2001),
partition p2 values less than (4001),
partition p3 values less than (6001),
partition p4 values less than (8001),
partition p5 values less than (MAXVALUE)
);
NOTICE:  CREATE TABLE will create implicit sequence "t_1143478_id_seq" for serial column "t_1143478.id"
NOTICE:  CREATE TABLE / PRIMARY KEY will create implicit index "t_1143478_pkey" for table "t_1143478"
CREATE TABLE
test1=# insert into t_1143478 (res_id,batch_id,db_name) values(generate_series(1, 10000000),generate_series(1, 10000000),generate_series(1, 10000000));
insert into t_1143478 (res_id,batch_id,db_name) values(generate_series(1, 10000000),generate_series(1, 10000000),generate_series(1, 10000000));
insert into t_1143478 (res_id,batch_id,db_name) values(generate_series(1, 10000000),generate_series(1, 10000000),generate_series(1, 10000000));
insert into t_1143478 (res_id,batch_id,db_name) values(generate_series(1, 10000000),generate_series(1, 10000000),generate_series(1, 10000000));

update t_1143478 set db_name = 2 ;
INSERT 0 10000000
INSERT 0 10000000
INSERT 0 10000000
INSERT 0 10000000
UPDATE 40000000
test1=# select contextname ,parent, totalsize/1024/1024 as totalsize, freesize/1024/1024 as freesize,usedsize/1024/1024 as usedsize from dbe_perf.session_memory_detail where contextname like '%ModifyTable%';
         contextname         |    parent     | totalsize |     freesize     |     usedsize
-----------------------------+---------------+-----------+------------------+------------------
 ModifyTable_140333975336512 | ExecutorState |  .0234375 | .010589599609375 | .012847900390625
(1 row)

test1=# select contextname ,parent, totalsize/1024/1024 as totalsize, freesize/1024/1024 as freesize,usedsize/1024/1024 as usedsize from dbe_perf.session_memory_detail where contextname like '%ModifyTable%';
         contextname         |    parent     | totalsize |    freesize    |    usedsize
-----------------------------+---------------+-----------+----------------+----------------
 ModifyTable_140333975336512 | ExecutorState |  .0234375 | .0184326171875 | .0050048828125
(1 row)

test1=# select contextname ,parent, totalsize/1024/1024 as totalsize, freesize/1024/1024 as freesize,usedsize/1024/1024 as usedsize from dbe_perf.session_memory_detail where contextname like '%ModifyTable%';
         contextname         |    parent     | totalsize |   freesize   |   usedsize
-----------------------------+---------------+-----------+--------------+--------------
 ModifyTable_140333975336512 | ExecutorState |  .0234375 | .01904296875 | .00439453125
(1 row)

test1=# select contextname ,parent, totalsize/1024/1024 as totalsize, freesize/1024/1024 as freesize,usedsize/1024/1024 as usedsize from dbe_perf.session_memory_detail where contextname like '%ModifyTable%';
         contextname         |    parent     | totalsize |    freesize    |    usedsize
-----------------------------+---------------+-----------+----------------+----------------
 ModifyTable_140333975336512 | ExecutorState |  .0234375 | .0184326171875 | .0050048828125
(1 row)

test1=# select contextname ,parent, totalsize/1024/1024 as totalsize, freesize/1024/1024 as freesize,usedsize/1024/1024 as usedsize from dbe_perf.session_memory_detail where contextname like '%ModifyTable%';
         contextname         |    parent     | totalsize |     freesize      |      usedsize
-----------------------------+---------------+-----------+-------------------+--------------------
 ModifyTable_140333975336512 | ExecutorState |  .0234375 | .0189285278320312 | .00450897216796875

登录 后才可以发表评论

状态
负责人
项目
里程碑
Pull Requests
关联的 Pull Requests 被合并后可能会关闭此 issue
分支
开始日期   -   截止日期
-
置顶选项
优先级
预计工期 (小时)
参与者(3)
5622128 opengauss bot 1581905080
C++
1
https://gitee.com/opengauss/openGauss-server.git
git@gitee.com:opengauss/openGauss-server.git
opengauss
openGauss-server
openGauss-server

搜索帮助