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

[YSQL] Implement wait queue infrastructure for Wait-on-Conflict concurrency control #9589

Closed
pkj415 opened this issue Aug 4, 2021 · 2 comments
Assignees
Labels
area/docdb YugabyteDB core features kind/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue

Comments

@pkj415
Copy link
Contributor

pkj415 commented Aug 4, 2021

Jira Link: DB-2174

Implement wait queue infrastructure on transaction participants as a first step towards achieving Wait-on-Conflict concurrency control semantics as seen on Postgres (#5680).

Design doc - https://docs.google.com/document/u/1/d/1DCg4FjGlYZNBBIPcADk7z2B2TGznNHWtr8hU-0dUXyo/edit?usp=drive_web&ouid=114844179723166767268

This will be converted to a .md file and places on github once the implementation is done.

@pkj415 pkj415 self-assigned this Aug 4, 2021
@pkj415 pkj415 added the area/docdb YugabyteDB core features label Aug 4, 2021
@pkj415 pkj415 changed the title [YSQL] Implement wait queues for pessimistic locking [YSQL] Implement wait queues with deadlock avoidance - partial pessimistic locking Aug 4, 2021
@yugabyte-ci yugabyte-ci added kind/bug This issue is a bug priority/medium Medium priority issue labels Jun 9, 2022
robertsami added a commit that referenced this issue Jul 7, 2022
Summary:
This revision introduces a waiting mechanism in conflict resolution, and a path to use this
mechanism if FLAGS_enable_pessimistic_locking is true. Using this mechanism is an alternative to our
current "wound or die" scheme which kills lower priority transactions in face of a detected
conflict. Note that this is the first in a series of diffs which will introduce pessimistic locking,
and this revision does nothing to prevent deadlocks.

Test Plan: ybd --cxx-test pgwrapper_pg_pessimistic_locking-test

Reviewers: mbautin, pjain, sergei

Reviewed By: pjain, sergei

Subscribers: rthallam, bogdan

Differential Revision: https://phabricator.dev.yugabyte.com/D17304
@yugabyte-ci yugabyte-ci assigned robertsami and unassigned pkj415 Jul 27, 2022
@yugabyte-ci yugabyte-ci added kind/enhancement This is an enhancement of an existing feature and removed kind/bug This issue is a bug labels Jul 29, 2022
@pkj415 pkj415 changed the title [YSQL] Implement wait queues with deadlock avoidance - partial pessimistic locking [YSQL] Implement wait queue infrastructure for improved pessimistic locking Aug 11, 2022
@robertsami
Copy link
Contributor

re-opening to track completion of single-tablet txn support

@robertsami robertsami reopened this Sep 14, 2022
robertsami added a commit that referenced this issue Sep 14, 2022
…ites

Summary:
D17304 introduces pessimistic locking with a new WaitQueue component integrated into distributed
transaction codepaths. D18045 introduces deadlock detection on top of that. This revision integrates
the wait queue in single-shard write codepaths, while notably *not* integrating deadlock detection.
This avoidance of deadlock detection in single-shard write codepaths is intentional -- it is
impossible for single-shard writes to be waited-on, and therefore it is impossible for single shard
writes to cause a deadlock.

Test Plan: ybd --cxx-test pgwrapper_pg_pessimistic_locking-test

Reviewers: mbautin, sergei, pjain

Reviewed By: pjain

Subscribers: ybase

Differential Revision: https://phabricator.dev.yugabyte.com/D18082
@robertsami
Copy link
Contributor

tracking remainder for single-tablet support here: #14014

@robertsami robertsami added this to To do in Wait-Queue Based Locking via automation Dec 8, 2022
@robertsami robertsami moved this from To do to Done in Wait-Queue Based Locking Dec 8, 2022
@pkj415 pkj415 changed the title [YSQL] Implement wait queue infrastructure for improved pessimistic locking [YSQL] Implement wait queue infrastructure for Wait-on-Conflict concurrency control Jan 6, 2023
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/enhancement This is an enhancement of an existing feature priority/medium Medium priority issue
Projects
Status: Done
Status: Done
Development

No branches or pull requests

3 participants