Re: Add pg_file_sync() to adminpack

From: Julien Rouhaud <rjuju123(at)gmail(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Fujii Masao <masao(dot)fujii(at)gmail(dot)com>, Arthur Zakirov <zaartur(at)gmail(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add pg_file_sync() to adminpack
Date: 2020-01-14 06:26:07
Message-ID: CAOBaU_atTPgkes5fKxFvba5HmQKt3zuY58sDZCaGiOBPn3yx=w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 14, 2020 at 7:18 AM Michael Paquier <michael(at)paquier(dot)xyz> wrote:
>
> On Mon, Jan 13, 2020 at 03:39:32PM +0100, Julien Rouhaud wrote:
> > Actually, can't it create a security hazard, for instance if you call
> > pg_file_sync() on a heap file and the calls errors out, since it's
> > bypassing data_sync_retry?
>
> Are you mistaking security with durability here?

Yes, data durability sorry.

> By default, the
> function proposed is only executable by a superuser, so that's not
> really a security concern.. But I agree that failing to detect a
> PANIC on a fsync for a sensitive Postgres file could lead to
> corruptions. That's why we PANIC these days.

Exactly. My concern is that some superuser may not be aware that
pg_file_sync could actually corrupt data, so there should be a big red
warning explaining that.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Masahiko Sawada 2020-01-14 06:32:39 Re: base backup client as auxiliary backend process
Previous Message Michael Paquier 2020-01-14 06:17:56 Re: Add pg_file_sync() to adminpack