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 1w1q6k-000eJ5-2I for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Mar 2026 18:22:35 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1w1q6i-005K81-1v for pgsql-hackers@arkaria.postgresql.org; Sun, 15 Mar 2026 18:22:33 +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 1w1q6i-005K7q-0j for pgsql-hackers@lists.postgresql.org; Sun, 15 Mar 2026 18:22:33 +0000 Received: from mail-yw1-x112f.google.com ([2607:f8b0:4864:20::112f]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1w1q6g-00000000Igw-1bde for pgsql-hackers@postgresql.org; Sun, 15 Mar 2026 18:22:32 +0000 Received: by mail-yw1-x112f.google.com with SMTP id 00721157ae682-78fc4425b6bso36446627b3.1 for ; Sun, 15 Mar 2026 11:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1773598947; cv=none; d=google.com; s=arc-20240605; b=BRi965KfX+4Jb0IjwK8TBxPiEMJ8Lj2F76PTZiHLUz0tbtKgIEoM0YxeIVRD7twEz/ qvyoT2AAMoF3Ds8sBd92PiwhEQM6pzjvEaoJVpwh6NAV506arGkdGIRjvtGUc6ay0A5H kf0f43MhVtyikJ2P2Ngc+g5dZ6SniBM1hiy9hNbMRu20lEhqxmgC5Zq4vkeyOOcVBKFI x0NfGIt9si2OkthUMHZrUs4PogBBlVB1SsvJtMEBndEzJGVGmyZ+LThbVCd0CY6zl70j 5Eyp8rr9tPpaUIBg0nnofRFNUqskKecRzFMXiympMyK0kXfKV7b9RB42maO0azEWqh2c jajA== 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=D1FGuY7G98231e4iDThNwinFmv6nP9CMn+LOJTsoops=; fh=JZIm6qiecLehGw4wP3bZnO31jM2KwwkL0JU9eYecFHA=; b=YSmZ3K8T5FdaQ1BitD/GxAfYNPsF/qxxgIaXSnan3Pi7PGy7deZBrpFPUZXNmdoJHI BK76ukHDYlRhpb6IwetgyuLNVbp8mDLB52mtYWAv1D3FHf5n+aolA48G8h80+sLVF1yR YX71irnQIUagnNIozZRp9TklHlOE/Qd0OYg1qIxv377NwV1XaLhVoBX08O1Zwh5yo3uR l5phSv7du00BnvwGgX085t5DVEoiAPa21O6V0VAcx04LkKFO6/7OE3RT0TtCB/aibWX3 0u1bsB//XVOyIo3EGRIkXsfvalXgZnRjiNIrmvK6rlBXVkWkaC5FJAhtOlRmTZAfyUIv 9W1A==; 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=20230601; t=1773598947; x=1774203747; darn=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=D1FGuY7G98231e4iDThNwinFmv6nP9CMn+LOJTsoops=; b=YdhTOCghUMyYKUq1J1CWqceGU0pfTQfsQvsY9ss0EzpF17jBJC+nIvOC7XWPKjkGvu Bfa1KxEfIXwl829Bxs0kxVu3rkdcSJ9sfQBVM0I3xojY7xBV8QEQ0iahlIIjb8EBpM7H w49jGyXavFC3kdesjFSPJ3l3wtUiQIKtR6p2cn7Qa+0BKK82ytlpo5WZxKq1heHw3HY/ oXzxCkVrVOGZ7UfPQN3xz+o/am0n5a8atCVkCWABSsoj1VPMULPo2Ri4hqxfHuLaSUrA MtEgt/zTP/BM/uOW67KfHuuHi5rniIpCOsyYLHiG519kSavOgRvGnbw/MAj99tiA1W8K 4x5g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1773598947; x=1774203747; 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=D1FGuY7G98231e4iDThNwinFmv6nP9CMn+LOJTsoops=; b=XXRPaWTMYTWBMlHSioQ6VTbfZxpR/0xHxN1BAWfV8OpTUz8qWzpAXH4o+hdRByj13f WmQdXOBai0qDUolyxTa/nckVSAL6JarO4V+aXRSwgPx+68TIMK2aiG8sD7YIfmK/wNuI xb26lr25mHVnETke9XepdEUig74841wVg2Wv3CVIm/CESKow3D6OlbYQ3IzV5hDOejQp UNPe6c3KUOSBLDU3I2JObvPkWJq+o/F2hPZ6BXYmjMz/xo0rboWZNLo/+LQOIjIw3ZNF +Nl2wQUFbAMpIw/QwBd7GDX2vLo1U9bqIg02bLwC29ZG8X3NObsjbNcjfvljtXFTHZc4 0QhQ== X-Gm-Message-State: AOJu0YxrtYDUb9LahAlgZGwhyam7npgbQlLdl+0Iyd0tuRklaNVPcwXu 1ddrv0A4KsQTSqfbT/sc41h9DelJ9uDzlynjhqXJDwLnrQzBgB+JtLdtEuYA9sMGyZYxsZT48Wp m35rS6jRGEMZrLjQSmf80n8MJE0n9MEcqfjku0J8= X-Gm-Gg: ATEYQzwDuGdDteyI75OdbENOnqwS8uyLeDI8EY0+e3bQXiMsz0Ym7cJBptN3/WdP7Es knVX1gCra28CKKrP3kHb6PP++uygscqWVuv09ljgUXTB9+FZ23AoEIOVsr1a+UY/sOgqhGHhnRy HJOnH9WnbCle0AGCd2Q2DxMl1HIbXfsv5LWFBEETagCgF7PqkBRpt84MGlcWaiZUFsprFFL7wBP 6qd0FDP1Nt/WeuYqczsHvXZUHe/sGcO9IZJQG+AumDKeLyWyID0mRoKipo2euRxcqxizioD9tNV o1UmZuw= X-Received: by 2002:a05:690c:17:b0:79a:4419:71be with SMTP id 00721157ae682-79a44197992mr22393787b3.58.1773598947477; Sun, 15 Mar 2026 11:22:27 -0700 (PDT) MIME-Version: 1.0 References: In-Reply-To: From: Lakshmi N Date: Sun, 15 Mar 2026 11:22:16 -0700 X-Gm-Features: AaiRm52Bhfd6p3wIqOI4zodVX6SSaHxn18wKm8EJY8smU0nTlyKEBFzrNH9TjmE Message-ID: Subject: Re: Add missing CHECK_FOR_INTERRUPTS calls in dblink module To: Kirill Reshke Cc: pgsql-hackers@postgresql.org Content-Type: multipart/alternative; boundary="0000000000003d0b97064d142fb2" List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --0000000000003d0b97064d142fb2 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable Hi Kirill, Apologies for the delay in responding. On Tue, Mar 10, 2026 at 2:25=E2=80=AFAM Kirill Reshke wrote: > > Hi! > Are you trying to fix any real problem? So, do you have any reproduces > where dblink stucks while processing tuples? I am somehow surprised if > we do not have CFI somewhere inside tuplestore_puttuple... > This can be reproduced when iteration over millions of tuples, particularly when the tuples spill to a temp file on disk. I added pg_usleep(1000L) before the end of the loop to have a predictable repro, which looks like no CFI in tuplestore_puttuple. Tested with the below queries to verify the behavior (which should trigger temp IO). SET work_mem =3D '64kB'; SELECT dblink_connect('myconn', 'dbname=3D' || current_database()); SELECT dblink_open('myconn', 'mycursor', 'SELECT i, repeat(''x'', 1024) FROM generate_series(1, 100000) i'); explain analyze SELECT * FROM dblink_fetch('myconn', 'mycursor', 100000) AS t(i int, pad text); SELECT dblink_close('myconn', 'mycursor'); SELECT dblink_disconnect('myconn'); RESET work_mem; Regards, Lakshmi --0000000000003d0b97064d142fb2 Content-Type: text/html; charset="UTF-8" Content-Transfer-Encoding: quoted-printable
Hi Kirill,

Apologies f= or the delay in responding.

On Tue, Mar 10, 2026= at 2:25=E2=80=AFAM Kirill Reshke <reshkekirill@gmail.com> wrote:

Hi!
Are you trying to fix any real problem? So, do you have any reproduces
where dblink stucks while processing tuples? I am somehow surprised if
we do not have CFI somewhere inside tuplestore_puttuple...
=

This can be reproduced when iteration over millions of = tuples, particularly when the tuples spill to a temp file on disk.
I added pg_usleep(1000L) before the end of the loop to have a predictable= =C2=A0repro, which looks=C2=A0like no CFI in tuplestore_puttuple.
Tested with the below queries to verify the behavior (which should trigger= temp IO).

SET work_mem =3D '64kB';
SEL= ECT dblink_connect('myconn', 'dbname=3D' || current_databas= e());
SELECT dblink_open('myconn', 'mycursor', 'SELE= CT i, repeat(''x'', 1024) FROM generate_series(1, 100000) i= ');
explain analyze SELECT * FROM dblink_fetch('myconn', = 9;mycursor', 100000) AS t(i int, pad text);
SELECT dblink_close('= ;myconn', 'mycursor');
SELECT dblink_disconnect('myconn&= #39;);
RESET work_mem;

Regards,
Laksh= mi


--0000000000003d0b97064d142fb2--