-
Notifications
You must be signed in to change notification settings - Fork 1k
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] Eliminate the need for explicit aggressive poll interval - wait_queue_poll_interval_ms for contentious workloads #16440
Comments
…t to wait queue Summary: In case a transaction is committed, the transaction coordinator will send an UpdateTransaction request to each participating tablet. When the transaction participant processes this RPC, we can signal to the wait queue that such transaction was committed in case the wait queue is managing any waiting transactions blocked on this one. This should be more performant than relying on periodic call of WaitQueue::Poll to detect that a blocker is committed and unblock its waiters. In case a transaction is aborted, the query layer client will send an UpdateTransaction request with status IMMEDIATE_CLEANUP to every involved transaction participant. In such a case we can similarly signal to the wait queue that this transaction was aborted. In order to ensure a re-run of conflict resolution sees the latest signaled changes, we also modify the contract between conflict resolution and wait queue code to allow the wait queue to advance the resolution_ht used by conflict resolution beyond the ht of the commit/abort which triggered the waiter to be re-run. Given these changes, we can achieve high fairness in most normal workloads. For sufficiently contentious workloads, we need to set `wait_queue_poll_interval_ms` to a fairly small setting to maintain fairness. Immediate follow-up work will reduce this dependency on `wait_queue_poll_interval_ms`: see #16440 This commit includes another change to refactor the wait queue to be owned by the transaction participant to resolve some lifetime issues with this signaling approach. Test Plan: Jenkins: hot Reviewers: bkolagani, sergei Reviewed By: sergei Subscribers: pjain, bogdan Differential Revision: https://phabricator.dev.yugabyte.com/D23614
for example, with the following transaction:
if we have a single node local cluster on a 6 core machine, and we run this in 8 parallel threads, we will see something like 1/1000 requests experience 100x avg latency |
A tentative root cause has been identified, with a POC fix seemingly solving the issue. We have the following two code paths racing with each other: Path 1 --
Path 2 --
step 3 of path 2 and step 4 of path 1 need to be synchronized, else T2 may miss the signal from the participant and be stuck in the wait queue until Poll() is called |
Depends on #21404 |
Jira Link: DB-5848
Description
We currently depend on a polling-based approach to resolve waiting transactions in the wait queue in order to achieve fairness under highly-contentious workloads, e.g. a workload where 10s of sessions are concurrently locking the same row.
Without aggressive polling (e.g. setting
wait_queue_poll_interval_ms=5
), such highly contentious workloads will suffer from high p99 latenciesOnce we have #13578, we should ensure that highly contentious workloads can function with predictable p99 performance even with
wait_queue_poll_interval_ms=100
or larger. Otherwise, we are trading off significant CPU overhead for fairnessWarning: Please confirm that this issue does not contain any sensitive information
The text was updated successfully, but these errors were encountered: