pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: PG Bug reporting form <noreply@postgresql.org>
To: pgsql-bugs@lists.postgresql.org
Cc: vyegorov@gmail.com
Subject: BUG #15290: Stuck Parallel Index Scan query
Date: Sun, 22 Jul 2018 18:30:29 +0000
Message-ID: <153228422922.1395.1746424054206154747@wrigleys.postgresql.org> (raw)

The following bug has been logged on the website:

Bug reference:      15290
Logged by:          Victor Yegorov
Email address:      vyegorov@gmail.com
PostgreSQL version: 10.4
Operating system:   Debian GNU/Linux 8.7 (jessie)
Description:        

We've just encountered an issue on the streaming replica of the client.

In short — query is active for 8 hours and we're not able to terminate it:
all processes (leader and workers) are ignoring all signals.
Symptoms are similar to the ones described in #15036. As a result, we had to
perform immediate shutdown f the instance.
After restart we've got another such stuck query within minutes, so it's not
a single occurrence..


Query in subject
----------------
-[ RECORD 1
]-----------------------------------------------------------------------------------------------------
ts_age      | 08:32:17.286343
state       | active
query_age   | 08:32:17.286345
change_age  | 08:32:17.286344
datname     | coub
pid         | 2877
usename     | app
waiting     | f
client_addr |
client_port | -1
query       | select count(*) as value from coubs where type='Coub::Simple'
and is_done=false and in_process=false

                                                             QUERY PLAN
-------------------------------------------------------------------------------------------------------------------------------------
 Finalize Aggregate  (cost=666001.67..666001.72 rows=1 width=8)
   ->  Gather  (cost=666001.20..666001.65 rows=8 width=8)
         Workers Planned: 8
         ->  Partial Aggregate  (cost=665901.20..665901.25 rows=1 width=8)
               ->  Parallel Index Scan using
coubs_type_is_done_partial_simple on coubs  (cost=0.56..663016.01
rows=1154077 width=0)
                     Index Cond: (is_done = false)
                     Filter: ((NOT is_done) AND (NOT in_process))
(7 rows)

In reality this query worked with just 4 workers:
 2877 ?        ts     0:08  \_ postgres: 10/main: app coub [local] SELECT
 3416 ?        Ss     0:00  \_ postgres: 10/main: bgworker: parallel worker
for PID 2877
 3417 ?        Ss     0:00  \_ postgres: 10/main: bgworker: parallel worker
for PID 2877
 3418 ?        Ss     0:00  \_ postgres: 10/main: bgworker: parallel worker
for PID 2877
 3419 ?        Ss     0:00  \_ postgres: 10/main: bgworker: parallel worker
for PID 2877

We have backtraces of the main process and all workers, and also
`pg_stat_activity` snapshot — I will attach them to the new e-mail.



view thread (16+ messages)  latest in thread

Message-ID: <153228422922.1395.1746424054206154747@wrigleys.postgresql.org>
Permalink:  ../153228422922.1395.1746424054206154747@wrigleys.postgresql.org/
Also on:    postgresql.org/message-id/153228422922.1395.1746424054206154747@wrigleys.postgresql.org

 · 

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: pgsql-bugs@postgresql.org
  Cc: noreply@postgresql.org, pgsql-bugs@lists.postgresql.org, vyegorov@gmail.com
  Subject: Re: BUG #15290: Stuck Parallel Index Scan query
  In-Reply-To: <153228422922.1395.1746424054206154747@wrigleys.postgresql.org>

* 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