vacuumdb parallel has a deadlock detected in 9.5.4

From: huang <foggyglass(at)163(dot)com>
To: pgsql-bugs(at)postgresql(dot)org
Subject: vacuumdb parallel has a deadlock detected in 9.5.4
Date: 2016-09-28 13:46:22
Message-ID: 57EBC9AE.2060302@163.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hi friends,

There is a error deadlock detected in vacuumdb parallel .
but if I do not use parallel , it has not deadlock detected .

[postgres(at)vdedu1 ~]$ vacuumdb -fazev -j 10
SELECT datname FROM pg_database WHERE datallowconn ORDER BY 1;
vacuumdb: vacuuming database "mydb"
SELECT c.relname, ns.nspname FROM pg_class c, pg_namespace ns
WHERE relkind IN ('r', 'm') AND c.relnamespace = ns.oid
ORDER BY c.relpages DESC;
VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_proc;
VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_depend;
VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_attribute;
VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_description;
VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_collation;
VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_statistic;
VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_class;
VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_operator;
VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_rewrite;
VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_type;
ERROR: deadlock detected
DETAIL: Process 19840 waits for AccessShareLock on relation 1249 of
database 16387; blocked by process 19841.
Process 19841 waits for RowExclusiveLock on relation 2608 of
database 16387; blocked by process 19840.
Process 19840: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_depend;
Process 19841: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_attribute;
HINT: See server log for query details.
STATEMENT: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_depend;
vacuumdb: vacuuming of database "mydb" failed: ERROR: deadlock detected
DETAIL: Process 19840 waits for AccessShareLock on relation 1249 of
database 16387; blocked by process 19841.
Process 19841 waits for RowExclusiveLock on relation 2608 of database
16387; blocked by process 19840.
HINT: See server log for query details.
ERROR: canceling statement due to user request
STATEMENT: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_proc;
ERROR: canceling statement due to user request
STATEMENT: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_attribute;
LOG: could not send data to client: Broken pipe
FATAL: connection to client lost
ERROR: canceling statement due to user request
STATEMENT: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_description;
ERROR: canceling statement due to user request
STATEMENT: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_collation;
ERROR: canceling statement due to user request
STATEMENT: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_statistic;
ERROR: canceling statement due to user request
STATEMENT: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_operator;
ERROR: canceling statement due to user request
STATEMENT: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_rewrite;
ERROR: canceling statement due to user request
STATEMENT: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_type;
[postgres(at)vdedu1 ~]$ LOG: could not send data to client: Broken pipe
FATAL: connection to client lost
LOG: could not send data to client: Broken pipe
STATEMENT: VACUUM (FULL, VERBOSE, ANALYZE) pg_catalog.pg_class;
ERROR: canceling statement due to user request
FATAL: connection to client lost
LOG: could not send data to client: Broken pipe
ERROR: canceling statement due to user request
FATAL: connection to client lost

[postgres(at)vdedu1 ~]$
[postgres(at)vdedu1 ~]$ cat /proc/v
version vmallocinfo vmstat
[postgres(at)vdedu1 ~]$ cat /proc/version
Linux version 2.6.32-504.el6.x86_64 (mockbuild(at)c6b9(dot)bsys(dot)dev(dot)centos(dot)org)
(gcc version 4.4.7 20120313 (Red Hat 4.4.7-11) (GCC) ) #1 SMP Wed Oct 15
04:27:16 UTC 2014
[postgres(at)vdedu1 ~]$ vacuumdb --version
vacuumdb (PostgreSQL) 9.5.4
[postgres(at)vdedu1 ~]$ psql -c"select version();"
version

--------------------------------------------------------------------------------
--------------------------
PostgreSQL 9.5.4 on x86_64-pc-linux-gnu, compiled by gcc (GCC) 4.4.7
20120313 (
Red Hat 4.4.7-11), 64-bit
(1 row)

[postgres(at)vdedu1 ~]$

2016-09-28
TT

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message huang 2016-09-28 13:54:41 vacuumdb has a fatal after database rename
Previous Message Tom Lane 2016-09-28 12:37:41 Re: BUG #14341: insert on conflict (key_column) cann't used with partition table.