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 1mxbeT-0004pt-Pd for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Dec 2021 21:17:29 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxbeS-0003VO-89 for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Dec 2021 21:17:28 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxbeR-0003VF-VM for pgsql-hackers@lists.postgresql.org; Wed, 15 Dec 2021 21:17:27 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mxbeP-0002za-Jf for pgsql-hackers@lists.postgresql.org; Wed, 15 Dec 2021 21:17:27 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 1BFLHNk3711371; Wed, 15 Dec 2021 16:17:23 -0500 From: Tom Lane To: Bruce Momjian cc: Justin Pryzby , pgsql-hackers@lists.postgresql.org Subject: Re: pg_upgrade should truncate/remove its logs before running In-reply-to: <20211215210916.GC4440@momjian.us> References: <20211212025017.GN17618@telsasoft.com> <20211215210916.GC4440@momjian.us> Comments: In-reply-to Bruce Momjian message dated "Wed, 15 Dec 2021 16:09:16 -0500" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <711369.1639603043.1@sss.pgh.pa.us> Date: Wed, 15 Dec 2021 16:17:23 -0500 Message-ID: <711370.1639603043@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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. regards, tom lane