pg.ddx.io  pgsql-hackers@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Pryzby <pryzby@telsasoft.com>
To: Andrew Dunstan <andrew@dunslane.net>
Cc: Bruce Momjian <bruce@momjian.us>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: pgsql-hackers@lists.postgresql.org
Subject: Re: pg_upgrade should truncate/remove its logs before running
Date: Wed, 15 Dec 2021 16:13:10 -0600
Message-ID: <20211215221310.GU17618@telsasoft.com> (raw)
In-Reply-To: <a89d6602-0fad-c6cc-10cc-20105c4c01ad@dunslane.net>
References: <20211212025017.GN17618@telsasoft.com>
	<20211215210916.GC4440@momjian.us>
	<711370.1639603043@sss.pgh.pa.us>
	<20211215212343.GE4440@momjian.us>
	<a89d6602-0fad-c6cc-10cc-20105c4c01ad@dunslane.net>

On Wed, Dec 15, 2021 at 05:04:54PM -0500, Andrew Dunstan wrote:
> On 12/15/21 16:23, Bruce Momjian wrote:
> > On Wed, Dec 15, 2021 at 04:17:23PM -0500, Tom Lane wrote:
> >> 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.
> > 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?
> 
> The directory name needs to be predictable somehow, or maybe optionally
> set as a parameter. Having just a timestamped directory name would make
> life annoying for a poor buildfarm maintainer. Also, please don't change
> anything before I have a chance to adjust the buildfarm code to what is
> going to be done.

Feel free to suggest the desirable behavior.
It could write to pg_upgrade.log/* and refuse to run if the dir already exists.

-- 
Justin





view thread (53+ messages)  latest in thread

Message-ID: <20211215221310.GU17618@telsasoft.com>
Permalink:  ../20211215221310.GU17618@telsasoft.com/
Also on:    postgresql.org/message-id/20211215221310.GU17618@telsasoft.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-hackers@postgresql.org
  Cc: pryzby@telsasoft.com, andrew@dunslane.net, bruce@momjian.us, tgl@sss.pgh.pa.us, pgsql-hackers@lists.postgresql.org
  Subject: Re: pg_upgrade should truncate/remove its logs before running
  In-Reply-To: <20211215221310.GU17618@telsasoft.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox