Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxbkb-0005Px-8t for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Dec 2021 21:23:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxbka-0002tV-5k for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Dec 2021 21:23:48 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxbkZ-0002tM-Si for pgsql-hackers@lists.postgresql.org; Wed, 15 Dec 2021 21:23:47 +0000 Received: from momjian.us ([72.94.173.45]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxbkX-0005Hq-DA for pgsql-hackers@lists.postgresql.org; Wed, 15 Dec 2021 21:23:46 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1mxbkV-0005Fd-VV; Wed, 15 Dec 2021 16:23:43 -0500 Date: Wed, 15 Dec 2021 16:23:43 -0500 From: Bruce Momjian To: Tom Lane Cc: Justin Pryzby , pgsql-hackers@lists.postgresql.org Subject: Re: pg_upgrade should truncate/remove its logs before running Message-ID: <20211215212343.GE4440@momjian.us> References: <20211212025017.GN17618@telsasoft.com> <20211215210916.GC4440@momjian.us> <711370.1639603043@sss.pgh.pa.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <711370.1639603043@sss.pgh.pa.us> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Wed, Dec 15, 2021 at 04:17:23PM -0500, Tom Lane wrote: > Bruce Momjian 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 https://momjian.us EDB https://enterprisedb.com If only the physical world exists, free will is an illusion.