Re: Dead lock after the migration from CentOS 7 to RHEL 9

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
Cc: Wasim Devale <wasimd60(at)gmail(dot)com>, pgsql-admin <pgsql-admin(at)postgresql(dot)org>
Subject: Re: Dead lock after the migration from CentOS 7 to RHEL 9
Date: 2024-08-15 04:08:28
Message-ID: 383012.1723694908@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Scott Ribe <scott_ribe(at)elevated-dev(dot)com> writes:
> Given errors like the pair you posted, my next step would be to examine the queries being executed by those processes during the deadlock. Now, I think by the time the deadlock error is logged, the queries involved have been cancelled, so it's possible the processes have gone on to another query and so pg_stat_activity might not have useful information, or it might--depending on what your app would do after a deadlock error.
> If it does not, then the next thing would be to set log_min_duration_statement to less than deadlock/statement timeout, so that you could look through logs to figure out what are the two queries which are deadlocking against each other.

The postmaster log should already contain the statements that
deadlocked against each other --- that's what the "HINT: See server
log for query details" is telling you.

regards, tom lane

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Asad Ali 2024-08-15 06:43:22 Re: Dead lock after the migration from CentOS 7 to RHEL 9
Previous Message Wasim Devale 2024-08-15 03:54:01 Re: Dead lock after the migration from CentOS 7 to RHEL 9