Re: [BUG] Deadlock detected when update with multiple clients
В списке pgsql-bugs по дате отправления:
| От | hubert depesz lubaczewski |
|---|---|
| Тема | Re: [BUG] Deadlock detected when update with multiple clients |
| Дата | |
| Msg-id | 20210914070019.GA10022@depesz.com обсуждение |
| Ответ на | [BUG] Deadlock detected when update with multiple clients ("tanghy.fnst@fujitsu.com" <tanghy.fnst@fujitsu.com>) |
| Список | pgsql-bugs |
On Tue, Sep 14, 2021 at 03:03:40AM +0000, tanghy.fnst@fujitsu.com wrote: > I met a deadlock when I update amounts of text-type data with multiple clients. > And there's no deadlock if I set autovacuum to off. Error messages about the > deadlock are as follows. Autovacuum is red herring. Your queries deadlock because they update all the rows in random order, so sometimes it goes into deadlock condition. This is known, is not a bug. When you're doing multiple updates that might update the same rows (and yours definitely do), it is important to update them in the same order. Or lock before. It's hard to provide solid advise in here, since your test case is clearly bogus - there is no reason to run more than 1 update of whole table, with the same update clause, at once. depesz
В списке pgsql-bugs по дате отправления:
Сайт использует файлы cookie для корректной работы и повышения удобства. Нажимая кнопку «Принять» или продолжая пользоваться сайтом, вы соглашаетесь на их использование в соответствии с Политикой в отношении обработки cookie ООО «ППГ», в том числе на передачу данных из файлов cookie сторонним статистическим и рекламным службам. Вы можете управлять настройками cookie через параметры вашего браузера