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 1mxcWT-0001iJ-Fy for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Dec 2021 22:13:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mxcWS-0006T6-BW for pgsql-hackers@arkaria.postgresql.org; Wed, 15 Dec 2021 22:13:16 +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 1mxcWR-0006Sx-Tv for pgsql-hackers@lists.postgresql.org; Wed, 15 Dec 2021 22:13:16 +0000 Received: from mail-il1-x12d.google.com ([2607:f8b0:4864:20::12d]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1mxcWP-0003Zu-O9 for pgsql-hackers@lists.postgresql.org; Wed, 15 Dec 2021 22:13:15 +0000 Received: by mail-il1-x12d.google.com with SMTP id s11so20558591ilv.3 for ; Wed, 15 Dec 2021 14:13:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=telsasoft-com.20210112.gappssmtp.com; s=20210112; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=QVAg9l4HAYOr2qtRgjqYlz5wI/xctXXt3WS1AvoYnrk=; b=4zBM9RRzTB4QsxIAS3m9PkJgwXuDz2VsdGkoYrlGh70yveaw9BieZb9MGLrRSfFHSS 691IniLzKGdf0vHeNpi4hLcnONo9EI80uXSUgT1+2um7+SYHNeKWm1GrLF1928C7b0My t0BvRVJPvJQD1BqYWo1fHj/I8//44k/ychHuRPHjZL4GdYq3g/zHRI3fcPnltcFxiV4a ndArDf0NaNpEELrZAHnAQOGyFdBSR6ZL49M3wR+nfWjL/8vXFBqHk3JUWrG+sQT0X9PY h88RoRoJcBpF5h5iUwD9DJetS2/ZUB7D4g/3mgig0Gkw7B45upoR68y+x32xbyyzoqvH G1kg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=QVAg9l4HAYOr2qtRgjqYlz5wI/xctXXt3WS1AvoYnrk=; b=HTSIHH9icsGnvpUlDyueA12njzn+myEHlePrt3VyIMYu7crNEUs6Yjq5W7SQSXFhzS YqouqQhf3c17louDgrYOpDYXnNXhMYkKID69lHAZvE08i2MRSg/R60YIXz6TLMRPGTDK Ull9etzNcF6v/bs5NcWiVPmF4uoaZfnHmctmqEK/BiwjtiY1N31spgXAB3xu9fFOZHyF Cf+7Ya47SPob6tTiBRo2FzK+TTbjZSkgw9cnN1g2Yyr+Ff+pvMfybf1rTjUeC5RDx+1x aY0jOvDvYM1vbWk92LFrmZMnWZrxSiIPNoc0jLD6EycEPJ9fKV3Qg8mLoDAtRTaaRfcN HzOA== X-Gm-Message-State: AOAM5321bqPs9cI035wBgOt2OvjbP+6jIIxElAA0NMKiOMPJCsd4JOUf yEAIPu8fv7pmqjMAa6UxjZG84g== X-Google-Smtp-Source: ABdhPJwBR+ljHtMEPz4rmBANPSnN6T+eUTUeHZGdrtXqKzyj90X3r+itVqjVKqRlgJ7w/Z+y3PxYNA== X-Received: by 2002:a05:6e02:1906:: with SMTP id w6mr7948150ilu.192.1639606391889; Wed, 15 Dec 2021 14:13:11 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id u13sm1144658ill.39.2021.12.15.14.13.11 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Wed, 15 Dec 2021 14:13:11 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id B3C8B800827; Wed, 15 Dec 2021 16:13:10 -0600 (CST) Date: Wed, 15 Dec 2021 16:13:10 -0600 From: Justin Pryzby To: Andrew Dunstan Cc: Bruce Momjian , Tom Lane , pgsql-hackers@lists.postgresql.org Subject: Re: pg_upgrade should truncate/remove its logs before running Message-ID: <20211215221310.GU17618@telsasoft.com> References: <20211212025017.GN17618@telsasoft.com> <20211215210916.GC4440@momjian.us> <711370.1639603043@sss.pgh.pa.us> <20211215212343.GE4440@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 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