Re: pg_upgrade should truncate/remove its logs before running

From: Justin Pryzby <pryzby(at)telsasoft(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Daniel Gustafsson <daniel(at)yesql(dot)se>, Peter Eisentraut <peter(dot)eisentraut(at)enterprisedb(dot)com>, Andrew Dunstan <andrew(at)dunslane(dot)net>, Bruce Momjian <bruce(at)momjian(dot)us>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgrade should truncate/remove its logs before running
Date: 2022-01-12 04:08:13
Message-ID: 20220112040813.GD14051@telsasoft.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Jan 12, 2022 at 12:59:54PM +0900, Michael Paquier wrote:
> On Tue, Jan 11, 2022 at 02:03:07PM -0600, Justin Pryzby wrote:
> > There's no reason not to. We created the dir, and the user didn't specify to
> > preserve it. It'd be their fault if they put something valuable there after
> > starting pg_upgrade.
>
> This is a path for the data internal to pg_upgrade. My take is that
> the code simplifications the new option brings are more valuable than
> this assumption, which I guess would unlikely happen. I may be wrong,
> of course. By the way, while thinking about that, should we worry
> about --logdir="."?

I asked about that before. Right now, it'll exit(1) when mkdir fails.

I had written a patch to allow "." by skipping mkdir (or allowing it to fail if
errno == EEXIST), but it seems like an awfully bad idea to try to make that
work with rmtree().

--
Justin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Justin Pryzby 2022-01-12 04:09:07 Re: pg_dump/restore --no-tableam
Previous Message Michael Paquier 2022-01-12 03:59:54 Re: pg_upgrade should truncate/remove its logs before running