Re: hyrax vs. RelationBuildPartitionDesc

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andres Freund <andres(at)anarazel(dot)de>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, amul sul <sulamul(at)gmail(dot)com>
Subject: Re: hyrax vs. RelationBuildPartitionDesc
Date: 2019-06-04 12:25:32
Message-ID: CA+TgmoZjwB2kRvDz56PWDjApy5Jkt5SEywwYUn9uSQP2hAd+Ww@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Fri, May 17, 2019 at 4:36 PM Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Yeah, I did some additional testing that showed that it's pretty darn
> hard to get the leak to amount to anything. The test case that I
> originally posted did many DDLs in a single transaction, and it
> seems that that's actually essential to get a meaningful leak; as
> soon as you exit the transaction the leaked contexts will be recovered
> during sinval cleanup.

My colleague Amul Sul rediscovered this same leak when he tried to
attach lots of partitions to an existing partitioned table, all in the
course of a single transaction. This seems a little less artificial
than Tom's original reproducer, which involved attaching and detaching
the same partition repeatedly.

Here is a patch that tries to fix this, along the lines I previously
suggested; Amul reports that it does work for him. I am OK to hold
this for v13 if that's what people want, but I think it might be
smarter to commit it to v12. Maybe it's not a big leak, but it seems
easy enough to do better, so I think we should.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

Attachment Content-Type Size
pdoldcxt-v1.patch application/octet-stream 3.9 KB

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2019-06-04 12:43:44 Re: Avoiding hash join batch explosions with extreme skew and weird stats
Previous Message Amit Khandekar 2019-06-04 10:21:01 Re: Minimal logical decoding on standbys