Re: WAL segment file descriptor leak on read errors can PANIC the server

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Bertrand Drouvot <bertranddrouvot(dot)pg(at)gmail(dot)com>
Cc: Bharath Rupireddy <bharath(dot)rupireddyforpostgres(at)gmail(dot)com>, Sami Imseih <samimseih(dot)pg(at)gmail(dot)com>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: WAL segment file descriptor leak on read errors can PANIC the server
Date: 2026-10-09 05:00:34
Message-ID: ash08lX0X2n67_-5@paquier.xyz
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message shihao zhong 2026-10-09 05:01:39 Re: pg_resetwal: add --cluster-state option
Previous Message Bharath Rupireddy 2026-10-09 04:57:30 Re: Be strict when request to flush past end of WAL in WaitXLogInsertionsToFinish