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

2021-05-27 Thread Paul Guo
On Wed, May 26, 2021 at 10:32 PM Andrew Dunstan wrote: > > > On 5/26/21 2:43 AM, Laurenz Albe wrote: > > On Wed, 2021-05-26 at 08:57 +0900, Michael Paquier wrote: > >> On Tue, May 25, 2021 at 03:17:37PM -0400, Andrew Dunstan wrote: > >>> If we do decide to do something the question arises what sho

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

2021-05-26 Thread Andrew Dunstan
On 5/26/21 2:43 AM, Laurenz Albe wrote: > On Wed, 2021-05-26 at 08:57 +0900, Michael Paquier wrote: >> 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

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

2021-05-25 Thread Laurenz Albe
On Wed, 2021-05-26 at 08:57 +0900, Michael Paquier wrote: > 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 fi

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

2021-05-25 Thread Michael Paquier
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

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

2021-05-25 Thread Andrew Dunstan
On 5/25/21 10:29 AM, Tom Lane wrote: > Andrew Dunstan writes: >> Perhaps we should add that read-only files can be particularly problematic. > Given the (legitimate, IMO) example of a read-only SSL key, I'm not > quite convinced that pg_rewind doesn't need to cope with this. > >

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

2021-05-25 Thread Tom Lane
Andrew Dunstan writes: > Perhaps we should add that read-only files can be particularly problematic. Given the (legitimate, IMO) example of a read-only SSL key, I'm not quite convinced that pg_rewind doesn't need to cope with this. regards, tom lane

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

2021-05-25 Thread Andrew Dunstan
On 5/25/21 9:38 AM, Laurenz Albe wrote: > On Tue, 2021-05-25 at 16:57 +0800, Paul Guo wrote: >>> You seem to have missed my point completely. The answer to this problem >>> IMNSHO is "Don't put a read-only file in the data directory". >> Oh sorry. Well, if we really do not want this we may want t

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

2021-05-25 Thread Laurenz Albe
On Tue, 2021-05-25 at 16:57 +0800, Paul Guo wrote: > > You seem to have missed my point completely. The answer to this problem > > IMNSHO is "Don't put a read-only file in the data directory". > > Oh sorry. Well, if we really do not want this we may want to document this > and keep educating users

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

2021-05-25 Thread Paul Guo
> You seem to have missed my point completely. The answer to this problem > IMNSHO is "Don't put a read-only file in the data directory". Oh sorry. Well, if we really do not want this we may want to document this and keep educating users, but meanwhile probably the product should be more user frie

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

2021-05-20 Thread Andrew Dunstan
On 5/20/21 6:17 AM, Paul Guo wrote: >> Presumably the user has a reason for adding the file read-only to the >> data directory, and we shouldn't lightly ignore that. >> >> Michael's advice is reasonable. This seems like a case of: > I agree. Attached is a short patch to handle the case. The patch

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

2021-05-20 Thread Paul Guo
> Presumably the user has a reason for adding the file read-only to the > data directory, and we shouldn't lightly ignore that. > > Michael's advice is reasonable. This seems like a case of: I agree. Attached is a short patch to handle the case. The patch was tested in my dev environment. v1-000

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

2021-05-19 Thread Andrew Dunstan
On 5/19/21 6:43 AM, Paul Guo wrote: > Several weeks ago I saw this issue in a production environment. The > read only file looks like a credential file. Michael told me that > usually such kinds of files should be better kept in non-pgdata > directories in production environments. Thought further