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 1w6EZo-0045Rq-2T for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 21:18:44 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w6EYo-00C5hL-0C for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Mar 2026 21:17:42 +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 1w6EYn-00C5hC-2V for pgsql-hackers@lists.postgresql.org; Fri, 27 Mar 2026 21:17:42 +0000 Received: from mail-ed1-x533.google.com ([2a00:1450:4864:20::533]) by makus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w6EYm-00000001OLy-0Tg5 for pgsql-hackers@postgresql.org; Fri, 27 Mar 2026 21:17:40 +0000 Received: by mail-ed1-x533.google.com with SMTP id 4fb4d7f45d1cf-66a4c6bb6ecso4462999a12.1 for ; Fri, 27 Mar 2026 14:17:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774646258; cv=none; d=google.com; s=arc-20240605; b=AprR9DKDqDnJkFn49Ulvli53p0GniSI5IgIdtqCnipkufE8/abpgMV1QxUT3ugoXTT Eh9l5FL+nYe1AKgp6R18ygkt0n4/DUn6ybMUCEWM+xyZzh12JJtugZuOIGYvZMpZXdva uBkSutQIQXF7FKH4ycMgYiVTdkV9/0PLVNYSFxojf2m/b4IkRQncpx03JkiGTSGJLPmQ Us0EQsKltMSiKYFwDXSj61EFiWMu8bu+ku7GowkRXtdil1g4ygctZlh/cyxgJstdkgw1 2sPu192270k4uBv7phVhtbYGwLMx25D+ZtKM71VuldYgmrrerES5IFCUheHMWo1jobK0 jUEw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=qHF7UGTyLIXVE6ymeLVaj+cHJDkhIhC0uEj4gZFGrpY=; fh=G3BxEAD6HNx52GIRjKt01UsMv5X1X56cMoOUr6XYDb0=; b=i14rUsswfv9rhh4akTVRZ3qPhhtsxFS1Lik+EtnaoCdEacjwDHgvAM1g3p4oagze6U 8ssjMp7E3TGQSQKlkt+DbO0J76hNQiMyZpJ0DrBHjTa2m4mm3OWa9x21lbVgBuA80tWl QJgKyTa1Gte2SlOWPRPfzbIwbCf5QEXEiM/sNUcqlPIDBwginvj4DmFXqr8pbOnQSXyq qtnDp1GGMNF8X14EbHyAPcnbVApDaf0lR+gtXJBhpwgdononofgkvOEoi/QcpBESYdSt qBJ4CrnMDZjQDU1pHMszXpSD37pw/nLJOIouvFl9/YLs+1NDQsLJqFJ++OGCRZmV8Ma1 fWhw==; darn=postgresql.org ARC-Authentication-Results: i=1; mx.google.com; arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1774646258; x=1775251058; darn=postgresql.org; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:from:to:cc:subject:date :message-id:reply-to; bh=qHF7UGTyLIXVE6ymeLVaj+cHJDkhIhC0uEj4gZFGrpY=; b=JyHVq7ITTtLM8uvOz1ApxzP06Z2oHV/xS+sh9VTljzRM4rkJBJbMCAgAmwsy7idan3 GOnOc7QiME0rysb+eYbutmYtCY2rJ6uu8fiuYOLYSPq5WAykOehI3ATnxrwmgKmQ5T7n QF/qvqGPDM1FUlua+TX/XMdteJDAOvHJNp2bLHGfv6zgEVTizV1DAYqP3YXOpQAN6Xon 1in7Et6bgf44rgAKBx/qbkkI1MDR0mzowNT9vr5d/EtY8Mq2SH3n+hiQtT3hSDonVbUE q8VQHZDPZ9jco9b+60Wz+tnP6X6trWFiSCXMpOA92yClNaEoZEWPkAguny6dH0l1MFH/ IQEQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774646258; x=1775251058; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:x-gm-gg:x-gm-message-state:from :to:cc:subject:date:message-id:reply-to; bh=qHF7UGTyLIXVE6ymeLVaj+cHJDkhIhC0uEj4gZFGrpY=; b=jccYR9N/s5dvsg5vekDON3EHgzYFmvIanHmTlLH7M09yGeDDmwQoIwfBnL9UJ3tjFM zikulYCZKjptg79FfoQMOkFvUf55jlvge/4rNqUbBMqVvc5Qb86Jps/Fwu0dad7E3aUg lPGQZgqU5G5syP68qYXj6pPIPY7MVUrRUeXDzEeFVuoIt0TYXAM9TCTyvtY+0fEd7t/b GGs44H2kNyxaC4OsbnryotaEqpUvfJk23tKoynegog4i7eH0oY8s5c7fwP4kvVvjND0/ ZVk7ljqUwDsmd+9PxhmHNHhP07WbmGfWMFR+N3qrvkod49LYzVBI3IL2GJIY3ZphYIhL iEzw== X-Forwarded-Encrypted: i=1; AJvYcCUOteVwFIZuCFCV1qV8EthgDC1MWHaxar57YZEJR4Ql2r08elf96ozyktwLQ/M/i14VCFvtNcYsMtSJQDDF@postgresql.org X-Gm-Message-State: AOJu0YxdIYk30XIO3hi5CwhtHshMh/+f5H0ZhHX0gG1utvkO46i48cS5 w/vylRzhvVU0GXZlC203ddfpWnWiDclKwuViR5QIULvvaR/QRrX8Jrvd9b/sY1oEeOzFJszojkK DwllNRAKuwnk7NbK05L+/NozxFsV+xFg= X-Gm-Gg: ATEYQzynvND45IyRB1gQEDnG8L87QFbdUs7e9XeNcq6Fb2Hh61IjbI5N7x/A9mI8bXC eSWJExcDQMqL1vvRWPDO1z+ax8UdaMwPtb85MQPRxuE262xkfRjxbyk50zUg6IV6EFwKSZcINsN Xu+Fw4b6x35oM83uaizkxz24c+kp9km2BABeNzhYlsdTW4ZQdP3HodFK4ZUuP8OP1xzGpj3hP63 +vcK6QizMGfSg3Fuslyz4IM8Y5CH+H9FT5V+KgnHIpV6A+Yh5YYZ6ouJUkFqYnWLGq/uT16YaO/ KPD4R6Ygo/Khd9+ItZjkzJaCc8wCYrD4/zfGvpgxfIh7/lZ9Xfxq7z5uO30SnXhbLS/oz4rTQZb 2H3vUnKKKiPS86rwgozA= X-Received: by 2002:a05:6402:4024:b0:665:28aa:5f12 with SMTP id 4fb4d7f45d1cf-66b28d68a21mr3007583a12.27.1774646257228; Fri, 27 Mar 2026 14:17:37 -0700 (PDT) MIME-Version: 1.0 References: <42rdu4q44kvsq53fz5qgzuawqpaytvnemsnquynlfch5mqhc2m@6ytnlgivtzro> In-Reply-To: From: Melanie Plageman Date: Fri, 27 Mar 2026 17:17:25 -0400 X-Gm-Features: AQROBzBJbpR_BgGQhypY8_ys8asx2BWqLvh2pbU9hdr8BQ72ng_aGQnAgxlzcbc Message-ID: Subject: Re: Don't synchronously wait for already-in-progress IO in read stream To: Andres Freund Cc: Nazir Bilal Yavuz , Thomas Munro , pgsql-hackers@postgresql.org, Peter Geoghegan , Tomas Vondra Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Mar 27, 2026 at 1:29=E2=80=AFPM Andres Freund = wrote: > > On 2026-03-26 20:12:30 -0400, Andres Freund wrote: > > One test used did_io=3D(t|f). That was actually only needed once "aio: = Don't > > wait for already in-progress IO" is in, as we might join the foreign IO= . I > > chose to hide that by making that part of the query "did_io and not > > foreign_io", so we would detect if we were to falsely start IO ourselve= s. > > I ended up not liking did_io, as that seems misleading when we just neede= d to > wait for a foreign IO. I instead named it io_reqd. 0001 looks good to me except I don't get why you are still passing MAIN_FORKNUM to PrefetchBuffer() in invalidate_one_block() In 0002, the test cases look good to me. I haven't gained more knowledge about injection point related code since my last review, so still no comment there (inj_io_completion_hook(), etc). I didn't see anything amiss reviewing by eye. Running it through AI, it suggested that you should clear stdout between test cases in test_inject_foreign. I think this seems most relevant because in two back-to-back tests you are looking for the same output pattern. It also pointed out that there is a pre-existing bug in inj_io_short_read_hook() where you pass the wrong parameter to the log message. ereport(LOG, errmsg("short read injection point called, is enabled: %d", inj_io_error_state->enabled_reopen), errhidestmt(true), errhidecontext(true)); should be ereport(LOG, errmsg("short read injection point called, is enabled: %d", inj_io_error_state->enabled_short_read), errhidestmt(true), errhidecontext(true)); 0003 LGTM. I am still in the process of reviewing 0004. - Melanie