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 1qEwY3-0001Vt-Rd for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 18:39: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 1qEwY2-00031b-Nr for pgsql-hackers@arkaria.postgresql.org; Thu, 29 Jun 2023 18:39: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 1qEwY2-00031S-ES for pgsql-hackers@lists.postgresql.org; Thu, 29 Jun 2023 18:39:18 +0000 Received: from mail-lf1-x12e.google.com ([2a00:1450:4864:20::12e]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1qEwXv-001DdI-5d for pgsql-hackers@postgresql.org; Thu, 29 Jun 2023 18:39:17 +0000 Received: by mail-lf1-x12e.google.com with SMTP id 2adb3069b0e04-4fb7589b187so1662429e87.1 for ; Thu, 29 Jun 2023 11:39:11 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20221208; t=1688063950; x=1690655950; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=tv8ldL5gqeoGDtfldb3hLyOxX0fXLfkKdeCYA3PiPWg=; b=FKNBrLshTkepu0/L4PMDtEgW3zIN7sygfFpcKoDJYKVV2Kpc/bhFgOf0E3IE8srg18 bcri8A1mB7m9YQeECplN3LXrB/a1xb5yZtc7OmBYGfAiIzhcb7OArUs6cCZ8HVE9uTOf n6725E2pJ9dKDOfHs3g5Du+qghXl/0WO0ml1EMr0aXJ5eP6Q+CCMIQe74Ok5ObUFoCYT m6sN2+m82lvagP5U/2Jm01KluS2RXX2/Okp8NBXCRSh8RUukvDq6jB8px/SVAt8NhwRF eBwGAmVmt+Rm4cT7EuMinFy1hHu83t3tACIDtePtQEa+nFmsQSnWpFkQfijnS8hBzlN0 rq3w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20221208; t=1688063950; x=1690655950; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=tv8ldL5gqeoGDtfldb3hLyOxX0fXLfkKdeCYA3PiPWg=; b=JMR5HFf7h4oXDzO/AUx90R6XfVZLnV6RR20Y6K2Y/z1BRJycbrrXTDGPpygodvbA3i mnNv0E0aKGe9v29BHYNDDuixFyE9BvZRZAlzaERdwK9yA/naYRUvuFMEjOKxfeLip9pl o/f5RuEBQk3RM5bwCsxioml+aUXNmUKe87LF1TC09hOKpYEA2a8Aa8LJpuKB6FEYhqup yJ/mh05t3vTIpkbFlPr8AjcV7dWQDX9nh90VN8chsWHSJlZa3aKz66vuAjvKyZ3KA0Hv FjVlhLlRYr/SJAA09ewXuPlXQg5HUd43Dl3mdu2GN7bGlf+f2yCxpn3F4EDxY0uVIxbm Xvtg== X-Gm-Message-State: ABy/qLaJRiy0abn+u2AQSlm0I4F/5vhcECajqi72x4CR5Grn+IbCFc0K DrZXZUK66dF5m0MUCwLfjGBkAxQXg11qVAVK9qo= X-Google-Smtp-Source: APBJJlEVWMdWY0wRUMYwQrbLWOwBOjfTaM+UHK04b1i7YbF8Bfn/5p18pBnEPC3A6rhDs0ux5GOOMAyNBbRUIJiMIOU= X-Received: by 2002:a05:6512:e94:b0:4fb:8de9:ac0e with SMTP id bi20-20020a0565120e9400b004fb8de9ac0emr673843lfb.1.1688063949962; Thu, 29 Jun 2023 11:39:09 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Robert Haas Date: Thu, 29 Jun 2023 14:38:58 -0400 Message-ID: Subject: Re: pg_upgrade instructions involving "rsync --size-only" might lead to standby corruption? To: Nikolay Samokhvalov Cc: pgsql-hackers@postgresql.org Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jun 29, 2023 at 1:50=E2=80=AFPM Nikolay Samokhvalov wrote: > Does this make sense or I'm missing something and the current docs descri= be a reliable process? (As I said, we have deviated from the process, to in= volve logical replication, so I'm not 100% sure I'm right suspecting the or= iginal procedure in having standby corruption risks.) I'm very suspicious about this section of the documentation. It doesn't explain why --size-only is used or why --no-inc-recursive is used. > > 9. Prepare for standby server upgrades > > 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_co= ntroldata against the old primary and standby clusters. Verify that the =E2= =80=9CLatest checkpoint location=E2=80=9D values match in all clusters. (Th= ere 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 prim= ary cluster. > > =E2=80=93 admitting that there might be mismatch. But if there is mismatc= h, rsync --size-only is not going to help synchronize properly, right? I think the idea is that you shouldn't use the procedure in this case. But honestly I don't think it's probably a good idea to use this procedure at all. It's not clear enough under what circumstances, if any, it's safe to use, and there's not really any way to know if you've done it correctly. You couldn't pay me enough to recommend this procedure to anyone. --=20 Robert Haas EDB: http://www.enterprisedb.com