pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Michal Merta <michal.merta@greycortex.com>
To: pgsql-general@lists.postgresql.org
Subject: Deadlock while doing VACUUM and DROP
Date: Wed, 24 Oct 2018 15:53:29 +0200
Message-ID: <21fe894d-4fb8-974d-cdd6-2b252852ce76@greycortex.com> (raw)

Hello everyone,

I encountered deadlock during DROP TABLE statement:

2018-10-23 14:49:55 CEST psql > ERROR:  deadlock detected
2018-10-23 14:49:55 CEST psql > DETAIL:  Process 89171 waits for 
AccessExclusiveLock on relation 17582 of database 16390; blocked by 
process 50837.
         Process 50837 waits for AccessShareLock on relation 20767 of 
database 16390; blocked by process 89171.
         Process 89171: DROP TABLE IF EXISTS sm.tasks;
         Process 50837: autovacuum: ANALYZE sm.tasks


This happenend CentOS 7 with Linux kernel 3.10.0-693 using PostgreSQL 9.6.6.

There was discussion about similar issue without any conclusions 10 
years ago, I'm not sure whether it's a bug or some documented behaviour.

https://www.postgresql.org/message-id/flat/482CCD42.1060705%40students.mimuw.edu.pl


Is there anything I can do make sure that DDL statement won't be 
canceled due to collision with autovaccum?


Regards,
Michal Merta






view thread (2+ messages)  latest in thread

Message-ID: <21fe894d-4fb8-974d-cdd6-2b252852ce76@greycortex.com>
Permalink:  ../21fe894d-4fb8-974d-cdd6-2b252852ce76@greycortex.com/
Also on:    postgresql.org/message-id/21fe894d-4fb8-974d-cdd6-2b252852ce76@greycortex.com

 · 

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-general@postgresql.org
  Cc: michal.merta@greycortex.com
  Subject: Re: Deadlock while doing VACUUM and DROP
  In-Reply-To: <21fe894d-4fb8-974d-cdd6-2b252852ce76@greycortex.com>
  References: <21fe894d-4fb8-974d-cdd6-2b252852ce76@greycortex.com>

* 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