254 Star 650 Fork 462

GVPopenGauss / openGauss-server

 / 详情

upsert 分区键core掉

Accepted
Bug
Opened this issue  
2021-07-30 17:41

Is this a BUG REPORT or FEATURE REQUEST?:

Uncomment only one, leave it on its own line:

  • bug

  • feature

What happened:
Upsert分区表与全局索引,insert的数据跨分区时必现 CORE

What you expected to happen:
不core
How to reproduce it (as minimally and precisely as possible):
create table tb(ptk int, indk int) partition by range(ptk)(partition p1 values less than(10), partition p2 values less than(maxvalue));
insert into tb values(1,1),(11,11);
create unique index tbi on tb(indk);

insert into tb values(1,11) on duplicate key update ptk=11; -- values里的必须分区键和冲突索引不在一个分区

Anything else we need to know?:
堆栈
#0 BBOX_CreateCoredump (file_name=0x7fec333d4520 ".//core-gaussdb-59974-2021_07_30_17_37_10-bbox.lz4") at bbox_create.cpp:404
#1 0x0000000001162e4a in bbox_handler (sig=11, si=0x7fec333d4bb0, uc=0x7fec333d4a80) at gs_bbox.cpp:111
#2
#3 0x00000000019a97b6 in tableam_scan_index_fetch_tuple (scan=0x7fec2f779860, all_dead=0x7fec333d5797) at ../../../../../src/include/access/tableam.h:694
#4 0x00000000019aaa99 in index_fetch_heap (scan=0x7fec2f779860) at indexam.cpp:502
#5 0x00000000019aada9 in index_getnext (scan=0x7fec2f779860, direction=ForwardScanDirection) at indexam.cpp:575
#6 0x00000000015dce51 in check_violation (heap=0x7febf21038e8, index=0x7febf2113230, indexInfo=0x7fec2f7625e0, tupleid=0x7fec333d72ea, values=0x7fec333d7430, isnull=0x7fec333d73a0, estate=0x7febf8d07060,
newIndex=false, errorOK=true, waitMode=CHECK_WAIT, conflictTid=0x7fec333d7620) at execUtils.cpp:1705
#7 0x00000000015db725 in ExecCheckIndexConstraints (slot=0x7fec2f7f5460, estate=0x7febf8d07060, targetRel=0x7febf21038e8, p=0x7febf210ccf0, bucketId=-1, conflictTid=0x7fec333d7620) at execUtils.cpp:1364
#8 0x0000000001616c0f in ExecUpsert (state=0x7fec2f762060, slot=0x7fec2f7f5460, planSlot=0x7fec2f7f5460, estate=0x7febf8d07060, canSetTag=true, tuple=0x7fec2f7f6058, returning=0x7fec333d77e0,
updated=0x7fec333d77d8) at nodeModifyTable.cpp:602
#9 0x00000000016211cf in ExecInsertT (state=0x7fec2f762060, slot=0x7fec2f7f5460, planSlot=0x7fec2f7f5460, estate=0x7febf8d07060, canSetTag=true, options=0, partitionList=0x7fec333d78d0)
at nodeModifyTable.cpp:867
#10 0x000000000161e3b9 in ExecModifyTable (node=0x7fec2f762060) at nodeModifyTable.cpp:2606
#11 0x00000000015bab5c in ExecProcNodeByType (node=0x7fec2f762060) at execProcnode.cpp:612
#12 0x00000000015bb1f7 in ExecProcNode (node=0x7fec2f762060) at execProcnode.cpp:774
#13 0x00000000015b5b60 in ExecutePlan (estate=0x7febf8d07060, planstate=0x7fec2f762060, operation=CMD_INSERT, sendTuples=false, numberTuples=0, direction=ForwardScanDirection, dest=0x7fec2f7c1c38)
at execMain.cpp:2151
#14 0x00000000015b262c in standard_ExecutorRun (queryDesc=0x7febf3bec060, direction=ForwardScanDirection, count=0) at execMain.cpp:619
#15 0x0000000001464882 in explain_ExecutorRun (queryDesc=0x7febf3bec060, direction=ForwardScanDirection, count=0) at auto_explain.cpp:116
#16 0x00000000015b215f in ExecutorRun (queryDesc=0x7febf3bec060, direction=ForwardScanDirection, count=0) at execMain.cpp:497
#17 0x000000000153f1fb in ProcessQuery (plan=0x7fec3f85d648, sourceText=0x7fec2f7c0060 "insert into tb values(1,11) on duplicate key update ptk=11;", params=0x0, dest=0x7fec2f7c1c38,
completionTag=0x7fec333d8060 "") at pquery.cpp:291
#18 0x0000000001543181 in PortalRunMulti (portal=0x7fec32272060, isTopLevel=true, dest=0x7fec2f7c1c38, altdest=0x7fec2f7c1c38, completionTag=0x7fec333d8060 "") at pquery.cpp:1866
#19 0x0000000001541813 in PortalRun (portal=0x7fec32272060, count=9223372036854775807, isTopLevel=true, dest=0x7fec2f7c1c38, altdest=0x7fec2f7c1c38, completionTag=0x7fec333d8060 "") at pquery.cpp:1173
#20 0x000000000152bcb9 in exec_simple_query (query_string=0x7fec2f7c0060 "insert into tb values(1,11) on duplicate key update ptk=11;", messageType=QUERY_MESSAGE, msg=0x7fec333d81e0) at postgres.cpp:2614
#21 0x0000000001536db1 in PostgresMain (argc=1, argv=0x7fec2f6e4508, dbname=0x0, username=0x0) at postgres.cpp:7974
#22 0x00000000014aa89d in BackendRun (port=0x7fec333d86f0) at postmaster.cpp:6983
#23 0x00000000014b67ba in GaussDbThreadMain<(knl_thread_role)2> (arg=0x7fec4bbf1d10) at postmaster.cpp:10172
#24 0x00000000014b2f1b in InternalThreadFunc (args=0x7fec4bbf1d10) at postmaster.cpp:10637
#25 0x0000000001d0c9aa in ThreadStarterFunc (arg=0x7fec4bbf1d00) at gs_thread.cpp:377
#26 0x00007fec76fabdc5 in start_thread () from /lib64/libpthread.so.0
#27 0x00007fec76cda50d in clone () from /lib64/libc.so.6

Environment:

  • Version:
  • OS (e.g. from /etc/os-release):
  • Kernel (e.g. uname -a):
  • Install tools:
  • Others:

Comments (1)

gentle_hu created缺陷
gentle_hu set related repository to openGauss/openGauss-server
Expand operation logs

Hey @gentle_hu , 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 https://gitee.com/opengauss/community/blob/master/contributors/command.en.md to find the details.

gentle_hu set assignee to CodeRejector
gentle_hu set deadline to 2021-08-14
gentle_hu set priority to Serious
gentle_hu added
 
kind/bug
label
gentle_hu changed description
gentle_hu changed description
zhangxubo added
 
sig/sqlengine
label
gentle_hu changed description
gentle_hu changed issue state from 待办的 to 已验收

Sign in to comment

Status
Assignees
Projects
Milestones
Pull Requests
Successfully merging a pull request will close this issue.
Branches
Planed to start   -   Planed to end
-
Top level
Priority
Duration (hours)
Confirm
参与者(2)
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

Search

233307 c1314fcc 1850385 233305 0212f5e2 1850385