Re: Forget close an open relation in ReorderBufferProcessTXN()

From: Japin Li <japinli(at)hotmail(dot)com>
To: Amit Kapila <amit(dot)kapila16(at)gmail(dot)com>
Cc: "pgsql-hackers(at)lists(dot)postgresql(dot)org" <pgsql-hackers(at)lists(dot)postgresql(dot)org>, peter(dot)eisentraut(at)2ndquadrant(dot)com, simon(at)2ndquadrant(dot)com, marco(dot)nenciarini(at)2ndquadrant(dot)it
Subject: Re: Forget close an open relation in ReorderBufferProcessTXN()
Date: 2021-04-17 06:35:20
Message-ID: MEYP282MB166989349E292E47C5B22C8CB64B9@MEYP282MB1669.AUSP282.PROD.OUTLOOK.COM
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


On Sat, 17 Apr 2021 at 14:09, Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
> On Thu, Apr 15, 2021 at 4:53 PM Amit Kapila <amit(dot)kapila16(at)gmail(dot)com> wrote:
>>
>> On Thu, Apr 15, 2021 at 4:00 PM Japin Li <japinli(at)hotmail(dot)com> wrote:
>> >
>> > The RelationIdGetRelation() comment says:
>> >
>> > > Caller should eventually decrement count. (Usually,
>> > > that happens by calling RelationClose().)
>> >
>> > However, it doesn't do it in ReorderBufferProcessTXN().
>> > I think we should close it, here is a patch that fixes it. Thoughts?
>> >
>>
>> +1. Your fix looks correct to me but can we test it in some way?
>>
>
> I have tried to find a test but not able to find one. I have tried
> with a foreign table but we don't log truncate for it, see
> ExecuteTruncate. It has a check that it will log for relids where
> RelationIsLogicallyLogged. If that is the case, it is not clear to me
> how we can ever hit this condition? Have you tried to find the test?

I also don't find a test for this. It is introduced in 5dfd1e5a6696,
wrote by Simon Riggs, Marco Nenciarini and Peter Eisentraut. Maybe they
can explain when we can enter this condition?

--
Regrads,
Japin Li.
ChengDu WenWu Information Technology Co.,Ltd.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2021-04-17 07:13:11 Re: Forget close an open relation in ReorderBufferProcessTXN()
Previous Message Amit Kapila 2021-04-17 06:31:50 Re: Forget close an open relation in ReorderBufferProcessTXN()