Re: pg_upgrade should truncate/remove its logs before running - Mailing list pgsql-hackers

From Tom Lane
Subject Re: pg_upgrade should truncate/remove its logs before running
Date
Msg-id 711370.1639603043@sss.pgh.pa.us
Whole thread Raw
In response to Re: pg_upgrade should truncate/remove its logs before running  (Bruce Momjian <bruce@momjian.us>)
List pgsql-hackers
Bruce Momjian <bruce@momjian.us> writes:
> On Sat, Dec 11, 2021 at 08:50:17PM -0600, Justin Pryzby wrote:
>> If pg_upgrade fails and is re-run, it appends to its logfiles, which is
>> confusing since, if it fails again, it then looks like the original error
>> recurred and wasn't fixed.  The "append" behavior dates back to 717f6d608.

> Uh, the database server doesn't erase its logs on crash/failure, so why
> should pg_upgrade do that?

The server emits enough information so that it's not confusing:
there are timestamps, and there's an identifiable startup line.
pg_upgrade does neither.  If you don't want to truncate as
Justin suggests, you should do that instead.

Personally I like the idea of making a timestamped subdirectory
and dropping all the files in that, because the thing that most
annoys *me* about pg_upgrade is the litter it leaves behind in
$CWD.  A subdirectory would make it far easier to mop up the mess.

            regards, tom lane



pgsql-hackers by date:

Previous
From: Justin Pryzby
Date:
Subject: Re: pg_upgrade should truncate/remove its logs before running
Next
From: Andrew Dunstan
Date:
Subject: Re: SQL/JSON: functions