pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Artur Zając <azajac@ang.com.pl>
To: pgsql-general@lists.postgresql.org
Subject: Table locking during backup
Date: Mon, 7 Oct 2019 23:00:08 +0200
Message-ID: <021f01d57d52$3397e300$9ac7a900$@ang.com.pl> (raw)

Hi,

 

I cannot reproduce some scenario  I found in my PostgreSQL logs.

 

I have two connections/processes:

 

Process 24755 is standard pg_backup connection with:

 

.

BEGIN;
SET TRANSACTION ISOLATION LEVEL REPEATABLE READ, READ ONLY

.

LOCK TABLE gm.tableabc;

.

COPY FROM gm.tableabc

 

Process 5969 is normal connection where I have:

 

LOG: proces 5969 still waiting for AccessExclusiveLock on relations
562888531 of database 16429 after 1000.066 ms

DETAILT: Process holding the lock: 24755. Wait queue: 5969

 

Query that is waiting (from proces 5969) is:

 

CREATE TEMP TABLE IF NOT EXISTS tableabc 

(

Id BIGINT DEFAULT gm.top()

) INHERITS (gm.tableabc);

 

I cannot reproduce what pg_dump is doing that causes waiting on proces 5969
(which lock is acquired and why). When pg_dump ends lock is released and
proces 5969 continues.

 

I know that doing in two parallel connections:

 

BEGIN;

 

CREATE TEMP TABLE IF NOT EXISTS tableabc 

(

Id BIGINT DEFAULT gm.top()

) INHERITS (gm.tableabc);

 

causes  waiting state on second connection until the first finished, but
pg_dump connection is read only. 

 

Could you suggest me which part of pg_dump (which query)  might cause that
behaviour.

 

Artur Zając

view thread (4+ messages)  latest in thread

Message-ID: <021f01d57d52$3397e300$9ac7a900$@ang.com.pl>
Permalink:  ../021f01d57d52$3397e300$9ac7a900$@ang.com.pl/
Also on:    postgresql.org/message-id/021f01d57d52$3397e300$9ac7a900$@ang.com.pl

 · 

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: azajac@ang.com.pl
  Subject: Re: Table locking during backup
  In-Reply-To: <021f01d57d52$3397e300$9ac7a900$@ang.com.pl>
  References: <021f01d57d52$3397e300$9ac7a900$@ang.com.pl>

* 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