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 1w4zQd-002mdd-2l for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 10:56: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 1w4zQb-006ET0-0g for pgsql-hackers@arkaria.postgresql.org; Tue, 24 Mar 2026 10:56:05 +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 1w4zQa-006ESs-2w for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 10:56:05 +0000 Received: from mail-ua1-x92b.google.com ([2607:f8b0:4864:20::92b]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w4zQX-00000000rc1-0oMs for pgsql-hackers@lists.postgresql.org; Tue, 24 Mar 2026 10:56:03 +0000 Received: by mail-ua1-x92b.google.com with SMTP id a1e0cc1a2514c-950b801b75fso1337350241.1 for ; Tue, 24 Mar 2026 03:56:01 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1774349760; cv=none; d=google.com; s=arc-20240605; b=iuT4rpGVi+9AMV1ZnbmBCf9f3KI9mPaYs3ZQPgvDEdCMZ5wEHdWGRUeN+zXiljMd4C m+cBurkfwOTwX9te3S7Q/b4JDfFUtB+/CZ5Uk1F8uDOVHrU4sgZj+I852isRvEV7w40h KlddSBGSjakk1RKJR5fsZ6/Q31XMRdnjdBtJJ6gQngvLJ6Rerz/AFLnoSZB+rY9376Ls SMUDpNyTkn64lEFECYRICZjbJXJFOX62fS+hme6+tbbRqzUpklke9Iv03X01/fXHoJct XaCYv5EV35slqsc+bYsi+nQiv2wU4FS20yRfczQ8NO8uO53LySuBtKB41IxjCs0w+Ah8 xu3A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20240605; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:dkim-signature; bh=oXhF1Dpj8ObxLAB4jnV0wluxCZ/Noy/H5DPTJE6SPO0=; fh=bRSJWMUw0g4tsFnmT5Pt7bmHrfadpqeWpGFxsA6MdVw=; b=VTwi2miPySGdeihrmm81RPsOLWe6T9zjN5cIbJz2z1BH+9qk7evut9QdADAi/yhMIO MS0KCyz31DMEZEjda9QMgOucZjvI61eTs2HFUwa2vB47Zv5Rhj9DeM1LyZbSaMbmr+H5 7q/YeEEGwNCIRQ7BeWErmpulPKjanvQXx6H3FtHMYM7k4tlol4vf65ISjGzX1dwxq2UK bwP3g+X6Nu9Iqi7jNspH1UH9R520+Zy/3MCE6WvkbxMXoiUVsyorFTEHuZh8kqf6znPo u3+utpCtNTcH2CKeA8/+zgEWDh4hfJQV4bAWePMmSFl/r3QgUyIAlk//PmkSfOK3A4Nx upMQ==; darn=lists.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=1774349760; x=1774954560; darn=lists.postgresql.org; h=cc:to:subject:message-id:date:from:in-reply-to:references :mime-version:from:to:cc:subject:date:message-id:reply-to; bh=oXhF1Dpj8ObxLAB4jnV0wluxCZ/Noy/H5DPTJE6SPO0=; b=tJIxFjsKdW3YR8GXJcRMFvziT95fgzw6TWj9cSdJKygDjV5a8+CjWITvtlB8RhEr9j iI5HCRvNTldOlgKez7QdJUAi2G5MaAzkHAEs0LMoX8tA/uRPvf9gl4VKHCIealTY9Tyu LyNYoGj06oIKJaycNqWXcC4ZoaeuVClnIsVwNT9ocvryNny4iDQjRxW8s9HnfTlEPMDz vZx+ihl6PduzBiqGJeTSO0+7jFj5/wo3fH+EgXOWbTGs7bbknMoVVsWs7OgnSDZv4CLC ib3ZTNfI7GfcbKJuD7Njsl0p8nsuta+kzCQX07QVGvpdezjcWov/8+utP/UK17aL16Lm Tosw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1774349760; x=1774954560; h=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=oXhF1Dpj8ObxLAB4jnV0wluxCZ/Noy/H5DPTJE6SPO0=; b=No+EVXyPFTa66nUKnNN/dQ2HQwras5YZW3zqQPKWzBifyVZwJLMk61m1/Iq/bJQg3C Nrf0ms+eotHfSDai03k4JXU9fAEsGUsAXDLnpIK0j/4WoSECFyNS4fj2htcaVXpqdIxt Yu62djLlyVTOy7vMLWHjWzhN5/lp8mBj0DeFafgDFCEPACzGXFugFvF14AveWQyF884+ 9Cd9etmnPgVxrSbFCwGjZTFjAQGfvX4iV86OWZ9kp7LO+gXvs3dgQ5m06zMjpok3oXUO TtWZy/Gs1EjMZ/7UaIOND0CxatNaaGVFqShekKLRbRCiEPOO/2qWJRiM5H3ZTmFXLdV4 SRFg== X-Gm-Message-State: AOJu0Yyf/wrkIYmXgI5u4B9v2DUGHOcGZ2pQe4aRSLbqZfaZxXmxcz47 keAtrmvcqKTP1vZN6PtaNYS8XLZAymPZBFy9YS6T+HWvjmEOTuypZIbbYqDwC5eF6V9BIINVSbj ONiQDs6+fjBcgqws4xXsJtJRttVXzhlE= X-Gm-Gg: ATEYQzziqIXNtGJ6Olm1pPJ5UQxpl5gPjE6wQJLV/mIDSv4tEXMkqV+W0n2KTuaD2SK atl3Im1nbF+1zlvykcqmgv4te5ZQyDOtWittxFzjZkFvHz/FkgFmDWrPfQlK8qNM9Be748mrUUA Bte7xf7rnyCeYCROiR/4S8YPA95zuM7esO8/IYcYxVJB06C4PE/6DJg/PplvF8Oulo1fUxpm/uG I7sBvjvOrAxGgxrniuww/PHoVAlrzyTsZ8dgofZW++onlbinU9c28kikegiyoeR3fvhY7l2tlQt jt91rbSQ3tnfge18txTXiG3tC0vFud0dRLi/W7OGrLQsu68DoyveGHu8SuJetrKEGDPOyKvjp9H P1GNFe9XLJtAimYA8OFJ5+5SGGIw= X-Received: by 2002:a05:6102:4a8f:b0:5fd:ff75:f41d with SMTP id ada2fe7eead31-602aecd1c9fmr5283685137.24.1774349759530; Tue, 24 Mar 2026 03:55:59 -0700 (PDT) MIME-Version: 1.0 References: <4703.1774250534@localhost> In-Reply-To: <4703.1774250534@localhost> From: Srinath Reddy Sadipiralla Date: Tue, 24 Mar 2026 16:25:47 +0530 X-Gm-Features: AQROBzAfwwb3NXKIT3AjcDo8_E7MUfvWvoZOV4yZiP2kK3dKzgcFdCGCacFcxso Message-ID: Subject: Re: Teach isolation tester about injection points in background workers To: Antonin Houska Cc: pgsql-hackers@lists.postgresql.org Content-Type: multipart/alternative; boundary="0000000000001fc8f5064dc2fffa" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000001fc8f5064dc2fffa Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Antonin, On Mon, Mar 23, 2026 at 12:52=E2=80=AFPM Antonin Houska wr= ote: > I hit a limitation of the isolation tester when trying to reproduce a bug > in > REPACK (CONCURRENTLY) [1]: it does not recognize that session is blocked > due > to background worker waiting on an injection point. This patch tries to f= ix > that. > +1. I was thinking can we move the logic of checking if bg workers are the reason of blocking the main backend inside pg_isolation_test_session_is_blocked to make it cleaner, and regarding "XXX Should we use a separate query for that?" i am confused here IIUC if we keep it as 1 query using UNION every time its for sure that both the queries will run, which can increase more execution time but less libpq/socket calls, but if we send as 2 queries if 1st query doesn't returns true we have to go and check the other query, so here if 2 queries ran then execution + libpq/socket calls overhead, so i am slightly inclined towards separating the queries , so that if 1st gets satisfied then we don't touch the 2nd query at all, please correct me if i am wrong here := ) --=20 Thanks, Srinath Reddy Sadipiralla EDB: https://www.enterprisedb.com/ --0000000000001fc8f5064dc2fffa Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi=C2=A0Antonin,

On = Mon, Mar 23, 2026 at 12:52=E2=80=AFPM Antonin Houska <ah@cybertec.at> wrote:
I hit a limitation of the isolation tester wh= en trying to reproduce a bug in
REPACK (CONCURRENTLY) [1]: it does not recognize that session is blocked du= e
to background worker waiting on an injection point. This patch tries to fix=
that.

+1. I was thinking can we move the logic of = checking if bg workers are the
reason of blocking the main backend insid= e=C2=A0pg_isolation_test_session_is_blocked
to make it cleaner, and rega= rding "XXX Should we use a separate query for that?"
i am conf= used here IIUC if we keep it as 1 query using UNION every time its for sure=
that both the queries will run, which can increase more execution time = but less libpq/socket
calls, but if we send as 2 queries if 1st query do= esn't returns true we have to go and
check the other query, so here = if 2 queries ran then execution=C2=A0+ libpq/socket calls overhead,
so i= am slightly inclined towards separating the queries , so that if 1st gets = satisfied then
we don't touch the 2nd query at all, please correct m= e if i am wrong here :)



--
Thanks,
Srinath Reddy Sadipiralla
EDB:=C2=A0https://www.enterprisedb.com/
--0000000000001fc8f5064dc2fffa--