public inbox for [email protected]
help / color / mirror / Atom feedFrom: Asad Ali <[email protected]>
To: Wasim Devale <[email protected]>
Cc: Pgsql-admin <[email protected]>
Cc: pgsql-admin <[email protected]>
Subject: Re: Dead lock after the migration from CentOS 7 to RHEL 9
Date: Thu, 15 Aug 2024 11:43:22 +0500
Message-ID: <CAJ9xe=sKGVNYow-PBbFCP766=-ehiw8e4QzrGHbuogb-V2aHcw@mail.gmail.com> (raw)
In-Reply-To: <CAB5fag444HCM8xONrKbg+rJ5odCdy=0vmianN2Si5K5mWRFKvQ@mail.gmail.com>
References: <CAB5fag444HCM8xONrKbg+rJ5odCdy=0vmianN2Si5K5mWRFKvQ@mail.gmail.com>
The error message indicates a deadlock situation between two processes in
your PostgreSQL database. A deadlock occurs when two or more processes are
blocked indefinitely, each waiting for the other to release a lock.
Here's a breakdown of the error message:
- Process 2197043 is waiting for an AccessExclusiveLock on relation
10384355 (a table or index).
- Process 1889236 is holding the lock that process 2197043 is waiting for
and is waiting for a RowExclusiveLock on relation 10168609 (another table
or index).
- Process 2197043 is holding the lock that process 1889236 is waiting for,
creating a deadlock.
*To resolve this issue:*
1. Check the server log for query details, as hinted in the error message.
This will help you identify the queries causing the deadlock.
2. Analyze the queries and identify any potential causes, such as:
- Long-running transactions
- Lock contention between multiple processes
- Poorly indexed tables
*3. Consider the following solutions:* - Optimize queries to reduce lock
contention
- Use more granular locking (e.g., RowShareLock instead of
RowExclusiveLock)
- Split long-running transactions into smaller ones
- Reindex tables during a maintenance window to minimize lock contention
4. If the issue persists, consider increasing the deadlock_timeout
parameter to allow PostgreSQL to detect and resolve deadlocks more
efficiently.
Remember to exercise caution when making changes to your database
configuration or queries, as they may impact performance or data integrity.
On Wed, Aug 14, 2024 at 10:39 AM Wasim Devale <[email protected]> wrote:
> Hi All
>
> I am facing this issue while reindexing after migration. I analysed the
> application holding the particular table. I stopped the application and
> reindexed it. It went well then again I am facing this issue below.
>
> ERROR: deadlock detected
>
> DETAIL: Process 2197043 waits for AccessExclusiveLock on relation 10384355
> of database 10163711; blocked by process 1889236.
>
> Process 1889236 waits for RowExclusiveLock on relation 10168609 of
> database 10163711; blocked by process 2197043.
>
> HINT: See server log for query details.
>
>
> Thanks,
> Wasim
>
view thread (13+ messages) latest in thread
reply
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: [email protected]
Cc: [email protected], [email protected], [email protected]
Subject: Re: Dead lock after the migration from CentOS 7 to RHEL 9
In-Reply-To: <CAJ9xe=sKGVNYow-PBbFCP766=-ehiw8e4QzrGHbuogb-V2aHcw@mail.gmail.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox