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.94.2) (envelope-from ) id 1tIbM0-00FJzs-G5 for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Dec 2024 22:26:48 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1tIbLx-00DIIO-LM for pgsql-hackers@arkaria.postgresql.org; Tue, 03 Dec 2024 22:26:46 +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.94.2) (envelope-from ) id 1tIbLx-00DIIE-B0 for pgsql-hackers@lists.postgresql.org; Tue, 03 Dec 2024 22:26:46 +0000 Received: from mail-qv1-xf36.google.com ([2607:f8b0:4864:20::f36]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.94.2) (envelope-from ) id 1tIbLr-000u06-9B for pgsql-hackers@postgresql.org; Tue, 03 Dec 2024 22:26:45 +0000 Received: by mail-qv1-xf36.google.com with SMTP id 6a1803df08f44-6d89a727a19so3175396d6.0 for ; Tue, 03 Dec 2024 14:26:39 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20230601; t=1733264798; x=1733869598; darn=postgresql.org; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:from:to:cc:subject:date:message-id:reply-to; bh=6l4sIhP8mtuauYVNYfYbjCyGA8CmqhA5ghKFfTLB2bk=; b=JzIzBkRzD3kcIiu0v9xJ5N3ajsAgtFF0eMfL5mrJ2DjtV/1rkB6KCPIyOSHMTog4Sj rrdFTAQwo9zvTb9fxYCqx3IFPT/HlKRMKThBDbZuLnozxBjzeIHvtTm23Rsw45GvHqEe fRUunjeo/0hWWHgifnOnTsy+ZhgUb1nbjGk/L6sMitVz7AqjWvxMaMi0UbRAyfqfUVls M3zYgw7kr07Lwzh7TcuaMqTbR14IttAEq2Ru1n9+1c1SPzQ4kUoLQkP1NG+vVsfEd5sL AGU7Q3RC7/hwYt529TUAN3OoAdK/2d7XP8ZGgxLkR7D1BIwUC4jFMDjJP3NHN2Ak6CE0 OQkQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1733264798; x=1733869598; h=in-reply-to:content-disposition:mime-version:references:message-id :subject:cc:to:from:date:x-gm-message-state:from:to:cc:subject:date :message-id:reply-to; bh=6l4sIhP8mtuauYVNYfYbjCyGA8CmqhA5ghKFfTLB2bk=; b=IATnYRs6Pkrh2epVg0DHzVgJjk/H7boAVBKpyRIWAj8LI3rtcxD3O3lizxi5JtRcN+ +8pytqeI+rrGlfy2IRXlbqptL0IZECaUjyC067jTTgB0iQw6+EJZzjdyAvddv4Tvwuhl MYe4IeQbBpQdx1A30BCibpAYTMwjuXfKYHLMFwq3GBxKCvcpzGEcgZE02QJbx6tzq6iF g2CVX6AV9rcZsoI1m65ld1bzOfrxOWWu1mba6U1v5IuA8AVTXnXzpDiPgpDIky2bETh0 tA3G4HqBUK2yVxnpg5gkCPBPhoSDacxCINwbI4Gj6z0i7OMAgxzITWhwYIcUpVnj/1EG 9LKA== X-Gm-Message-State: AOJu0YxwoGOMaLw4rCNRqPyyrX5YR9taTPIkRR/Zq0GylnKJCpIqWcYK 3Ml1prBezGDw4mCNdfRFw2dv555FuNHqW4y8s/BChL/ODxczPwRD X-Gm-Gg: ASbGncv9+ne/xyHsZIW09JH+0f0yVpviAyGKuuWmPN0AS6ijvXELslp1LlVg1VeP19W 9XoIiwlFTwJDZsCi+zHb4sjJJ1Dxe3dB6Gx35GZYw9K4vYMTPyj2wEdiUIKmkP43wwDBOnul0P+ 7HCRuBsOjLecTbj/k0IRreTGzKfUdNFdzLCysV8dKF7lUJVqczYbCFaV4FX9iNSm4WXBQTsXOX2 iuiVPG9GeI3D2PpVMD3SP4wHSoSFyWx38fhuGAKB6/iCR+HhTxukrwp11BGHDapHjDl96m6gTX9 vorOAmLunCxLcsEBu+F3yviNAbLbrEdHiSkiWwZq X-Google-Smtp-Source: AGHT+IEYGJew0XFFhm2JKy6uvAOwmlp1hKvEpy4ASsW6DA8uSTvkZ6bNBrG3YfpVpzpiOW5kfOI6Aw== X-Received: by 2002:a05:6214:301a:b0:6d8:88c2:af5f with SMTP id 6a1803df08f44-6d8b8d60a77mr70019676d6.1.1733264798291; Tue, 03 Dec 2024 14:26:38 -0800 (PST) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id 6a1803df08f44-6d89d309be9sm37868766d6.26.2024.12.03.14.26.37 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 03 Dec 2024 14:26:37 -0800 (PST) Date: Tue, 3 Dec 2024 16:26:36 -0600 From: Nathan Bossart To: Robert Haas Cc: "pgsql-hackers@postgresql.org" Subject: Re: checksum verification code breaks backups in v16- Message-ID: References: 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 On Tue, Dec 03, 2024 at 11:39:43AM -0500, Robert Haas wrote: > If we want a narrower and thus less-risky fix, we could consider just > adjusting this code here: > > segmentno = atoi(segmentpath + 1); > if (segmentno == 0) > ereport(ERROR, > (errmsg("invalid segment number %d in file \"%s\"", > segmentno, filename))); I'm only seeing this code in pg_checksums. Is that what you are proposing to change? > I think we could just replace the ereport() with verify_checksum = > false (and update the comments). That would leave open the possibility > of trying to checksum some random file with a name like > this_file_should_not_be_here, which we'll interpret as segment 0 > because the name does not contain a dot; but if the file were called > this.file.should.not.be.here, we'd not try to checksum it at all > because "here" is not an integer. That's a little random, but it > avoids taking a position on whether > 025584a168a4b3002e19350bb8db0ebf1fd10235 is fully correct. It simply > takes the narrower position that we shouldn't fail the entire backup > because we're unable to perform a checksum calculation that in the > worst case would only produce a warning anyway. Hm. > At the moment, I think I slightly prefer the narrower fix, but it > might be a little too narrow, since the resultant behavior as > described in the preceding paragraph is somewhat wonky and > nonsensical. Yeah, I'm a little worried that it is too narrow. I was hoping that the refactoring commit was older, because then I think we'd be much more willing to back-patch it. But there are a couple of v17 releases out there already, so maybe it's not too much of a stretch. I guess I'm leaning towards the back-patching idea... -- nathan