Re: get_controlfile() can leak fds in the backend

From: Andres Freund <andres(at)anarazel(dot)de>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Michael Paquier <michael(at)paquier(dot)xyz>, Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>, Joe Conway <mail(at)joeconway(dot)com>
Subject: Re: get_controlfile() can leak fds in the backend
Date: 2019-02-27 09:32:31
Message-ID: 20190227093231.ermj4gurayhxiyyo@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi,

On 2019-02-27 10:23:45 +0100, Fabien COELHO wrote:
> However, while at it, there is also the question of whether the control file
> should be locked when updated, eg with flock(2) to avoid race conditions
> between concurrent commands. ISTM that there is currently not such thing in
> the code, but that it would be desirable.

Shouldn't be necessary - the control file fits into a single page, and
writes of that size ought to always be atomic. And I also think
introducing flock usage for this would be quite disproportional.

Greetings,

Andres Freund

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Dmitry Dolgov 2019-02-27 09:36:22 Re: Segfault when restoring -Fd dump on current HEAD
Previous Message Fabien COELHO 2019-02-27 09:23:45 Re: get_controlfile() can leak fds in the backend