Re: Hang issue when COPY to/from an unopened FIFO - Mailing list pgsql-hackers

From Andres Freund
Subject Re: Hang issue when COPY to/from an unopened FIFO
Date
Msg-id 20160714184034.cos4nulxszdlylih@alap3.anarazel.de
Whole thread Raw
In response to Re: Hang issue when COPY to/from an unopened FIFO  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
On 2016-07-14 10:20:42 -0400, Tom Lane wrote:
> Kenan Yao <kyao@pivotal.io> writes:
> > -- mkfifo /tmp/test.dat # bash
> > copy pg_class to '/tmp/test.dat';
> > -- try pg_cancel_backend or pg_terminate_backend from other sessions
> 
> This does not seem like a supported case to me.  I see few if any reasons
> to want to do that rather than doing copy-to-program or copy-to-client.
> We're certainly not going to want to add any overhead to the COPY code
> paths in order to allow it.

Agreed on that.

Said overhead would be a good reason to get rid of using buffered IO at
some point though - we're doing our own buffering anyway, and the stream
code adds noticeable overhead (doubles the cache footprint
basically). Even worse, it uses locking internally on many
platforms... In that case adding sane EINTR handling seems trivial.

Andres



pgsql-hackers by date:

Previous
From: Andres Freund
Date:
Subject: Re: Reviewing freeze map code
Next
From: Andres Freund
Date:
Subject: Re: [PERFORM] 9.4 -> 9.5 regression with queries through pgbouncer on RHEL 6