Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x13vk-004xVv-1k for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Aug 2026 15:28:16 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x13vj-000yWR-1i for pgsql-hackers@arkaria.postgresql.org; Mon, 31 Aug 2026 15:28:15 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x13vj-000yWJ-0l for pgsql-hackers@lists.postgresql.org; Mon, 31 Aug 2026 15:28:15 +0000 Received: from mail-wr1-x42a.google.com ([2a00:1450:4864:20::42a]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x13vg-00000002DNq-2yIL for pgsql-hackers@lists.postgresql.org; Mon, 31 Aug 2026 15:28:14 +0000 Received: by mail-wr1-x42a.google.com with SMTP id ffacd0b85a97d-48433f36a21so1428066f8f.1 for ; Mon, 31 Aug 2026 08:28:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788190091; x=1788794891; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=ZDgwOKerW3kDXbS2op5eoBpJ31ex7D18sZVsT6D/fZg=; b=I5RPkiCjGqavdtGWrq1myOiHoIUMcfN81DLIihaGQXs8RihupvW2fvJD49kqXOa7fK 0f4M1Sp/aKAJJRLQYFpNXpql7C7JQACJkO2DVnjnRcRy9+0vNvfozaaXbMImep387TtO 7O5cdMgg+5bR366AREPxy6Ql3wAIQULU77Q1EeKC2eycvDmPp+M5U/eSwONmdZFgjSZL 1gBTJD34IDrEEX1+GRrwfrtj7qlw/S0t1xlVcXEHsV5kyY8a9IDPvFrF3iB90Hpr9y0a 3h5CoPXSMfWoF1sUldrNyWPbedGpbFCQB0S686GyJc6U1Co8rcHxZshOiGZH9856NggW mGUw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788190091; x=1788794891; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=ZDgwOKerW3kDXbS2op5eoBpJ31ex7D18sZVsT6D/fZg=; b=htFNDF10C8ZxD8xT9jaDFfFhoFIR1OwmoduC3VDJIcv2rIEUQ0l6F0OvmP3N5jRYRL rkRWFqK95PTmh74TkbrzcoaFtMJHxCWbohaJeVzFLOOA9Qf3nEIKB1XQ8repRswNfWcK c7HxTXqNri0YygFgKfdxS1ebGUg5djprDzQzG76lvqnpuoYoFpZBixZEZfDmAsmP+1fX hxlQoH7LD5ykPyK+1krTrEdHQfcCijb4drP0DoNpFJ9NNVn4Qxew1z5Di5PVCA55IiFW F5fxxCmLiHV0FkJg/So7E0vu78M3SPKaozt0iaF/WX6yHOqdlD/GilM8EmlfqoElyBqC oTpQ== X-Forwarded-Encrypted: i=1; AHgh+Rpv1QgS/mIr0KjdPVpnTd4br/fQWDF6IhVu3jc6lnUO9QTr+q4I0UB4++3HE72bM7EYJGNAxTK5CuShT+8p@lists.postgresql.org X-Gm-Message-State: AFuF++lj9OPFX7k30JHfPnNCsmXsl5FMmBNkTbUOBFHrFkcnySSi5IGb SICvBXFWnShYkIDNcCN7xAdGiDykX0ktKc01pASWi4aoHZ5KKQ4tETRK X-Gm-Gg: AR+sD11SFANk2z+Si2Xi3S/DrO72EYaBc92KEwIkoy8UuGvWw9RFLMTG22csi0dx+2c RmolkxnmV3VMPvvt3gkbinf8MgGgYBk4MtFsQ+FsHd8uaZdFLM+8sawIlaE6Ubi/2ZYHNX0LW2f WukUrfJqA0oYYPR9ktn0dWbjbFTaZKtBKP84yQaZThd1NlrLSMC0yL1H2Rgx395dLzIezfmMyR9 8u7Dg8L97+GTFoQvv30mYXDCGOyrbWOlctM9tpx37fH945QztIe+XmtoTMgD7jGicb4rOg/oGn0 V6cwL/4HnWpepvt3ShOw80UU/Q9JNUKqJHDA3ImYXV1NYJkec+Q53sTS2ZImFzDcQ+OUQ8PqpKS 24RqVr5xyqCtX57ObxQrGubrsolvkmIaoL0jIeUdjkVNbxuBu7r0vCBp1SPBk9MPRBeiVAlzJEL m6MVNaDeX1RJudDjd3HzcXbNSkR4t87az4ovjdEyLYJEmWnAw3jCsUVfb890aIr67q+VXm3ntqK 9Bguv2hwoMOGANOWOrQ6CX9HSd2nDUWZfL0ReAhXfzj2p0l X-Received: by 2002:a05:600c:4f49:b0:495:5d6d:9cc1 with SMTP id 5b1f17b1804b1-49cd52b2c93mr157013415e9.0.1788190091042; Mon, 31 Aug 2026 08:28:11 -0700 (PDT) Received: from bdtpg (ec2-15-237-197-144.eu-west-3.compute.amazonaws.com. [15.237.197.144]) by smtp.gmail.com with ESMTPSA id 5b1f17b1804b1-49cdce0d22dsm135145e9.4.2026.08.31.08.28.10 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 31 Aug 2026 08:28:10 -0700 (PDT) Date: Mon, 31 Aug 2026 15:28:09 +0000 From: Bertrand Drouvot To: Zsolt Parragi Cc: Daniel Gustafsson , pgsql-hackers@lists.postgresql.org Subject: Re: Offline data checksum changes can cause incorrect checksum state on standbys Message-ID: References: <8DCA12FF-0199-403D-A203-666528A25DB6@yesql.se> 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 Hi, On Mon, Aug 31, 2026 at 02:10:15PM +0100, Zsolt Parragi wrote: > > Thanks! I did not look in details but it looks like that pg_upgrade --check against > > a running source cluster with checksums enabled will still fail (finding === 2 in > > [0], tested with the test shared in [1]). > > Yes, I missed that in the previous version, v7 fixes it. Thanks, yeah it fixes it. === 1 The v7-0001 commit message says: " pg_rewind keeps the target's own state, watermark and flag in the control file it installs, since most of the data directory remains the target's; replay from the last common checkpoint still adopts a state its watermark does not cover, and applies any online transition the target has not seen. " I found a case where the source's online enable occurs after divergence and was never seen by the target, but replay skips it instead of applying it: 1. Start a primary and standby with checksums off. 2. Stop the primary and promote the standby. 3. Enable checksums online on the promoted source. 4. Restart the old primary on the old timeline, advance its WAL beyond the source’s enable watermark, then enable and disable checksums online. 5. Rewind the old primary from the promoted source. The target is now off, with a watermark on the old timeline numerically greater than the source's enable records on the new timeline. pg_rewind preserves that watermark, so recovery treats those source records as already applied and skips them. Maybe the watermark needs timeline context, or pg_rewind needs to adjust it when it comes from the target's divergent history? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com