Process 1604 waits for ShareLock on transaction 336991; blocked by process 394.
                  
                  
                          Process 394 waits for ShareLock on transaction 336628; blocked by process 2586.
                  
                  
                          Process 2586 waits for AccessExclusiveLock on tuple (28,74) of relation 18081 of database 16386; blocked by process 1604.
                  
                  
                          Process 1604: update ids set nextid=nextid+75 where table_name='items' and field_name='itemid'
                  
                  
                  https://habr.com/ru/company/wargaming/blog/323354/
                  
                  
                  2021-04-09 06:50:18.889 GMT [1604] HINT:  See server log for query details.
                  
                  
                  2021-04-09 06:50:18.889 GMT [1604] CONTEXT:  while updating tuple (28,74) in relation "ids"
                  
                  
                  2021-04-09 06:50:18.889 GMT [1604] STATEMENT:  update ids set nextid=nextid+75 where table_name='items' and field_name='itemid'
                  
                  
                  2021-04-09 06:50:18.889 GMT [2664] LOG:  duration: 49713.275 ms  statement: select null from hosts where hostid=15036 for update
                  
                  
                  2021-04-09 06:50:18.893 GMT [393] WARNING:  there is no transaction in progress
                  
                  
                  Вопрос: как можно починить возникновение дедлока?
                  
                  
                
постгрес же сам разруливает дедлоки ? вам нужно смотреть почему приложение так себя ведет, боюсь постгрес тут и так уже делает все что может, не дает базе встать колом
там даже ссылка на хабр присутствует
Обсуждают сегодня