Re: pg_upgrade should truncate/remove its logs before running

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Justin Pryzby <pryzby(at)telsasoft(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: pg_upgrade should truncate/remove its logs before running
Date: 2021-12-15 21:23:43
Message-ID: 20211215212343.GE4440@momjian.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Wed, Dec 15, 2021 at 04:17:23PM -0500, Tom Lane wrote:
> Bruce Momjian <bruce(at)momjian(dot)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.

Yes, lot of litter. Putting it in a subdirectory makes a lot of sense.
Justin, do you want to work on that patch, since you had an earlier
version to fix this?

--
Bruce Momjian <bruce(at)momjian(dot)us> https://momjian.us
EDB https://enterprisedb.com

If only the physical world exists, free will is an illusion.

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2021-12-15 21:36:26 Re: SQL/JSON: functions
Previous Message Tom Lane 2021-12-15 21:17:23 Re: pg_upgrade should truncate/remove its logs before running