public inbox for [email protected]
help / color / mirror / Atom feedFrom: David G. Johnston <[email protected]>
To: jiye <[email protected]>
Cc: [email protected] <[email protected]>
Subject: Re: FDW connection drops with "Connection timed out" during async append query due to TCP receive buffer filling up
Date: Tue, 10 Mar 2026 22:30:03 -0700
Message-ID: <CAKFQuwYcEvfna4HUkG9VkX0cR_xbRRhT_0qDaAHhrJ4UX0EW-g@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <[email protected]>
On Tuesday, March 10, 2026, jiye <[email protected]> wrote:
>
> This is a minimal working example. In practice, if the local table scan
> takes too long and the foreign table has sufficiently wide rows, this issue
> may reproduce.
> In my understanding, when performing a local sequential scan, the
> PostgreSQL backend fetches data from the local plan without fetching any
> data from the FDW. As a result, the TCP receive buffer may become full,
> causing the FDW connection to be disconnected.
> I believe this is a minor issue. How can I resolve this problem?
>
Do not establish a timeout that the execution of the query cannot beat.
Or, I think, at least ensure the non-async portion of the query can produce
a row within the allotted time so the async node is polled within the
timeout. IIUC, the general loop flow is: begin append, begin async, poll
async, poll non-async, poll async, poll non-async, etc…. There will usually
be some lag between async polls. The tcp timeout has to be large enough to
accommodate your reality. No different than if you used a statement
timeout.
I don’t actually know whether or if “buffer filling up” is accurate or
relevant here. It doesn’t seem that way. You haven’t demonstrated that
scenario here, just a timeout being reached.
https://github.com/postgres/postgres/blob/82467f627bd478569de04f4a3f1993098e80c812/src/backend/execu...
And since the main design point of async is that any of them may be polled
at any time it is necessary for all such scans to be initialized before any
polling begins. Starting the clock on all of them.
If you don’t want a connection timeout to happen do not set one. That’s
the resolution here so far as I can tell.
David J.
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: FDW connection drops with "Connection timed out" during async append query due to TCP receive buffer filling up
In-Reply-To: <CAKFQuwYcEvfna4HUkG9VkX0cR_xbRRhT_0qDaAHhrJ4UX0EW-g@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox