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 1n2Eu6-0003SN-Nq for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Dec 2021 16:00:46 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1n2Eu5-0008Je-4C for pgsql-bugs@arkaria.postgresql.org; Tue, 28 Dec 2021 16:00:45 +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 1n2Eu4-0008JU-SM for pgsql-bugs@lists.postgresql.org; Tue, 28 Dec 2021 16:00:44 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1n2Ety-0007sk-Ks for pgsql-bugs@lists.postgresql.org; Tue, 28 Dec 2021 16:00:43 +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 1BSG0Zv31760675; Tue, 28 Dec 2021 11:00:35 -0500 From: Tom Lane To: mathiaskunter@gmail.com cc: pgsql-bugs@lists.postgresql.org Subject: Re: BUG #17347: pg_upgrade: analyze_new_cluster script analyzes wrong cluster In-reply-to: <17347-27b988f51d9dee1a@postgresql.org> References: <17347-27b988f51d9dee1a@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Tue, 28 Dec 2021 09:47:42 +0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1760673.1640707235.1@sss.pgh.pa.us> Date: Tue, 28 Dec 2021 11:00:35 -0500 Message-ID: <1760674.1640707235@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form writes: > When upgrading a PostgreSQL cluster with pg_upgrade (tested while upgrading > from 11.14 to 12.9, but supposedly affects all versions), and the --new-port > argument is used to specify a new port number for the upgraded cluster, then > the generated analyze_new_cluster script will connect to and analyze a > different cluster instead of the upgraded one. > The vacuumdb command found within the analyze_new_cluster script should > explicitly specify the port number of the upgraded cluster, so that it will > actually analyze the correct cluster after the upgrade. Hmm. I'm not sure whether changing that would be an improvement. The assumption you're making is that --new-port will be the new cluster's port number after it's started for real. But it seems at least as likely that it's just a nonce specification used for long enough to finish sucking data out of your old cluster, and then you'll start the new server in place of your old one (ie using the old port). It's a bit moot now anyway, since pg_upgrade doesn't create that script anymore in v14 and up. regards, tom lane