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 1x4rut-007SyT-2i for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 03:27:07 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x4rus-00BMTa-2J for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 03:27:06 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x4rus-00BMTS-1K for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2026 03:27:06 +0000 Received: from mail-pj1-x1029.google.com ([2607:f8b0:4864:20::1029]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x4ruq-0000000548f-1Qc7 for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2026 03:27:05 +0000 Received: by mail-pj1-x1029.google.com with SMTP id 98e67ed59e1d1-39675172593so460707a91.2 for ; Thu, 10 Sep 2026 20:27:04 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1789097223; x=1789702023; darn=lists.postgresql.org; h=user-agent: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=+6KrpJJI7FJZnKE68lj6bVYAUcBDrRSxQ0YV5Tlds40=; b=DOQCFAucUj8Ut8VwoT/hb0Afa3+/bFejCigJL4B0k033VZTgWaMME+Eos8W3jvvmUw vNXYj/7qcgINqgKW8N3p7+LQolo2HYr/cysqf26Eqnt6Hat+q50GarI7CMxx1r/eM+sx vtJFVA2i/mUsE4a4aNsb0d2jfReJp6Mux2KGs= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789097223; x=1789702023; h=user-agent: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=+6KrpJJI7FJZnKE68lj6bVYAUcBDrRSxQ0YV5Tlds40=; b=Qdd/f8NEz0KZj3Y5+e9GZmZi06Z4ZCIZmQ/QAB7UoTcdCWjP+bKUJ5OI0K/Xlr1vpo h6RYKHwMMNaH0laFZJmco+vu4MWg61LLqW7YtDEmJJ2FPsGP1T8+fKowUXraPPZmNL/B zTzslZ3G0Nf7iVxGBKy8Szb3EqKxdId82Hdq/PBqWFt6SbdF+5Li0GAZvz8yuK9zS2La 4MHLjhddB+tfgZOPvZKQCb4bfp/tX7+iv62u/mUOBvxekYhSi3l7tyLFehblYt630ggT OoaC9amj/XIvF4ZWNdlJiLqwV2HhH+EKCeP5VmmDg0edv0m7PFIFH27J1CcGGXsnBuV+ Enqg== X-Forwarded-Encrypted: i=1; AKwUvBw6LCzyFaOy9cKWL6s69r0T8Uln/jRtVaZd4TSG9ytFqo94qJQXPjx6COnGF2NlBCHGLuuWRlUmf5Godzsr@lists.postgresql.org X-Gm-Message-State: AFuF++l8zZ5NzS8aq/ONBboXJmtt6Wf3jSqY2gksmpjd4a+4H7zUsbqL qDYNbuoof4lkMVwQUYRMiKP+BqvCRrosqgAvfIEPpeOhCTuhiYhV89IIuvUUqNvU7yHVBiCMlI2 U+kQTbQ== X-Gm-Gg: AYBFou1K+G0rAtuSVdTxtJFegHuIcuXvxnJRQ4OLb2VlosUJJ/aK9iJ+gTNra2PA/HD ICQUmHG94y4xJ/Fl0sK6INHtKAF8lIXJ9Oeer6W8cSOnLwmQpgxd0XjEGf+JMKfn5p9h2+tpGpR FpdPzdPBTYxTUOXovHj0NYYUgHaOsf3a3DZHh+K7Ve0tE1E+DVaQnh5ub/wi9Ro3RWZ4VdYxN/G +XLtqkHp73+VE3F2+UTr+nmhe+1nrilePXgYYbLcYotLea+3jsk8P2vLYtR8LHYFyQuawVDWtRM frsWHfXgaaQe/GbKFUNnTfcjz91cjHLuK4XzLxMX7Aa2kZ8SXLFcvqv1YkNe2R2cC3vRp0WIUHs aMkxHSbI7Z26uQ9MLsn8v/wshaLQQ4382I65h81djOsZH8PJkitBMJG3sCeqdEfX1Y19NgXMKHc zqz5UbLh9UdKOsyU0x6IV40CBpYhMWATJHhWsTXb/uO1YnQ9gOWHfXELSt91HO7lKysSkinoml0 W91cymAczANXN+kUYIarmf9L5c14e4= X-Received: by 2002:a17:90b:380a:b0:398:d6e6:4671 with SMTP id 98e67ed59e1d1-39d9c3c9ec8mr3211211a91.25.1789097223412; Thu, 10 Sep 2026 20:27:03 -0700 (PDT) Received: from microsoft.com (c-73-15-160-255.hsd1.ca.comcast.net. [73.15.160.255]) by smtp.gmail.com with ESMTPSA id 5a478bee46e88-33ba4fa50e3sm2321466eec.29.2026.09.10.20.27.02 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Thu, 10 Sep 2026 20:27:02 -0700 (PDT) Date: Thu, 10 Sep 2026 20:27:00 -0700 From: Noah Misch To: Robert Haas Cc: Daniel Gustafsson , PostgreSQL Hackers Subject: Re: Trying to break online checksums with LLMs Message-ID: <20260911032700.4e.noahmisch@microsoft.com> References: <2F197F99-9142-481D-8DC9-37FAAF09EC7D@yesql.se> <3108345D-DC76-4FDA-9F9E-7583AEC81CC3@yesql.se> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/2.3.0 (2026-01-25) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Thu, Sep 10, 2026 at 06:00:31PM -0400, Robert Haas wrote: > On Thu, Sep 10, 2026 at 5:50 PM Daniel Gustafsson wrote: > > It is too close to midnight for investigation, so I am mostly asking an open > > question as a TODO marker for myself in the morning: Are we guaranteed that a > > create relation that crash will end up with orphan files containing correct > > checksums? That is, if you have a cluster initdb'd with checksums on, and > > never use neither online checksums or pg_checksums, can you end with an orphan > > file from CREATE TABLE crashing which cause a backup page verification failure? > > All of the blocks in an orphaned relation file were properly > WAL-logged when they were written, so they might be inconsistent at > the moment of the crash, but crash replay will fix them up so that > they have valid contents. From replay's point of view, those files > aren't orphaned at all, and it treats them just like any other > relation files. The problem is just that at a certain point they stop > being mentioned in the WAL stream any more, because the transaction > that caused them to be created gets terminated by the system going > down, and never has a chance to write additional WAL records asking > for those files to be removed, nor on the other hand to commit so that > the catalog rows that point to those files become visible. > > Over time, as activity continues in the rest of the cluster but not in > the orphaned files, the xmin and xmax values in any tuples in those > orphaned files will drift away from what the rest of the cluster is > doing -- the *tuples* won't be readable any more -- but the *pages* > are fine. To base backups and anything else that operates at the > storage layer, they just look like pages we haven't chosen to write > for a long while. Offhand, I expect checksum violations in orphan files can arise with wal_level=minimal. If the transaction never reaches commit, or its commit takes the smgrDoPendingSyncs() -> smgrdosyncall() path, the new relfilenode has no WAL. wal_level=minimal was last the default in v9.6, well before checksums were on by default. Also, a checksum failure in pg_basebackup would require raising wal_level after making the orphan. Those prerequisites may explain the lack of reports.