Re: pgsql: Avoid creation of the free space map for small heaprelations, t - Mailing list pgsql-hackers

From Amit Kapila
Subject Re: pgsql: Avoid creation of the free space map for small heaprelations, t
Date
Msg-id CAA4eK1LH3AeHc+DvrYUUq6jMokaSg5MrHZ8o54qT3jUgZZc15g@mail.gmail.com
Whole thread Raw
In response to Re: pgsql: Avoid creation of the free space map for small heaprelations, t  (Amit Kapila <amit.kapila16@gmail.com>)
Responses Re: pgsql: Avoid creation of the free space map for small heaprelations, t
List pgsql-hackers
On Tue, Feb 26, 2019 at 2:58 PM Amit Kapila <amit.kapila16@gmail.com> wrote:
>
> On Mon, Feb 25, 2019 at 10:32 PM Tom Lane <tgl@sss.pgh.pa.us> wrote:
> >
>
> To fix this symptom, we can ensure that once we didn't get any block
> from local map, we must clear it.  See the attached patch.  I will try
> to evaluate this code path to see if there is any similar race
> condition and will also try to generate a reproducer.  I don't have
> any great idea to write a reproducer for this issue apart from trying
> some thing similar to ecpg/test/thread/prep.pgc, if you can think of
> any, I am all ears.
>

I have tried this test many times (more than 1000 times) by varying
thread count, but couldn't reproduce it.  My colleague, Kuntal has
tried a similar test overnight, but the issue didn't reproduce which
is not surprising to me seeing the nature of the problem.  As I could
reproduce it via the debugger, I think we can go ahead with the fix.
I have improved the comments in the attached patch and I have also
tried to address Tom's concern w.r.t comments by adding additional
comments atop of data-structure used to maintain the local map.

Let me know what you think?

-- 
With Regards,
Amit Kapila.
EnterpriseDB: http://www.enterprisedb.com

Attachment

pgsql-hackers by date:

Previous
From: Amit Langote
Date:
Subject: Re: Problem with default partition pruning
Next
From: "Nagaura, Ryohei"
Date:
Subject: RE: Timeout parameters