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 1osm11-0001Yh-Lo for pgsql-admin@arkaria.postgresql.org; Wed, 09 Nov 2022 14:25:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1osm10-0007jQ-4M for pgsql-admin@arkaria.postgresql.org; Wed, 09 Nov 2022 14:25:18 +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 1osm0z-0007jH-OG for pgsql-admin@lists.postgresql.org; Wed, 09 Nov 2022 14:25:17 +0000 Received: from mail-wm1-x331.google.com ([2a00:1450:4864:20::331]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1osm0v-0005jL-HE for pgsql-admin@lists.postgresql.org; Wed, 09 Nov 2022 14:25:17 +0000 Received: by mail-wm1-x331.google.com with SMTP id p13-20020a05600c468d00b003cf8859ed1bso1407328wmo.1 for ; Wed, 09 Nov 2022 06:25:13 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=content-transfer-encoding:mime-version:message-id:subject:to:from :date:from:to:cc:subject:date:message-id:reply-to; bh=ZYJj0evT8H2VG8ODY/DFBkZevo89tMOhZ7EstAukuqU=; b=QUqkwf0ER60VCEb6bctC8x8M7KNuYw0WqxFd0AaSU7PChxgkhtfsvDKaeAIEWswbqm 9Gz1VNYRECFJLEOQG9SMXz+lzirNGfJQqO//PI5LC+a4Ufw9jTBSYs49/P1ZRSDL6+Xx oGxW64SjOqUix7biE55y/ycnn2H4J5cj2I406jsPXD+NbwQFd3+QcYoNYtjw05xqIzu6 SHRmg7n1GlXsnYM8Rl+QUv5E37hgIUPwHJLOZV1b5zX+n5JBQfp6hgkCc2gIRfglQ72b p4YEo60Wfw2MQN5FMiCbQG7WnmBAnpsfvKcXxtyVPAvDTrXRy1RgLY6MFEsGE+GlEy39 m0hw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=content-transfer-encoding:mime-version:message-id:subject:to:from :date:x-gm-message-state:from:to:cc:subject:date:message-id:reply-to; bh=ZYJj0evT8H2VG8ODY/DFBkZevo89tMOhZ7EstAukuqU=; b=s5A4SnNeIjWm/GIwgEUF66hjJiZVqEeBzu9aJjuIjMulbxbzU/qXpiVYmSc86qsLgo k3WBgsTkGApNVQyyGDlcA5ZrLyyUf9TSArH+EZZWLXIgGKy31cs+JupRv8Noa0diaXLT znC8bNwQvDZIcX74+NIXvS3nmETSZlxJVxnohvMksI1X0lotfKGH+cCqtfKS6PJ5gLRn ciGAHqvDfMLOTHxaaf7Ndgo4I4Kw7lqBoCYe2ioroDrSEE6PfQ2+/JtSg9aTNC0UYogz HXa4L+XsSDkk6IUbVgyKC9OIGxkbFri6dhUBF3KY0EYKYQKi90MkVU7DLdIqmtNzlIGF 9QGw== X-Gm-Message-State: ANoB5plmrZbyHz66kVzE7E5uO4BcwwMsMHRLaqC1TaxK9pDxeDIv5xTb miBcRIgjg6kp7iI2POlIuDwPb+76uNI= X-Google-Smtp-Source: AA0mqf6BaDPdEiIBwLB2VzpiIzaxCvKc8k29am6LhWPNHAtulPWkXH8KFx/DMFMT7RuVs4pPqkzOrg== X-Received: by 2002:a7b:c046:0:b0:3cf:ab98:d3cd with SMTP id u6-20020a7bc046000000b003cfab98d3cdmr10685703wmc.34.1668003911751; Wed, 09 Nov 2022 06:25:11 -0800 (PST) Received: from z600.home.lan ([195.213.130.125]) by smtp.gmail.com with ESMTPSA id i22-20020a05600c355600b003cf894c05e4sm2047526wmq.22.2022.11.09.06.25.10 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 09 Nov 2022 06:25:11 -0800 (PST) Date: Wed, 9 Nov 2022 14:25:10 +0000 From: Sad Clouds To: pgsql-admin@lists.postgresql.org Subject: pg_upgrade questions Message-Id: <20221109142510.2b528bd331c5d9482c59291d@gmail.com> X-Mailer: Sylpheed 3.7.0 (GTK+ 2.24.32; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hello, I would like to ask a few questions about pg_upgrade when using --link option to avoid copying data files. 1. After running pg_upgrade but before starting new cluster, is it 100% safe to abort and go back to using the old cluster? For example: /usr/PostgreSQL/15/bin/pg_upgrade --link \ --old-datadir "/data/pgdb" \ --new-datadir "/data/pgdb.new" \ --old-bindir "/usr/PostgreSQL/9.6/bin" \ --new-bindir "/usr/PostgreSQL/15/bin" Upgrade succeeds but before I start the new cluster, I change my mind and want to revert to using the old cluster. Can I simply revert to using PostgreSQL 9.6 with these commands: rm -rf /data/pgdb.new mv /data/pgdb/global/pg_control.old /data/pgdb/global/pg_control Am I correct in thinking that apart from pg_control file, "pg_upgrade --link" does not modify the old cluster files in any incompatible ways? 2. Older pg_upgrade binary did not support --jobs argument. When upgrading from such older clusters, running the latest "pg_upgrade --jobs=N" fails at the very start. Is this expected? 3. I'm a bit confused about the correct procedure when it comes to upgrading primary and standby clusters. Looking at https://www.postgresql.org/docs/current/pgupgrade.html it mentions the following: "If you are upgrading standby servers using methods outlined in section Step 11, verify that the old standby servers are caught up by running pg_controldata against the old primary and standby clusters. Verify that the “Latest checkpoint location” values match in all clusters. (There will be a mismatch if old standby servers were shut down before the old primary or if the old standby servers are still running.) Also, make sure wal_level is not set to minimal in the postgresql.conf file on the new primary cluster." Does this mean pg_upgrade will not work on standby if it is out of sync with the primary? The page also talks about using rsync to copy data from primary to standby server. I would like to avoid doing large data copy. Are these upgrade steps likely to work: a) Disable replication temporary. b) Stop standby server and run pg_upgrade. c) Stop primary server and run pg_upgrade. d) Enable replication and start primary and standby and allow them to synchronize their data. Thanks.