pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Andrew Gierth <andrew@tao11.riddles.org.uk>
To: pgsql-bugs@lists.postgresql.org
To: lars.vonk@gmail.com
Subject: Re: BUG #15074: psql client never returns when creating index (long running operation)
Date: Mon, 19 Feb 2018 12:27:26 +0000
Message-ID: <87h8qdp3qr.fsf@news-spur.riddles.org.uk> (raw)
In-Reply-To: <151902880834.1393.3975169520725435333@wrigleys.postgresql.org>
References: <151902880834.1393.3975169520725435333@wrigleys.postgresql.org>

>>>>> "PG" == PG Bug reporting form <noreply@postgresql.org> writes:

 PG> When creating an index on a table containing approx. 100M records
 PG> the psql client never returns when the index is eventually created
 PG> on the server. This happens both in a psql client (9.6.6) on mac
 PG> osx and using the libpq client via the ruby pg gem when using
 PG> active records migrations.

 PG> When running the command directly op the postgres database server
 PG> using the psql client it works as expected.

 PG> The logs from the server:
 PG> 2018-02-16 16:11:05 CET:82.161.205.254(59584):REDACTED@REDACTED_DB:[23141]:
 PG> LOG:  duration: 999618.165 ms
 PG> 2018-02-16 16:11:05 CET:82.161.205.254(59584):REDACTED@REDACTED_DB:[23141]:
 PG> LOG:  could not receive data from client: Connection reset by peer

This looks like a network issue; most likely you have a NAT or stateful
firewall in between the client and server which is dropping idle
connections, with a timeout set shorter than your keepalive interval on
either client or server.

The server gets "connection reset" because it tried to send the result
of the statement, plus the "ready for query" message, and the
NAT/firewall sent back a reset because it no longer recognized the
connection as valid. The psql client itself continues to wait for input
(and will do so until the keepalive timeout is reached if keepalive is
enabled, otherwise indefinitely) because the NAT/firewall doesn't
typically send any proactive reset messages.

-- 
Andrew (irc:RhodiumToad)




view thread (6+ messages)  latest in thread

Message-ID: <87h8qdp3qr.fsf@news-spur.riddles.org.uk>
Permalink:  ../87h8qdp3qr.fsf@news-spur.riddles.org.uk/
Also on:    postgresql.org/message-id/87h8qdp3qr.fsf@news-spur.riddles.org.uk

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-bugs@postgresql.org
  Cc: andrew@tao11.riddles.org.uk, lars.vonk@gmail.com
  Subject: Re: BUG #15074: psql client never returns when creating index (long running operation)
  In-Reply-To: <87h8qdp3qr.fsf@news-spur.riddles.org.uk>
  References: <151902880834.1393.3975169520725435333@wrigleys.postgresql.org> <87h8qdp3qr.fsf@news-spur.riddles.org.uk>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox