pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
killing vacuum analyze process
5+ messages / 3 participants
[nested] [flat]

* killing vacuum analyze process
@ 2019-09-03 23:02 Julie Nishimura <juliezain@hotmail.com>
  2019-09-03 23:11 ` Re: killing vacuum analyze process Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 1 reply; 5+ messages in thread

From: Julie Nishimura @ 2019-09-03 23:02 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>; pgsql-general

Hello there,
PostgreSQL 9.6.2 on x86_64-pc-linux-gnu
It seems like we have one process running since 8/19. Is it any repercussion if we kill it?

postgres=# select * from pg_stat_activity where pid = '18986';
-[ RECORD 1 ]----+-------------------------------------------------------------------------
datid            | 2342921
datname          | symphony_middleware
pid              | 18986
usesysid         | 10
usename          | postgres
application_name |
client_addr      |
client_hostname  |
client_port      |
backend_start    | 2019-08-19 02:00:59.683198+00
xact_start       | 2019-08-19 02:03:54.191741+00
query_start      | 2019-08-19 02:03:54.191741+00
state_change     | 2019-08-19 02:03:54.191742+00
wait_event_type  | BufferPin
wait_event       | BufferPin
state            | active
backend_xid      |
backend_xmin     | 1075730757
query            | autovacuum: VACUUM ANALYZE public.resource_build (to prevent wraparound)

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: killing vacuum analyze process
  2019-09-03 23:02 killing vacuum analyze process Julie Nishimura <juliezain@hotmail.com>
@ 2019-09-03 23:11 ` Tom Lane <tgl@sss.pgh.pa.us>
  2019-09-03 23:29   ` Re: killing vacuum analyze process Julie Nishimura <juliezain@hotmail.com>
  0 siblings, 1 reply; 5+ messages in thread

From: Tom Lane @ 2019-09-03 23:11 UTC (permalink / raw)
  To: Julie Nishimura <juliezain@hotmail.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Julie Nishimura <juliezain@hotmail.com> writes:
> PostgreSQL 9.6.2 on x86_64-pc-linux-gnu
> It seems like we have one process running since 8/19. Is it any repercussion if we kill it?

> postgres=# select * from pg_stat_activity where pid = '18986';
> -[ RECORD 1 ]----+-------------------------------------------------------------------------
> datid            | 2342921
> datname          | symphony_middleware
> pid              | 18986
> usesysid         | 10
> usename          | postgres
> application_name |
> client_addr      |
> client_hostname  |
> client_port      |
> backend_start    | 2019-08-19 02:00:59.683198+00
> xact_start       | 2019-08-19 02:03:54.191741+00
> query_start      | 2019-08-19 02:03:54.191741+00
> state_change     | 2019-08-19 02:03:54.191742+00
> wait_event_type  | BufferPin
> wait_event       | BufferPin
> state            | active
> backend_xid      |
> backend_xmin     | 1075730757
> query            | autovacuum: VACUUM ANALYZE public.resource_build (to prevent wraparound)

Since this is an anti-wraparound vacuum, autovacuum is just going to
launch another one pretty soon if you kill this one.  Assuming that
the buffer pin blockage is real and not some kind of broken shared
memory state, the new one will hang up at the same spot.  You'd be
better advised to find out what's pinning that buffer and kill that.

Admittedly this is easier said than done, since there's not much
infrastructure for seeing what's happening at that level.  But you
could look for transactions that are at least as old as this one and
have some kind of lock on that table (according to pg_locks).

If there are no such transactions, then the corrupt-shared-memory
hypothesis becomes likely, and a postmaster restart is indicated.

BTW, you really ought to be running something newer than 9.6.2.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: killing vacuum analyze process
  2019-09-03 23:02 killing vacuum analyze process Julie Nishimura <juliezain@hotmail.com>
  2019-09-03 23:11 ` Re: killing vacuum analyze process Tom Lane <tgl@sss.pgh.pa.us>
@ 2019-09-03 23:29   ` Julie Nishimura <juliezain@hotmail.com>
  2019-09-04 00:19     ` Re: killing vacuum analyze process Ron <ronljohnsonjr@gmail.com>
  2019-09-04 03:56     ` Re: killing vacuum analyze process Tom Lane <tgl@sss.pgh.pa.us>
  0 siblings, 2 replies; 5+ messages in thread

From: Julie Nishimura @ 2019-09-03 23:29 UTC (permalink / raw)
  To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Thank you Tom. I can see bunch of old processes running ROLLBACK... Should I kill them or they only way to clear those is to restart the server?

postgres=# select * from pg_stat_activity where datname ='symphony_middleware' and  query_start < '08/20/2019' and query like '%ROLLBACK%';
  datid  |       datname       |  pid   | usesysid |       usename       | application_name | client_addr  | client_hostname | client_port |         backend_start         | xact_start |          query_start          |         state_change          | wait_event_type | wait_event | state | backend_xid | backend_xmin |  query
---------+---------------------+--------+----------+---------------------+------------------+--------------+-----------------+-------------+-------------------------------+------------+-------------------------------+-------------------------------+-----------------+------------+-------+-------------+--------------+----------
 2342921 | symphony_middleware |  72165 |    16407 | symphony_middleware |                  | 10.24.33.226 |                 |       37252 | 2019-06-04 13:17:56.204483+00 |            | 2019-06-24 13:51:52.834401+00 | 2019-06-24 13:51:52.834479+00 |                 |            | idle  |             |              | ROLLBACK
 2342921 | symphony_middleware | 159407 |    16407 | symphony_middleware |                  | 10.24.33.6   |                 |       45482 | 2019-07-29 16:23:36.271366+00 |            | 2019-08-16 18:28:27.924116+00 | 2019-08-16 18:28:27.92419+00  |                 |            | idle  |             |              | ROLLBACK
 2342921 | symphony_middleware | 135443 |    16407 | symphony_middleware |                  | 10.24.33.226 |                 |       47712 | 2019-05-31 16:17:55.143017+00 |            | 2019-08-13 15:17:01.685057+00 | 2019-08-13 15:17:01.685103+00 |                 |            | idle  |             |              | ROLLBACK
 2342921 | symphony_middleware | 135442 |    16407 | symphony_middleware |                  | 10.24.33.226 |                 |       47710 | 2019-05-31 16:17:55.132574+00 |            | 2019-08-13 15:17:32.973151+00 | 2019-08-13 15:17:32.97322+00  |                 |            | idle  |             |              | ROLLBACK
 2342921 | symphony_middleware | 135440 |    16407 | symphony_middleware |                  | 10.24.33.226 |                 |       47706 | 2019-05-31 16:17:55.082091+00 |            | 2019-06-24 17:23:15.519127+00 | 2019-06-24 17:23:15.519181+00 |                 |            | idle  |             |              | ROLLBACK
 2342921 | symphony_middleware |  38211 |    16407 | symphony_middleware |                  | 10.24.33.6   |                 |       43318 | 2019-06-04 10:33:19.742976+00 |            | 2019-06-24 17:23:09.212067+00 | 2019-06-24 17:23:09.212117+00 |                 |            | idle  |             |              | ROLLBACK
 2342921 | symphony_middleware | 136304 |    16407 | symphony_middleware |                  | 10.24.33.6   |                 |       51012 | 2019-05-31 16:20:23.911493+00 |            | 2019-08-19 10:17:33.284189+00 | 2019-08-19 10:17:33.284256+00 |                 |            | idle  |             |              | ROLLBACK
(7 rows)

________________________________
From: Tom Lane <tgl@sss.pgh.pa.us>
Sent: Tuesday, September 3, 2019 4:11 PM
To: Julie Nishimura <juliezain@hotmail.com>
Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
Subject: Re: killing vacuum analyze process

Julie Nishimura <juliezain@hotmail.com> writes:
> PostgreSQL 9.6.2 on x86_64-pc-linux-gnu
> It seems like we have one process running since 8/19. Is it any repercussion if we kill it?

> postgres=# select * from pg_stat_activity where pid = '18986';
> -[ RECORD 1 ]----+-------------------------------------------------------------------------
> datid            | 2342921
> datname          | symphony_middleware
> pid              | 18986
> usesysid         | 10
> usename          | postgres
> application_name |
> client_addr      |
> client_hostname  |
> client_port      |
> backend_start    | 2019-08-19 02:00:59.683198+00
> xact_start       | 2019-08-19 02:03:54.191741+00
> query_start      | 2019-08-19 02:03:54.191741+00
> state_change     | 2019-08-19 02:03:54.191742+00
> wait_event_type  | BufferPin
> wait_event       | BufferPin
> state            | active
> backend_xid      |
> backend_xmin     | 1075730757
> query            | autovacuum: VACUUM ANALYZE public.resource_build (to prevent wraparound)

Since this is an anti-wraparound vacuum, autovacuum is just going to
launch another one pretty soon if you kill this one.  Assuming that
the buffer pin blockage is real and not some kind of broken shared
memory state, the new one will hang up at the same spot.  You'd be
better advised to find out what's pinning that buffer and kill that.

Admittedly this is easier said than done, since there's not much
infrastructure for seeing what's happening at that level.  But you
could look for transactions that are at least as old as this one and
have some kind of lock on that table (according to pg_locks).

If there are no such transactions, then the corrupt-shared-memory
hypothesis becomes likely, and a postmaster restart is indicated.

BTW, you really ought to be running something newer than 9.6.2.

                        regards, tom lane

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: killing vacuum analyze process
  2019-09-03 23:02 killing vacuum analyze process Julie Nishimura <juliezain@hotmail.com>
  2019-09-03 23:11 ` Re: killing vacuum analyze process Tom Lane <tgl@sss.pgh.pa.us>
  2019-09-03 23:29   ` Re: killing vacuum analyze process Julie Nishimura <juliezain@hotmail.com>
@ 2019-09-04 00:19     ` Ron <ronljohnsonjr@gmail.com>
  1 sibling, 0 replies; 5+ messages in thread

From: Ron @ 2019-09-04 00:19 UTC (permalink / raw)
  To: pgsql-general@lists.postgresql.org

Those are all idle.  I've got a cron job to kill all idle processes more 
than 60 (or 30, I don't remember) minutes old.

On 9/3/19 6:29 PM, Julie Nishimura wrote:
> Thank you Tom. I can see bunch of old processes running ROLLBACK... Should 
> I kill them or they only way to clear those is to restart the server?
>
> postgres=# select * from pg_stat_activity where datname 
> ='symphony_middleware' and  query_start < '08/20/2019' and query like 
> '%ROLLBACK%';
>   datid  |       datname       |  pid   | usesysid |   usename       | 
> application_name | client_addr  | client_hostname | client_port |         
> backend_start   | xact_start |          query_start          | 
> state_change          | wait_event_type | wait_event | state | backend_xid 
> | backend_xmin |  query
> ---------+---------------------+--------+----------+---------------------+------------------+--------------+-----------------+-------------+-------------------------------+------------+-------------------------------+-------------------------------+-----------------+------------+-------+-------------+--------------+----------
>  2342921 | symphony_middleware |  72165 |    16407 | symphony_middleware | 
>                  | 10.24.33.226 |             |       37252 | 2019-06-04 
> 13:17:56.204483+00 |            | 2019-06-24 13:51:52.834401+00 | 
> 2019-06-24 13:51:52.834479+00 |                 |            | idle  |     
>         |              | ROLLBACK
>  2342921 | symphony_middleware | 159407 |    16407 | symphony_middleware | 
>                  | 10.24.33.6   |             |       45482 | 2019-07-29 
> 16:23:36.271366+00 |            | 2019-08-16 18:28:27.924116+00 | 
> 2019-08-16 18:28:27.92419+00  |                 |            | idle  |     
>         |              | ROLLBACK
>  2342921 | symphony_middleware | 135443 |    16407 | symphony_middleware | 
>                  | 10.24.33.226 |             |       47712 | 2019-05-31 
> 16:17:55.143017+00 |            | 2019-08-13 15:17:01.685057+00 | 
> 2019-08-13 15:17:01.685103+00 |                 |            | idle  |     
>         |              | ROLLBACK
>  2342921 | symphony_middleware | 135442 |    16407 | symphony_middleware | 
>                  | 10.24.33.226 |             |       47710 | 2019-05-31 
> 16:17:55.132574+00 |            | 2019-08-13 15:17:32.973151+00 | 
> 2019-08-13 15:17:32.97322+00  |                 |            | idle  |     
>         |              | ROLLBACK
>  2342921 | symphony_middleware | 135440 |    16407 | symphony_middleware | 
>                  | 10.24.33.226 |             |       47706 | 2019-05-31 
> 16:17:55.082091+00 |            | 2019-06-24 17:23:15.519127+00 | 
> 2019-06-24 17:23:15.519181+00 |                 |            | idle  |     
>         |              | ROLLBACK
>  2342921 | symphony_middleware |  38211 |    16407 | symphony_middleware | 
>                  | 10.24.33.6   |             |       43318 | 2019-06-04 
> 10:33:19.742976+00 |            | 2019-06-24 17:23:09.212067+00 | 
> 2019-06-24 17:23:09.212117+00 |                 |            | idle  |     
>         |              | ROLLBACK
>  2342921 | symphony_middleware | 136304 |    16407 | symphony_middleware | 
>                  | 10.24.33.6   |             |       51012 | 2019-05-31 
> 16:20:23.911493+00 |            | 2019-08-19 10:17:33.284189+00 | 
> 2019-08-19 10:17:33.284256+00 |                 |            | idle  |     
>         |              | ROLLBACK
> (7 rows)
>
> ----------------------------------------------------------------------------
> *From:* Tom Lane <tgl@sss.pgh.pa.us>
> *Sent:* Tuesday, September 3, 2019 4:11 PM
> *To:* Julie Nishimura <juliezain@hotmail.com>
> *Cc:* pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>
> *Subject:* Re: killing vacuum analyze process
> Julie Nishimura <juliezain@hotmail.com> writes:
> > PostgreSQL 9.6.2 on x86_64-pc-linux-gnu
> > It seems like we have one process running since 8/19. Is it any 
> repercussion if we kill it?
>
> > postgres=# select * from pg_stat_activity where pid = '18986';
> > -[ RECORD 1 
> ]----+-------------------------------------------------------------------------
> > datid            | 2342921
> > datname          | symphony_middleware
> > pid              | 18986
> > usesysid         | 10
> > usename          | postgres
> > application_name |
> > client_addr      |
> > client_hostname  |
> > client_port      |
> > backend_start    | 2019-08-19 02:00:59.683198+00
> > xact_start       | 2019-08-19 02:03:54.191741+00
> > query_start      | 2019-08-19 02:03:54.191741+00
> > state_change     | 2019-08-19 02:03:54.191742+00
> > wait_event_type  | BufferPin
> > wait_event       | BufferPin
> > state            | active
> > backend_xid      |
> > backend_xmin     | 1075730757
> > query            | autovacuum: VACUUM ANALYZE public.resource_build (to 
> prevent wraparound)
>
> Since this is an anti-wraparound vacuum, autovacuum is just going to
> launch another one pretty soon if you kill this one. Assuming that
> the buffer pin blockage is real and not some kind of broken shared
> memory state, the new one will hang up at the same spot.  You'd be
> better advised to find out what's pinning that buffer and kill that.
>
> Admittedly this is easier said than done, since there's not much
> infrastructure for seeing what's happening at that level.  But you
> could look for transactions that are at least as old as this one and
> have some kind of lock on that table (according to pg_locks).
>
> If there are no such transactions, then the corrupt-shared-memory
> hypothesis becomes likely, and a postmaster restart is indicated.
>
> BTW, you really ought to be running something newer than 9.6.2.
>
>                         regards, tom lane

-- 
Angular momentum makes the world go 'round.

^ permalink  raw  reply  [nested|flat] 5+ messages in thread

* Re: killing vacuum analyze process
  2019-09-03 23:02 killing vacuum analyze process Julie Nishimura <juliezain@hotmail.com>
  2019-09-03 23:11 ` Re: killing vacuum analyze process Tom Lane <tgl@sss.pgh.pa.us>
  2019-09-03 23:29   ` Re: killing vacuum analyze process Julie Nishimura <juliezain@hotmail.com>
@ 2019-09-04 03:56     ` Tom Lane <tgl@sss.pgh.pa.us>
  1 sibling, 0 replies; 5+ messages in thread

From: Tom Lane @ 2019-09-04 03:56 UTC (permalink / raw)
  To: Julie Nishimura <juliezain@hotmail.com>; +Cc: pgsql-general@lists.postgresql.org <pgsql-general@lists.postgresql.org>

Julie Nishimura <juliezain@hotmail.com> writes:
> Thank you Tom. I can see bunch of old processes running ROLLBACK... Should I kill them or they only way to clear those is to restart the server?

As Ron pointed out, those processes aren't actually running ROLLBACK;
that was just their last query.  They're idle (and not "idle in
transaction") so in theory they're not holding any locks.

After thinking more about it I realize that the process holding the
buffer pin doesn't have to be as old as the VACUUM; so you probably
should just look at pg_locks and see what else has got a lock on
the table the VACUUM is trying to process.  The hypothetical offender
is probably somewhat old, or you'd not have noticed the blockage,
but we don't have any clear evidence as to how old.

			regards, tom lane





^ permalink  raw  reply  [nested|flat] 5+ messages in thread


end of thread, other threads:[~2019-09-04 03:56 UTC | newest]

Thread overview: 5+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2019-09-03 23:02 killing vacuum analyze process Julie Nishimura <juliezain@hotmail.com>
2019-09-03 23:11 ` Tom Lane <tgl@sss.pgh.pa.us>
2019-09-03 23:29   ` Julie Nishimura <juliezain@hotmail.com>
2019-09-04 00:19     ` Ron <ronljohnsonjr@gmail.com>
2019-09-04 03:56     ` Tom Lane <tgl@sss.pgh.pa.us>

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