Re: [POC] Fast COPY FROM command for the table with foreign partitions

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: "tsunakawa(dot)takay(at)fujitsu(dot)com" <tsunakawa(dot)takay(at)fujitsu(dot)com>
Cc: 'Andrey Lepikhov' <a(dot)lepikhov(at)postgrespro(dot)ru>, "tanghy(dot)fnst(at)cn(dot)fujitsu(dot)com" <tanghy(dot)fnst(at)cn(dot)fujitsu(dot)com>, Alexey Kondratov <a(dot)kondratov(at)postgrespro(dot)ru>, Michael Paquier <michael(at)paquier(dot)xyz>, Ashutosh Bapat <ashutosh(dot)bapat(at)2ndquadrant(dot)com>, Ashutosh Bapat <ashutosh(dot)bapat(dot)oss(at)gmail(dot)com>, Etsuro Fujita <etsuro(dot)fujita(at)gmail(dot)com>, PostgreSQL-Dev <pgsql-hackers(at)postgresql(dot)org>, Tomas Vondra <tomas(dot)vondra(at)enterprisedb(dot)com>, "houzj(dot)fnst(at)cn(dot)fujitsu(dot)com" <houzj(dot)fnst(at)cn(dot)fujitsu(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>
Subject: Re: [POC] Fast COPY FROM command for the table with foreign partitions
Date: 2021-02-14 21:03:38
Message-ID: 20210214210338.GN1793@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Feb 09, 2021 at 04:35:03AM +0000, tsunakawa(dot)takay(at)fujitsu(dot)com wrote:
> Rebased to HEAD with the following modifications. It passes make check in the top directory and contrib/postgres_fdw.
> That said, with the reviews from some people and good performance results, I think this can be ready for committer.

This is crashing during fdw check.
http://cfbot.cputube.org/andrey-lepikhov.html

Maybe it's related to this patch:
|commit 6214e2b2280462cbc3aa1986e350e167651b3905
| Fix permission checks on constraint violation errors on partitions.
| Security: CVE-2021-3393

TRAP: FailedAssertion("n >= 0 && n < list->length", File: "../../src/include/nodes/pg_list.h", Line: 259, PID: 19780)

(gdb) bt
#0 __GI_raise (sig=sig(at)entry=6) at ../sysdeps/unix/sysv/linux/raise.c:51
#1 0x00007fd33a557801 in __GI_abort () at abort.c:79
#2 0x000055f7f53bbc88 in ExceptionalCondition (conditionName=conditionName(at)entry=0x7fd33b81bc40 "n >= 0 && n < list->length", errorType=errorType(at)entry=0x7fd33b81b698 "FailedAssertion",
fileName=fileName(at)entry=0x7fd33b81be70 "../../src/include/nodes/pg_list.h", lineNumber=lineNumber(at)entry=259) at assert.c:69
#3 0x00007fd33b816b54 in list_nth_cell (n=<optimized out>, list=<optimized out>) at ../../src/include/nodes/pg_list.h:259
#4 list_nth (n=<optimized out>, list=<optimized out>) at ../../src/include/nodes/pg_list.h:281
#5 exec_rt_fetch (estate=<optimized out>, rti=<optimized out>) at ../../src/include/executor/executor.h:558
#6 postgresBeginForeignCopy (mtstate=<optimized out>, resultRelInfo=<optimized out>) at postgres_fdw.c:2208
#7 0x000055f7f5114bb4 in ExecInitRoutingInfo (mtstate=mtstate(at)entry=0x55f7f710a508, estate=estate(at)entry=0x55f7f71a7d50, proute=proute(at)entry=0x55f7f710a720, dispatch=dispatch(at)entry=0x55f7f710a778,
partRelInfo=partRelInfo(at)entry=0x55f7f710eb20, partidx=partidx(at)entry=0) at execPartition.c:1004
#8 0x000055f7f511618d in ExecInitPartitionInfo (partidx=0, rootResultRelInfo=0x55f7f710a278, dispatch=0x55f7f710a778, proute=0x55f7f710a720, estate=0x55f7f71a7d50, mtstate=0x55f7f710a508) at execPartition.c:742
#9 ExecFindPartition () at execPartition.c:400
#10 0x000055f7f50a2718 in CopyFrom () at copyfrom.c:857
#11 0x000055f7f50a1b06 in DoCopy () at copy.c:299

(gdb) up
#7 0x000055f7f5114bb4 in ExecInitRoutingInfo (mtstate=mtstate(at)entry=0x55f7f710a508, estate=estate(at)entry=0x55f7f71a7d50, proute=proute(at)entry=0x55f7f710a720, dispatch=dispatch(at)entry=0x55f7f710a778,
partRelInfo=partRelInfo(at)entry=0x55f7f710eb20, partidx=partidx(at)entry=0) at execPartition.c:1004
1004 partRelInfo->ri_FdwRoutine->BeginForeignCopy(mtstate, partRelInfo);
(gdb) p partRelInfo->ri_RangeTableIndex
$7 = 0
(gdb) p *estate->es_range_table
$9 = {type = T_List, length = 1, max_length = 5, elements = 0x55f7f717a2c0, initial_elements = 0x55f7f717a2c0}

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Thomas Munro 2021-02-14 22:07:37 Re: GlobalVisIsRemovableFullXid() vs GlobalVisCheckRemovableXid()
Previous Message Peter Geoghegan 2021-02-14 21:01:57 Re: GlobalVisIsRemovableFullXid() vs GlobalVisCheckRemovableXid()