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 1qFI7P-0006xA-LM for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jun 2023 17:41:15 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1qFI7O-0000GP-Hx for pgsql-hackers@arkaria.postgresql.org; Fri, 30 Jun 2023 17:41:14 +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 1qFI7O-0000GG-6q for pgsql-hackers@lists.postgresql.org; Fri, 30 Jun 2023 17:41:14 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1qFI7K-001Ovn-J3 for pgsql-hackers@postgresql.org; Fri, 30 Jun 2023 17:41:13 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=momjian.us; s=2023062407; h=In-Reply-To:Content-Transfer-Encoding:Content-Type: MIME-Version:References:Message-ID:Subject:Cc:To:From:Date:Sender:Reply-To: Content-ID:Content-Description; bh=LMJf0nxloqQPYgvWGdN/Lp+yFfZd3N57WbUlpk5HIhA=; b=nz7EWjjudZ3jMKd0xU7MpW6b1u M4+ouPkGzh4DTEqc83mxM5vuCZT6XOrCKK4LiWBhKV9uGoCz1xbW2aHS3Lgv09R+1tpHa6sYulxN7 NgA73BQPDIgnFRw9S0O2/5H0WUrqwu+J08wRrLcA/2aPZZrvtfMlc1EMM7CV9jZZe3LQ6t4CXJeLg rw8Z2dySumYOj5sMbbop9hR3bl31DSQVvVeozYLLrcVftmjjbMTqSjA0wiRXOzwp9nYO4FDP/5xsI x7E4MVaCuLUC8qrDH2Qa2SHJmtFahTh4k616XCTqfkfj5wkZtvMJI/ioRUpMK+P7Bx5WGk7amr5H9 znrKCPoA==; Received: from bruce by momjian.us with local (Exim 4.94.2) (envelope-from ) id 1qFI7G-000vfR-7w; Fri, 30 Jun 2023 13:41:06 -0400 Date: Fri, 30 Jun 2023 13:41:06 -0400 From: Bruce Momjian To: Robert Haas Cc: Nikolay Samokhvalov , pgsql-hackers@postgresql.org, Stephen Frost Subject: Re: pg_upgrade instructions involving "rsync --size-only" might lead to standby corruption? Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Jun 29, 2023 at 02:38:58PM -0400, Robert Haas wrote: > On Thu, Jun 29, 2023 at 1:50 PM Nikolay Samokhvalov wrote: > > Does this make sense or I'm missing something and the current docs describe a reliable process? (As I said, we have deviated from the process, to involve logical replication, so I'm not 100% sure I'm right suspecting the original 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. I think --size-only was chosen only because it is the minimal comparison option. > > > 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_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. > > > > – admitting that there might be mismatch. But if there is mismatch, 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. I think it would be good to revisit all the steps outlined in that procedure and check which ones are still valid or need adjusting. It is very possible the original steps have bugs or that new Postgres features added since the steps were created don't work with these steps. I think we need to bring Stephen Frost into the discussion, so I have CC'ed him. Frankly, I didn't think the documented procedure would work either, but people say it does, so it is in the docs. I do think it is overdue for a re-analysis. -- Bruce Momjian https://momjian.us EDB https://enterprisedb.com Only you can decide what is important to you.