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 1n7Uvy-0006YX-9X for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jan 2022 04:08:26 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n7Uvw-0000uh-74 for pgsql-hackers@arkaria.postgresql.org; Wed, 12 Jan 2022 04:08:24 +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 1n7Uvv-0000uY-Qo for pgsql-hackers@lists.postgresql.org; Wed, 12 Jan 2022 04:08:23 +0000 Received: from mail-io1-xd32.google.com ([2607:f8b0:4864:20::d32]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1n7Uvo-0002mo-F3 for pgsql-hackers@lists.postgresql.org; Wed, 12 Jan 2022 04:08:23 +0000 Received: by mail-io1-xd32.google.com with SMTP id 19so1874762ioz.4 for ; Tue, 11 Jan 2022 20:08:16 -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=k+CKE6pslfrVhFWswlIYY4a8IogDy4sdFcoYqQ4cCEA=; b=0GEQaipVNFbo51WhjS/wkEqbadmBHssiiAEoYmSExA0eUEEH9i+73ZP9WpjAuyYpZ1 E49hgRY7bzUfZTRLSViOjaz5b482fOishlXjqHlq50V/SrfGb998xCNhgbkhr525hd25 u1xt/K3tggvKq565skLbhGB/EG6bwoSM6FE0t8LuwtBYMd5gN3Fo67ZFeu3TCkxhm8Nz f97S7KNgRbsePcd6cBoWQ7IuaE8znzI/DkyRePSIqwkm9rbvtuCc3WtIxDTDuFUiJhZm 08DortMWrtyLhzjEFnwqeJkfofImSQUCdHYBEkvLTSSOUCPMqqshLBziMXGNOMQ+CHyD EB7Q== 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=k+CKE6pslfrVhFWswlIYY4a8IogDy4sdFcoYqQ4cCEA=; b=e8EC4cU1u5ubPqxkPh+xA/ZqCJ/NNZGpNN3LJR74pSiY2Rb9nTROg3hZ/CC5hDDjCP ymIEvnyTevcfDyyWW06ory84qE5HXDWL0gTrRbjgSgk9ZOqxauozC5Q+NyB5yQr6vdeE 4E8cDxQSfSs5ePcxAcAvu57TdDBwBtO0tux0sK1TYe4IxmQQ75Z4QzJjtu3EG3NkJ8Q+ jbuFXNLMCl+cls9YmKw21ieGdcobtJeK5+vUnvnVt1/0OTKxDkdt8BKbsnuHwShMBZon siTRyV2udjm5KmMqcBGnxJoDXMJT2nZXsyKW3g9Nq+NQi2rM6suLSG+rjyQYrgZTND3i WHLw== X-Gm-Message-State: AOAM530i8ufJpts+3rZPYKmlJ8pMnJvCjx8TK6kUtTXT5GinWBcVu0ve TFC0d/E8PgXK+QTMvSREAEXKDg== X-Google-Smtp-Source: ABdhPJwj509ItYp3a1a9f2FT6lODJp+1WY+pTx+Hi0GFsjaP4G4h8aLngY8KdKRy2VXLx7vRvdSOKw== X-Received: by 2002:a05:6602:1604:: with SMTP id x4mr3795258iow.114.1641960494574; Tue, 11 Jan 2022 20:08:14 -0800 (PST) Received: from pryzbyj.telsasoft (charmander.telsasoft.com. [50.244.222.1]) by smtp.gmail.com with ESMTPSA id l14sm6865286iln.11.2022.01.11.20.08.13 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 11 Jan 2022 20:08:14 -0800 (PST) Received: by pryzbyj.telsasoft (Postfix, from userid 1000) id 39395800E15; Tue, 11 Jan 2022 22:08:13 -0600 (CST) Date: Tue, 11 Jan 2022 22:08:13 -0600 From: Justin Pryzby To: Michael Paquier Cc: Tom Lane , Daniel Gustafsson , Peter Eisentraut , Andrew Dunstan , Bruce Momjian , pgsql-hackers@lists.postgresql.org Subject: Re: pg_upgrade should truncate/remove its logs before running Message-ID: <20220112040813.GD14051@telsasoft.com> References: <20211217172113.GL17618@telsasoft.com> <20211221033926.GX17618@telsasoft.com> <238201.1640184746@sss.pgh.pa.us> <20211222163611.GC17618@telsasoft.com> <20220108184857.GI14051@telsasoft.com> <20220111200307.GA14051@telsasoft.com> 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, Jan 12, 2022 at 12:59:54PM +0900, Michael Paquier wrote: > On Tue, Jan 11, 2022 at 02:03:07PM -0600, Justin Pryzby wrote: > > There's no reason not to. We created the dir, and the user didn't specify to > > preserve it. It'd be their fault if they put something valuable there after > > starting pg_upgrade. > > This is a path for the data internal to pg_upgrade. My take is that > the code simplifications the new option brings are more valuable than > this assumption, which I guess would unlikely happen. I may be wrong, > of course. By the way, while thinking about that, should we worry > about --logdir="."? I asked about that before. Right now, it'll exit(1) when mkdir fails. I had written a patch to allow "." by skipping mkdir (or allowing it to fail if errno == EEXIST), but it seems like an awfully bad idea to try to make that work with rmtree(). -- Justin