server/lock_manager: Support reporting the full wait chain when deadlock is detected#10085
Conversation
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
|
/bench |
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
|
/release |
|
/bench |
…nformation-for-lock-view
|
/release |
longfangsong
left a comment
There was a problem hiding this comment.
Rest LGTM, but we should merge kvproto#752 and use kvproto on master first.
…nformation-for-lock-view
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
|
/test |
…nformation-for-lock-view
|
/test |
src/server/lock_manager/deadlock.rs
Outdated
| ts: TimeStamp, | ||
| hashes: Vec<u64>, | ||
| // (hash, key) | ||
| // The `key` is recorded as an diagnostic information. There may be multiple keys with the same |
There was a problem hiding this comment.
| // The `key` is recorded as an diagnostic information. There may be multiple keys with the same | |
| // The `key` is recorded as diagnostic information. There may be multiple keys with the same |
src/storage/txn/commands/mod.rs
Outdated
| pub pr: ProcessResult, | ||
| // (lock, is_first_lock, wait_timeout) | ||
| pub lock_info: Option<(lock_manager::Lock, bool, Option<WaitTimeout>)>, | ||
| // (lock, key, is_first_lock, wait_timeout) |
There was a problem hiding this comment.
| // (lock, key, is_first_lock, wait_timeout) |
| waiter.deadlock_with(deadlock_key_hash); | ||
| // The `wait_chain` doesn't include the final edge that caused the deadlock, which | ||
| // may reduce some deadlock RPC size. To pass it to the client, append this edge | ||
| // to the wait chain. |
There was a problem hiding this comment.
Where do you append it?
There was a problem hiding this comment.
You have appended it in the deadlock detector. It should be complete. I prefer to remove these comments.
There was a problem hiding this comment.
Ah sorry. This comment is about the first implementation and later I changed it.
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
|
[REVIEW NOTIFICATION] This pull request has been approved by:
To complete the pull request process, please ask the reviewers in the list to review by filling The full list of commands accepted by this bot can be found here. DetailsReviewer can indicate their review by writing |
|
/merge |
|
@youjiali1995: It seems you want to merge this PR, I will help you trigger all the tests: /run-all-tests You only need to trigger If you have any questions about the PR merge process, please refer to pr process. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
|
This pull request has been accepted and is ready to merge. DetailsCommit hash: 65d8394 |
|
@MyonKeminta: Your PR was out of date, I have automatically updated it for you. At the same time I will also trigger all tests for you: /run-all-tests If the CI test fails, you just re-trigger the test that failed and the bot will merge the PR for you after the CI passes. DetailsInstructions for interacting with me using PR comments are available here. If you have questions or suggestions related to my behavior, please file an issue against the ti-community-infra/tichi repository. |
…ock is detected (tikv#10085) * code change draft Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Wrap the key and tag into a struct Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * temporarily silent the warning Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * fix build Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Fix incorrect assertion; add test for wait chain generating Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Move wait chain generation to a seperated function Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Add test case and some refactor Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Check the reported wait chain in integration test Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Update kvproto Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Address comments Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> * Address comments Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com> Co-authored-by: Ti Chi Robot <ti-community-prow-bot@tidb.io> Signed-off-by: jyz0309 <45495947@qq.com>
This PR is now reviewable. But before merging, I want to test if there's any performance regression and try to optimize it if necessary.What problem does this PR solve?
Problem Summary:
We are going to implement the feature Lock View . A part of it is to support collecting information about recent deadlocks.
What is changed and how it works?
What's Changed: Two more fields
keyandresource_group_tagis added to deadlock detection request, deadlock detector's inner information, and deadlock error message. SQL Digest will be encoded intoresource_group_tag. Theresource_group_tagmay also be used by another feature Top SQL, and they want to pass both SQL Digest and the plan to TiKV by theresource_group_tag.Related changes
Check List
Tests
Side effects
Release note