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 1tzdHi-004Wx5-JE for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Apr 2025 15:12:14 +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 1tzdHg-003eVm-B7 for pgsql-hackers@arkaria.postgresql.org; Tue, 01 Apr 2025 15:12:12 +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 1tzdHf-003eVc-Ox for pgsql-hackers@lists.postgresql.org; Tue, 01 Apr 2025 15:12:12 +0000 Received: from mail-pl1-x636.google.com ([2607:f8b0:4864:20::636]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.96) (envelope-from ) id 1tzdHd-002m95-0g for pgsql-hackers@postgresql.org; Tue, 01 Apr 2025 15:12:11 +0000 Received: by mail-pl1-x636.google.com with SMTP id d9443c01a7336-227c7e57da2so85114905ad.0 for ; Tue, 01 Apr 2025 08:12:08 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=leadboat.com; s=google; t=1743520327; x=1744125127; darn=postgresql.org; h=user-agent: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=25JMlpluqjGP6CAimh5wnIPMAg9UUwjstJD4iN+DbHw=; b=TNbKbIRx+ApT6SEbfzTWVBWpnbKlyI6ip+tI0KOZzRodCRMDmpyfYtgpUA/YrzbsPY 8W0PcjpzrlNfb83qkrBIkma5ka5FG2W3yB71ge+/pw9OooBqEgoRq2Lnke0UYEPfBiI9 BvqmpcqHcasSf4r3ckQ2X6OfBi4QgBbnaYhT4= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1743520327; x=1744125127; h=user-agent: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=25JMlpluqjGP6CAimh5wnIPMAg9UUwjstJD4iN+DbHw=; b=ShGhI8HUyKNw1Qp4ZMBpHKqowwuNBzJRXi7gnNLCFeUo/Ju36XVikvfk8gJW0OrtO5 fNK712yFhQuqEHy9kdkH5pE5AaPcdgsR9sZcedoxNImoZ9USLsiN35/aq9wfiKyNP4i2 yvFZdy0PZgYBNgGsv0D2tgg/fiSbeM0iYLw5DIVg18wBS7aW/0zU+dwrBrsqjD2j8a9A rxBmtobwzz91AqH2oGy6uBy7PPIqrYZ3VOGRSbIK8SiD8D0ynDooMq/XTW2wxVp/WNDy 5N8+W62l03VIM4N7xP1Icddm+o2T7vo8KVa2p1xxDl6bRu0ZX7cYDt0JS5ufMT8Lk8kH qifg== X-Gm-Message-State: AOJu0YxqlngBi2nU6bus6R3IjkQAX1uKB1TcmfmMfdaaseioigX4u66t Vp5pkrYyemw9ErrDYi0g6gGpBUK/Z1yBxRnZxi4afDtPoC8zpszvH3xNKvHG3Q== X-Gm-Gg: ASbGncsUGgU86pIm46yNhA5FkvS/3nnTz5gDr4CNYFjOlqCaG4MMLrhRfDTE3PJR98E jdsh8zz81kyy9FxTQHIuSiK7/F0dXFE0c2BpyvJRkIbK/dk1f2PXF3wwq4x9Lk7fBJ48G7QWrxy ZC60wMbs7pErojVrpnQKXSPu8JcwklQi7J0kyrzmdh2IMlqIc7EK79GZNqD5EXpyQKRLaz0iH2+ /YOx+BHWVl19thhegeMA3tRRHbWTh0vSfX0JCimT2PjIY78yPxjGaWobF0ltSi54+S1mRE0oUbE SE8TZZbYtWhUzg48nhr/yS2bYZR9giq8pZxaKXvCrQ== X-Google-Smtp-Source: AGHT+IEqA3qJx8v1f/ovBZ0+XXOuxl7K3KqsZsxosOo3kR3vUITHnK8VBJdPQTsLwm8WhUtbfaSTZQ== X-Received: by 2002:a17:902:e541:b0:21f:3e2d:7d42 with SMTP id d9443c01a7336-2292f9773b4mr176828665ad.23.1743520322355; Tue, 01 Apr 2025 08:12:02 -0700 (PDT) Received: from google.com ([2601:647:5600:80d0::31cd]) by smtp.gmail.com with ESMTPSA id 98e67ed59e1d1-305175ce2e3sm9375496a91.47.2025.04.01.08.12.01 (version=TLS1_2 cipher=ECDHE-ECDSA-AES128-GCM-SHA256 bits=128/128); Tue, 01 Apr 2025 08:12:01 -0700 (PDT) Date: Tue, 1 Apr 2025 08:11:59 -0700 From: Noah Misch To: Andres Freund Cc: pgsql-hackers@postgresql.org, Thomas Munro , Heikki Linnakangas , Robert Haas , Jakub Wartak , Jelte Fennema-Nio , Antonin Houska Subject: Re: AIO v2.5 Message-ID: <20250401151159.51.nmisch@google.com> References: <5tyic6epvdlmd6eddgelv47syg2b5cpwffjam54axp25xyq2ga@ptwkinxqo3az> <20250328032223.34.nmisch@google.com> <20250329134143.ca.nmisch@google.com> <20250329212929.a6.nmisch@google.com> <7s6fclfekpcxoaaorwrq67v4vmgixf2dcjcgznuj7vxs3ie3wq@okqbi5vabqbx> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <7s6fclfekpcxoaaorwrq67v4vmgixf2dcjcgznuj7vxs3ie3wq@okqbi5vabqbx> User-Agent: Mutt/2.2.12 (2023-09-09) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Mon, Mar 31, 2025 at 08:41:39PM -0400, Andres Freund wrote: > updated version All non-write patches (1-7) are ready for commit, though I have some cosmetic recommendations below. I've marked the commitfest entry Ready for Committer. > + # Check a page validity error in another block, to ensure we report > + # the correct block number > + $psql_a->query_safe( > + qq( > +SELECT modify_rel_block('tbl_zero', 3, corrupt_header=>true); > +)); > + psql_like( > + $io_method, > + $psql_a, > + "$persistency: test zeroing of invalid block 3", > + qq(SELECT read_rel_block_ll('tbl_zero', 3, zero_on_error=>true);), > + qr/^$/, > + qr/^psql::\d+: WARNING: invalid page in block 3 of relation base\/.*\/.*; zeroing out page$/ > + ); > + > + > + # Check a page validity error in another block, to ensure we report > + # the correct block number This comment is a copy of the previous test's comment. While the comment is not false, consider changing it to: # Check one read reporting multiple invalid blocks. > + $psql_a->query_safe( > + qq( > +SELECT modify_rel_block('tbl_zero', 2, corrupt_header=>true); > +SELECT modify_rel_block('tbl_zero', 3, corrupt_header=>true); > +)); > + # First test error > + psql_like( > + $io_method, > + $psql_a, > + "$persistency: test reading of invalid block 2,3 in larger read", > + qq(SELECT read_rel_block_ll('tbl_zero', 1, nblocks=>4, zero_on_error=>false)), > + qr/^$/, > + qr/^psql::\d+: ERROR: 2 invalid pages among blocks 1..4 of relation base\/.*\/.*\nDETAIL: Block 2 held first invalid page\.\nHINT:[^\n]+$/ > + ); > + > + # Then test zeroing via ZERO_ON_ERROR flag > + psql_like( > + $io_method, > + $psql_a, > + "$persistency: test zeroing of invalid block 2,3 in larger read, ZERO_ON_ERROR", > + qq(SELECT read_rel_block_ll('tbl_zero', 1, nblocks=>4, zero_on_error=>true)), > + qr/^$/, > + qr/^psql::\d+: WARNING: zeroing out 2 invalid pages among blocks 1..4 of relation base\/.*\/.*\nDETAIL: Block 2 held first zeroed page\.\nHINT:[^\n]+$/ > + ); > + > + # Then test zeroing vio zero_damaged_pages s/vio/via/ > +# Verify checksum handling when creating database from an invalid database. > +# This also serves as a minimal check that cross-database IO is handled > +# reasonably. To me, "invalid database" is a term of art from the message "cannot connect to invalid database". Hence, I would change "invalid database" to "database w/ invalid block" or similar, here and below. (Alternatively, just delete "from an invalid database". It's clear from the context.) > + if (corrupt_checksum) > + { > + bool successfully_corrupted = 0; > + > + /* > + * Any single modification of the checksum could just end up being > + * valid again. To be sure > + */ Unfinished sentence. That said, I'm not following why we'd need this loop. If this test code were changing the input to the checksum, it's true that an input bit flip might reach the same pd_checksum. The test case is changing pd_checksum, not the input bits. I don't see how changing pd_checksum could leave the page still valid. There's only one valid pd_checksum value for a given input page. > + /* > + * The underlying IO actually completed OK, and thus the "invalid" > + * portion of the IOV actually contains valid data. That can hide > + * a lot of problems, e.g. if we were to wrongly mark a buffer, > + * that wasn't read according to the shortened-read, IO as valid, > + * the contents would look valid and we might miss a bug. Minimally s/read, IO/read IO,/ but I'd edit a bit further: * a lot of problems, e.g. if we were to wrongly mark-valid a * buffer that wasn't read according to the shortened-read IO, the * contents would look valid and we might miss a bug. > Subject: [PATCH v2.15 05/18] md: Add comment & assert to buffer-zeroing path > in md[start]readv() > The zero_damaged_pages path is incomplete, as as missing segments are not s/as as/as/ > For now, put an Assert(false) comments documenting this choice into mdreadv() s/comments/and comments/ > + * For PG 18, we are putting an Assert(false) in into > + * mdreadv() (triggering failures in assertion-enabled builds, s/in into/in/ > Subject: [PATCH v2.15 06/18] aio: comment polishing > + * - Partial reads need to be handle by the caller re-issuing IO for the > + * unread blocks s/handle/handled/ > Subject: [PATCH v2.15 07/18] aio: Add errcontext for processing I/Os for > another backend