Re: logical decoding / rewrite map vs. maxAllocatedDescs

From: Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(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-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: logical decoding / rewrite map vs. maxAllocatedDescs
Date: 2018-08-16 15:07:17
Message-ID: 82d51b43-3b98-38e5-2e37-a8959b13ef49@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 08/11/2018 04:18 PM, Tomas Vondra wrote:
> On 08/11/2018 04:15 PM, Tom Lane wrote:
>> Tomas Vondra <tomas(dot)vondra(at)2ndquadrant(dot)com> writes:
>>>>> On 08/09/2018 07:47 PM, Alvaro Herrera wrote:
>>>>>> Actually, it seems to me that ApplyLogicalMappingFile is just leaking
>>>>>> the file descriptor for no good reason.
>>
>>> I think the fix can be as simple as attached ... I'm mostly afk for the
>>> weekend, so I'll commit & backpatch on Monday or so.
>>
>> LGTM. While you're at it, would you fix the misspelling three lines
>> below this?
>>
>> * Check whether the TransactionOId 'xid' is in the pre-sorted array 'xip'.
>> ^
>
> Sure.
>

I've pushed this, and backpatched it all the way back to 9.4 where
logical decoding was introduced.

While this resolves the way to run out of file descriptors, I wonder if
there are other trivial ways to trigger it (say, long-running
transaction spanning many 'vacuum full pg_class' runs). Not sure, will
try later.

The other question is whether errors are handled correctly - as reported
initially, I've seen this to trigger

ERROR: XX000: subtransaction logged without previous top-level txn record

I assume just fixing the error did not really fix that, so that if
something else fails we might end up in the same state.

regards

--
Tomas Vondra http://www.2ndQuadrant.com
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Jim Mlodgenski 2018-08-16 15:19:49 Re: Problem with OpenSCG downloads
Previous Message Dave Page 2018-08-16 15:00:15 Re: Problem with OpenSCG downloads