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 1x1fep-005Lmv-12 for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Sep 2026 07:45:19 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x1feo-00BI0j-0A for pgsql-hackers@arkaria.postgresql.org; Wed, 02 Sep 2026 07:45:18 +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 1x1fen-00BI0b-2N for pgsql-hackers@lists.postgresql.org; Wed, 02 Sep 2026 07:45:17 +0000 Received: from mail-wm1-x32c.google.com ([2a00:1450:4864:20::32c]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x1fel-00000002VkK-0jnG for pgsql-hackers@lists.postgresql.org; Wed, 02 Sep 2026 07:45:17 +0000 Received: by mail-wm1-x32c.google.com with SMTP id 5b1f17b1804b1-49b0d8bc2aaso6505915e9.0 for ; Wed, 02 Sep 2026 00:45:14 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1788335112; x=1788939912; darn=lists.postgresql.org; h=in-reply-to: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=C0FUti89OSQngEtQMUfUEL0uFGDAsCmyFC96ITcYYQA=; b=oC3mE3BR2Glg3wSMwJsXshH00Nd4jVRVxrrSfT6f4wh0NCvbedHicrLGST8hXruRoH EnlpU4K4dt9AbjAs8lHmrmto73oWndP+BFt7A6nNfKJ7IHGZDGUqA+o03Sq1kIsQAqDI eR8heHslpNqmU6W+sZgObvLulZMe8H21s8c9hm2pgXYjxSB7McGwUFg/Kpwp3Yaz9pwq Edy/jGOcWdx3E6DEMhh5mGyiBIWWI1OwsEobs6x5pUis1gK3f/8Yv196wj5NslmCVgGB kqCB/ne0wGFU+c0fzaSQrQAp+qg63DL8ED07icQpMRhQtLeCQgQNsPwQFY242BIXwzYX ENWQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1788335112; x=1788939912; h=in-reply-to: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=C0FUti89OSQngEtQMUfUEL0uFGDAsCmyFC96ITcYYQA=; b=c/Qv6T5F7KnWMt8d0Dl4aqtY8t9SFFR82nTV9yJgZtS5YeqSFo6PDpscQd7heC8rjF E3HPU4/wPdutZ/1Dlol1zxNZVTusg04JiAxZlcKPwHe3B7ZOis/bvLRnRkQnjoKE7PAB t3l0ylyMD26wfH4ooQnynWHd4LDt0VFpgdrjMSkKLAGQHnBV4GnhrO10Tlc7ZOIG35J/ qKkfDWvENhT0IWXqg1Jpy0ulX0zA5UwH9ZENT/sTwW+0LdyEQINItic7RJDuAGDHXAjs a4eaP8rifEOfYP+mXnjlvyLaQCoGzQTgqgPa5mt4IMBYmC0RWGloPxaPLq2FayWJcp93 H6cQ== X-Forwarded-Encrypted: i=1; AHgh+RrAffCBBYlKVaLIjQcN3mFS6CgANuKgnZ0y+sXvucm+WEayvmyFgnZqPMQZFDDI45ROUmE0neupRyINV6rK@lists.postgresql.org X-Gm-Message-State: AFuF++lGHiYDza2Y1IHEotZygqeniOnmX4y5a0R80DXYnfU8TtszIu5K IIognvGYWhu+xjRr9NrAYmZkd7hRhADr6jXkZuu1/JdEdWnerJ5mmj20 X-Gm-Gg: AR+sD11plTIvxLK2TnUEHG8dFNlMqR35FZsW6TzbMamATu+43cdgz00Kz0lQzVAkDbf r6U8OkJqclg9/PpyUv2J44q38QZimPLraswZ0MesVKgJF5ORFnnffWKU+gnYRjJdTqQyyCz7ome i6SLodmgQGJYuNplurH2YSyspqlOrOCeUq7oG836fvDsOE/ah/LSXWbv9rnQsWzZxPXxCxaSAHn 4JwFJ1sPICa73d5EuNJtI2HNeoSNrf8FRd185AGF2/NJ8YV/w9BpeHPkBbxBYsx7RtZM8uUwnKg HGp0PFcUwpZKCxDT6CU7sku8px3A14TWJXUA1yynm5D/QlP6oabqqMx3kB6w7lWPBMlUAG6qdH/ XiHWCWyF3Dh9VEC9kvAkY6LEZdkZHZM8WRWJtbuGHYFXhBP+twe2NuLMtpvZ0XxLPGKUJfmK4dW iEFvNBC1AsclLoXPwcTx8shvrWDb3Sq7d2S6MUrzEB3M9AqWecowVfunBCbKs1lo5/nPMc/PM/U bNAwFfbXB/A/3Aj6CIviAJW7vQ076hcmlhZHkHCjTmo/vYc4g== X-Received: by 2002:a05:600c:4688:b0:499:726b:7375 with SMTP id 5b1f17b1804b1-49ce5822b73mr44400365e9.14.1788335112128; Wed, 02 Sep 2026 00:45:12 -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-49cdd73f7a4sm128780775e9.12.2026.09.02.00.45.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 02 Sep 2026 00:45:11 -0700 (PDT) Date: Wed, 2 Sep 2026 07:45:10 +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=us-ascii Content-Disposition: inline In-Reply-To: List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Hi, On Tue, Sep 01, 2026 at 02:50:04PM +0100, Zsolt Parragi wrote: > Thanks! > > I applied these changes to v9 with some additional comment editing. I > also squashed 0005 into 0001 because it describes what's implemented > there, and I also tried to significantly reduce the commit message of > 0001. Otherwise everything else is unchanged. Thanks! I initially thought there could be two more issues: one involving a base backup spanning an online enable and another involving a crash during the first recovery after pg_rewind. Further testing showed that neither was an issue. So I'm happy with the current v9-0001 behavior. I now just have a couple of wording comments: === 1 + only then restart them. Before stopping a standby, make sure it has + replayed all WAL of its upstream node, for example by stopping the + primary first and comparing + pg_last_wal_replay_lsn() with + pg_last_wal_receive_lsn() on the standby. Equality only proves that all received WAL has been replayed, not that all upstream WAL was received. Maybe we should compare against the stopped primary's shutdown checkpoint location, as 021 does? === 2 + /* + * Mark the state as changed locally, without a WAL record. Recovery + * then knows the state is newer than anything the WAL carries and + * does not let a replayed checkpoint overwrite it. The watermark is + * left alone: any XLOG2_CHECKSUMS record this node had applied stays + * covered, and only records above it, written after this change, take + * effect again. + */ An offline change has no ordering against WAL not yet replayed, so records above the watermark may have been written before the offline change. Maybe this should be worded in terms of records covered by the watermark, without implying chronological ordering? Regards, -- Bertrand Drouvot PostgreSQL Contributors Team RDS Open Source Databases Amazon Web Services: https://aws.amazon.com