Re: adding partitioned tables to publications

From: Mark Zhao <875941708(at)qq(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>, Amit Langote <amitlangote09(at)gmail(dot)com>, Petr Jelinek <petr(at)2ndquadrant(dot)com>, Rafia Sabih <rafia(dot)pghackers(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: adding partitioned tables to publications
Date: 2021-01-11 12:03:34
Message-ID: tencent_BC6941FB423FC8AB628371AD53FA0B1F4905@qq.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Thanks for your reply. The patch is exactly what I want.
My English name is Mark Zhao, which should be the current email name.

Thanks,
Mark Zhao

------------------&nbsp;Original&nbsp;------------------
From: &nbsp;"Amit Kapila";<amit(dot)kapila16(at)gmail(dot)com&gt;;
Send time:&nbsp;Monday, Jan 11, 2021 8:12 PM
To:&nbsp;"赵锐"<875941708(at)qq(dot)com&gt;;
Cc:&nbsp;"Peter Eisentraut"<peter(dot)eisentraut(at)2ndquadrant(dot)com&gt;; "Amit Langote"<amitlangote09(at)gmail(dot)com&gt;; "Petr Jelinek"<petr(at)2ndquadrant(dot)com&gt;; "Rafia Sabih"<rafia(dot)pghackers(at)gmail(dot)com&gt;; "PostgreSQL-development"<pgsql-hackers(at)postgresql(dot)org&gt;;
Subject: &nbsp;Re: adding partitioned tables to publications

On Wed, Dec 30, 2020 at 8:03 PM 赵锐 <875941708(at)qq(dot)com&gt; wrote:
&gt;
&gt; The first file of Amit's patch can not only re-range the code, but also fix a hidden bug.
&gt; To make it easy to see, I attach another patch.
&gt; "RelationIdGetRelation" will increase ref on owner-&gt;relrefarr, without "RelationClose", the owner-&gt;relrefarr will enlarge and re-hash.
&gt; When the capacity of owner-&gt;relrefarr is over than 10 million, enlarge and re-hash takes serial hours. And what's worse, increase ref will also take minutes, as the hash collision resolution is based on looking up an array in order.
&gt; When we want to publish 10 billion data under one partition table, it takes serial days up to increase ref, enlarge and re-hash, and CPU is always 99%.
&gt; After applying my patch, 10 billion will be published in 10 minutes.
&gt;

It is a clear relation descriptor leak. The proposed fix seems correct
to me. The patch wasn't getting applied to HEAD. So, I have prepared
the separate patches for HEAD and 13. There are minor modifications in
the patch like I have used RelationIsValid before closing the
relation. I have not added any test because I see that there is
already a test in src/test/subscription/t/013_partition.

Kindly let me know your English name so that I can give you credit as
a co-author?

--
With Regards,
Amit Kapila.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message 曾文旌 2021-01-11 13:00:45 Re: Proposal: Global Index
Previous Message Tang, Haiying 2021-01-11 11:59:13 RE: [POC] Fast COPY FROM command for the table with foreign partitions