![]() | |
![]() |
| | Thread Tools | Display Modes |
#1
| |||
| |||
|
#2
| |||
| |||
|
|
Last night one of these vacuum fulls deadlocked with a query on this table. Both were stuck doing nothing until I did a kill -INT on the backends doing the vacuum. So my questions: 1) What can I do to avoid this? 2) What do I do next time this happens to get more debugging info out of the situation? |
#3
| |||
| |||
|
|
Joseph Shraibman <jks (AT) selectacast (DOT) net> writes: Last night one of these vacuum fulls deadlocked with a query on this table. Both were stuck doing nothing until I did a kill -INT on the backends doing the vacuum. So my questions: 1) What can I do to avoid this? 2) What do I do next time this happens to get more debugging info out of the situation? Look in pg_locks and pg_stat_activity. I think it is highly unlikely that there was a deadlock inside the database. Far more likely that both jobs were waiting on some idle-in-transaction client whose transaction was holding a lock on the table. regards, tom lane |
#4
| |||
| |||
|
|
Why then when I did a kill -INT on the vacuuming backends did everything unfreeze? |
#5
| |||
| |||
|
|
Joseph Shraibman <jks (AT) selectacast (DOT) net> writes: Why then when I did a kill -INT on the vacuuming backends did everything unfreeze? You could have had other stuff backed up behind the VACUUM FULL lock requests. It's not impossible that you had a deadlock *outside* the database, that is some wait loop that is partially within and partially outside the DB. But if you want me to believe there's a bug in our deadlock detector, you're going to have to offer some actual evidence... regards, tom lane |
#6
| |||
| |||
|
|
That is what I wanted to know, how to get the evidence for next time. |
#7
| |||
| |||
|
|
Joseph Shraibman <jks (AT) selectacast (DOT) net> writes: Last night one of these vacuum fulls deadlocked with a query on this table. Both were stuck doing nothing until I did a kill -INT on the backends doing the vacuum. So my questions: 1) What can I do to avoid this? 2) What do I do next time this happens to get more debugging info out of the situation? Look in pg_locks and pg_stat_activity. I think it is highly unlikely that there was a deadlock inside the database. Far more likely that both jobs were waiting on some idle-in-transaction client whose transaction was holding a lock on the table. regards, tom lane ---------------------------(end of broadcast)--------------------------- TIP 8: explain analyze is your friend |
#8
| |||
| |||
|
|
So why isn't the AccessShareLock dropped as soon as the SELECT is over? |
![]() |
| Thread Tools | |
| Display Modes | |
| |