Re: pg_rewind fails if there is a read only file.

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: Andrew Dunstan <andrew(at)dunslane(dot)net>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Laurenz Albe <laurenz(dot)albe(at)cybertec(dot)at>, Paul Guo <paulguo(at)gmail(dot)com>, pgsql-hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pg_rewind fails if there is a read only file.
Date: 2021-05-25 23:57:06
Message-ID: YK2O0h83FFBUnF+s@paquier.xyz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 25, 2021 at 03:17:37PM -0400, Andrew Dunstan wrote:
> If we do decide to do something the question arises what should it do?
> If we're to allow for it I'm wondering if the best thing would be simply
> to ignore such a file.

Enforcing assumptions that any file could be ready-only is a very bad
idea, as that could lead to weird behaviors if a FS is turned as
becoming read-only suddenly while doing a rewind. Another idea that
has popped out across the years was to add an option to pg_rewind so
as users could filter files manually. That could be easily dangerous
though in the wrong hands, as one could think that it is a good idea
to skip a control file, for example.

The thing is that here we actually know the set of files we'd like to
ignore most of the time, and we still want to have some automated
control what gets filtered. So here is a new idea: we build a list of
files based on a set of GUC parameters using postgres -C on the target
data folder, and assume that these are safe enough to be skipped all
the time, if these are in the data folder.
--
Michael

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Stephen Frost 2021-05-25 23:58:11 Re: storing an explicit nonce
Previous Message Andres Freund 2021-05-25 23:56:44 Re: storing an explicit nonce