Re: WAL segment file descriptor leak on read errors can PANIC the server - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: WAL segment file descriptor leak on read errors can PANIC the server
Date
Msg-id ash08lX0X2n67_-5@paquier.xyz
Whole thread
In response to Re: WAL segment file descriptor leak on read errors can PANIC the server  (Bertrand Drouvot <bertranddrouvot.pg@gmail.com>)
List pgsql-hackers
On Thu, Oct 08, 2026 at 06:55:23AM +0000, Bertrand Drouvot wrote:
> As mentioned upthread [1], I think XLogReaderFree() should also check whether
> seg.ws_file >= 0.
>
> Please find attached a small patch doing that.

I have been leaving this one out from the main patch on purpose, as it
was unrelated.  As far as I can see it is the only code path in the
core code that uses a non-zero value for a comparison of ws_file.
Done.
--
Michael

Attachment

pgsql-hackers by date:

Previous
From: Bharath Rupireddy
Date:
Subject: Re: Be strict when request to flush past end of WAL in WaitXLogInsertionsToFinish
Next
From: shihao zhong
Date:
Subject: Re: pg_resetwal: add --cluster-state option