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

From: Scott Ribe <scott_ribe(at)elevated-dev(dot)com>
To: Wasim Devale <wasimd60(at)gmail(dot)com>
Cc: 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 03:45:29
Message-ID: 07994165-F268-41E0-9975-4FB5DE2EBED1@elevated-dev.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

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.

--
Scott Ribe
scott_ribe(at)elevated-dev(dot)com
https://www.linkedin.com/in/scottribe/

> On Aug 14, 2024, at 9:38 PM, Wasim Devale <wasimd60(at)gmail(dot)com> wrote:
>
> Ok thanks for the insights.
> Do we need to do any config changes in the config file?
> We have also configured Datadog agent at operating system level that checks postgresql activity it's has the pgpouncer.d config file that is unchanged after the migration. This might be the possible reason that it is throughing dead lock error.
> Please through some insights on the above.
> Thanks for the immediate help.
> Regards,
> Wasim
>
> On Thu, 15 Aug, 2024, 9:01 am David G. Johnston, <david(dot)g(dot)johnston(at)gmail(dot)com> wrote:
> On Wednesday, August 14, 2024, Wasim Devale <wasimd60(at)gmail(dot)com> wrote:
> So it's not a postgresql issue. It's from the application side correct?
>
> That’s the assumption. The vast majority of locks happen because the “application” executed SQL commands.
>
> David J.

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message David G. Johnston 2024-08-15 03:50:44 Re: Dead lock after the migration from CentOS 7 to RHEL 9
Previous Message Wasim Devale 2024-08-15 03:38:31 Re: Dead lock after the migration from CentOS 7 to RHEL 9