Re: replay of CREATE TABLESPACE eats data at wal_level=minimal - Mailing list pgsql-hackers

From Robert Haas
Subject Re: replay of CREATE TABLESPACE eats data at wal_level=minimal
Date
Msg-id CA+TgmobkXKzLe9QDWowUS_3uyDLK+p6dA99D1pYkOqWhQaaSKw@mail.gmail.com
Whole thread Raw
In response to Re: replay of CREATE TABLESPACE eats data at wal_level=minimal  (Noah Misch <noah@leadboat.com>)
Responses Re: replay of CREATE TABLESPACE eats data at wal_level=minimal  (Noah Misch <noah@leadboat.com>)
List pgsql-hackers
On Sun, Aug 22, 2021 at 6:59 PM Noah Misch <noah@leadboat.com> wrote:
> Here's what I plan to push.  Besides adding a test, I modified things so
> CREATE TABLESPACE redo continues to report an error if a non-directory exists
> under the name we seek to create.  One could argue against covering that
> corner case, but TablespaceCreateDbspace() does cover it.

By and large, LGTM, though perhaps it would be appropriate to also
credit me as the reporter of the issue.

I feel it might be slightly better to highlight somewhere, either in
the commit message or in the comments, that removing the old directory
is unsafe, because if wal_level=minimal, we may have no other copy of
the data. For me that's the key point here. I feel that the commit
message and comments inside the patch explain rather thoroughly the
possible consequences of the bug and why this particular fix was
chosen, but they're not real explicit about why there was a bug at
all.

Thanks very much for working on this.

-- 
Robert Haas
EDB: http://www.enterprisedb.com



pgsql-hackers by date:

Previous
From: Amit Kapila
Date:
Subject: Re: [BUG] wrong refresh when ALTER SUBSCRIPTION ADD/DROP PUBLICATION
Next
From: Robert Haas
Date:
Subject: Re: .ready and .done files considered harmful