Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBOYV-0003JO-C3 for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Feb 2021 21:03:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lBOYU-0005fh-AQ for pgsql-hackers@arkaria.postgresql.org; Sun, 14 Feb 2021 21:03:46 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lBOYT-0005f7-Vc for pgsql-hackers@lists.postgresql.org; Sun, 14 Feb 2021 21:03:46 +0000 Received: from mail-il1-x12c.google.com ([2607:f8b0:4864:20::12c]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lBOYP-0006jJ-LL for pgsql-hackers@postgresql.org; Sun, 14 Feb 2021 21:03:44 +0000 Received: by mail-il1-x12c.google.com with SMTP id z18so3927869ile.9 for ; Sun, 14 Feb 2021 13:03:41 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=cYl27MpbVqbsEe1vM1omXRMorMGuRN5esd2SQ7Cn4C4=; b=PuCA2uTgq10owGJSwPUARD/Hq+T+nxAb9FwXu3e2qB88obpfNObsmDc4KGkQO0hn6u gRkqbwJ2vbQrnXlRIGbS5pI4ClAC6mCkJQ8KoNd0JJhU39+Q1imUZ0RulYxqdeTsbnn/ S7RDfN8rNgxeg238+T7Efa4t45Qr36KdMK8NSvAF/YcrfiAFfJEAhZF1F8WzrNW32seC 6NQ2S21bgPG1tEK6UrcaqslsNaDdsoOZfpJp59jBR92BQTp6Eh6LLDywGGazGiTllDdv CXN+0fCMByJp3A+ygYpufiX9g/b6gW+TwSxLGXGMcTnfbNvzbO3CJj0lj/QhKcaq4IoY UE0g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=cYl27MpbVqbsEe1vM1omXRMorMGuRN5esd2SQ7Cn4C4=; b=jYBtB7AxpArmowaYhHGl16AVKMc34yxfk9kok/2rhMpEk+f+yhJgtoI7Ngj1cF1VA5 lgnTPzUCPXp2ndXPFAXoZkLfstDWaNWMZxCGyYSC8oYTm9ZHBO9S9YWO+0nn6m6GE+B3 9Ais49lt7ffRMShD97HhzAkeC7BIaANkHR2Fp7fTPHfinCTyvnnrhYnQgA0M7TvuGF38 6WHYwL6BX5RnkYsMSY4dD5QVUS4RDZFUpd3++RIoccAdMLvyLov3ghzuCjlPz2dEWHyv R3TRZ1qIkS/5UPI9ikxzTlTNm4wKHi8cbnHXdVbN3piBL7usBaBDfp31MeIAl8rtfB+y aVCw== X-Gm-Message-State: AOAM530nZaOqCkSNx8pHD+9fmoyi9gVTZ5HxNWiRz0Y23eJt1YRrtjsW SbiUrfhOSfhYnS/tFi6zak7h1g== X-Google-Smtp-Source: ABdhPJzQNNb2hbQ5hAipJoZKCHS6LJl1j2x5Bu7EH4f0HZ48eZ6FQ556ZslZ3YEV9trJUKJ1Srx6yg== X-Received: by 2002:a05:6e02:1ca4:: with SMTP id x4mr10351733ill.58.1613336620366; Sun, 14 Feb 2021 13:03:40 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id b7sm7430169ioz.11.2021.02.14.13.03.39 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Sun, 14 Feb 2021 13:03:39 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id C9C6C800A3B; Sun, 14 Feb 2021 15:03:38 -0600 (CST) Date: Sun, 14 Feb 2021 15:03:38 -0600 From: Justin Pryzby To: "tsunakawa.takay@fujitsu.com" Cc: 'Andrey Lepikhov' , "tanghy.fnst@cn.fujitsu.com" , Alexey Kondratov , Michael Paquier , Ashutosh Bapat , Ashutosh Bapat , Etsuro Fujita , PostgreSQL-Dev , Tomas Vondra , "houzj.fnst@cn.fujitsu.com" , Amit Langote Subject: Re: [POC] Fast COPY FROM command for the table with foreign partitions Message-ID: <20210214210338.GN1793@telsasoft.com> References: <2b465f4cdeeb4a78b3096d31e8af7c77@G08CNEXMBPEKD05.g08.fujitsu.local> <9862b608-884b-da1f-afb5-2ee5f2396257@enterprisedb.com> <6160196a-88a4-ded8-1047-cec16537a111@postgrespro.ru> <95b3e446-92ec-f01f-2035-5f5509e6e016@postgrespro.ru> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On Tue, Feb 09, 2021 at 04:35:03AM +0000, tsunakawa.takay@fujitsu.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@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@entry=0x7fd33b81bc40 "n >= 0 && n < list->length", errorType=errorType@entry=0x7fd33b81b698 "FailedAssertion", fileName=fileName@entry=0x7fd33b81be70 "../../src/include/nodes/pg_list.h", lineNumber=lineNumber@entry=259) at assert.c:69 #3 0x00007fd33b816b54 in list_nth_cell (n=, list=) at ../../src/include/nodes/pg_list.h:259 #4 list_nth (n=, list=) at ../../src/include/nodes/pg_list.h:281 #5 exec_rt_fetch (estate=, rti=) at ../../src/include/executor/executor.h:558 #6 postgresBeginForeignCopy (mtstate=, resultRelInfo=) at postgres_fdw.c:2208 #7 0x000055f7f5114bb4 in ExecInitRoutingInfo (mtstate=mtstate@entry=0x55f7f710a508, estate=estate@entry=0x55f7f71a7d50, proute=proute@entry=0x55f7f710a720, dispatch=dispatch@entry=0x55f7f710a778, partRelInfo=partRelInfo@entry=0x55f7f710eb20, partidx=partidx@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@entry=0x55f7f710a508, estate=estate@entry=0x55f7f71a7d50, proute=proute@entry=0x55f7f710a720, dispatch=dispatch@entry=0x55f7f710a778, partRelInfo=partRelInfo@entry=0x55f7f710eb20, partidx=partidx@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