pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michael Paquier <michael@paquier.xyz>
To: lars.vonk@gmail.com
To: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #15074: psql client never returns when creating index (long running operation)
Date: Mon, 19 Feb 2018 18:21:52 +0900
Message-ID: <20180219092152.GB42340@paquier.xyz> (raw)
In-Reply-To: <151902880834.1393.3975169520725435333@wrigleys.postgresql.org>
References: <151902880834.1393.3975169520725435333@wrigleys.postgresql.org>

On Mon, Feb 19, 2018 at 08:26:48AM +0000, PG Bug reporting form wrote:
> When creating an index on a table containing approx. 100M records the psql
> client never returns when the index is eventually created on the server.  
> This happens both in a psql client (9.6.6) on mac osx and using the libpq
> client via the ruby pg gem when using active records migrations. 

Are you sure that the process got stuck?  Perhaps it was spending a lot
of time processing and you did not wait for it to finish.

> When running the command directly op the postgres database server using the
> psql client it works as expected.
> 
> The logs from the server:
> 2018-02-16 16:11:05 CET:82.161.205.254(59584):REDACTED@REDACTED_DB:[23141]:
> LOG:  duration: 999618.165 ms
> 2018-02-16 16:11:05 CET:82.161.205.254(59584):REDACTED@REDACTED_DB:[23141]:
> LOG:  could not receive data from client: Connection reset by peer
> 
> The psql client just hangs, when trying to cancel the query client side
> (ctrl-c) the server logs says:
> 2018-02-16 16:13:53 CET:82.161.205.254(59961):[unknown]@[unknown]:[25738]:
> LOG:  PID 23141 in cancel request did not match any process

How is defined your schema?  It could be possible that a
CHECK_FOR_INTERRUPTS() added in the code paths where the type of the
index you are creating is involved could help in making the system more
responsive to cancel requests.
--
Michael

Attachments:

  signature.asc (application/pgp-signature, 832B) download

view thread (6+ messages)  latest in thread

Message-ID: <20180219092152.GB42340@paquier.xyz>
Permalink:  ../20180219092152.GB42340@paquier.xyz/
Also on:    postgresql.org/message-id/20180219092152.GB42340@paquier.xyz

 · 

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: michael@paquier.xyz, lars.vonk@gmail.com
  Subject: Re: BUG #15074: psql client never returns when creating index (long running operation)
  In-Reply-To: <20180219092152.GB42340@paquier.xyz>
  References: <151902880834.1393.3975169520725435333@wrigleys.postgresql.org> <20180219092152.GB42340@paquier.xyz>

* 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