Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[DocDB] [Advisory Lock] Unexpected Deadlock Error And Wait Despite Lock Ownership #26122

Open
1 task done
shishir2001-yb opened this issue Feb 19, 2025 · 1 comment
Open
1 task done
Assignees
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/medium Medium priority issue qa_itest-system Bugs identified in itest-system automation QA QA filed bugs

Comments

@shishir2001-yb
Copy link

shishir2001-yb commented Feb 19, 2025

Jira Link: DB-15449

Description

Version: 2.25.1.0-b324

When using pg_advisory_lock() and pg_advisory_xact_lock() it appears that retries are exhausted, causing a deadlock error even when no deadlock occurs. If a session already holds a lock on a key, executing pg_advisory_xact_lock() within the same session should acquire the lock immediately, regardless of other sessions waiting for the same key. However, the query continues to wait and eventually fails with a deadlock error.

Session 1                                                     Session 2


SELECT pg_advisory_lock(1);                                  
                                                              begin;
                                                              SELECT pg_advisory_xact_lock(1);
                                                              <<<<<<<<Waits for session 1 to release the lock>>>>>>

begin;
SELECT pg_advisory_xact_lock(1);

<Continues to wait even when session1 has this lock>            ERROR:  deadlock detected (yb_max_query_layer_retries set to 60 are exhausted)
                                                               DETAIL:  Transaction bb5a32f9-e713-4966-a320-87894726c72e aborted due to a 
                                                               deadlock[ session level txn]06593c69-4572-44c1-8c09-f38905c3404d->
                                                               <1739995808906932>bb5a32f9-e713-4966-a320-87894726c72e->: kDeadlock

Issue Type

kind/bug

Warning: Please confirm that this issue does not contain any sensitive information

  • I confirm this issue does not contain any sensitive information.
@shishir2001-yb shishir2001-yb added area/docdb YugabyteDB core features QA QA filed bugs qa_itest-system Bugs identified in itest-system automation status/awaiting-triage Issue awaiting triage labels Feb 19, 2025
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Feb 19, 2025
@rthallamko3
Copy link
Contributor

Removing the blocker label as it is a duplicate of #26006.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area/docdb YugabyteDB core features kind/bug This issue is a bug priority/medium Medium priority issue qa_itest-system Bugs identified in itest-system automation QA QA filed bugs
Projects
None yet
Development

No branches or pull requests

4 participants