server/lock_manager: Support replacing lock by key to reduce RPC overhead of update_wait_for when the waiting queue is very long#17451
Conversation
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
…correct 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>
2f277c0 to
cf8d0f5
Compare
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
|
/release |
| 500, | ||
| ); | ||
| } | ||
|
|
There was a problem hiding this comment.
Do we have a upgrading test case to verify the behaviours are expected when upgrading tikv-servers?
There was a problem hiding this comment.
It was now manually done.
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
|
/release |
ekexium
left a comment
There was a problem hiding this comment.
The PR itself LGTM.
Have we conducted any throughput benchmarks comparing this implementation to the original one? Additionally, micro-benchmarks could help us determine the component's maximum performance capacity.
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
| detect_table.clean_up(txn.into()); | ||
| None | ||
| } | ||
| (_, true) => { |
There was a problem hiding this comment.
This match is a bit weird, how about:
match req.get_tp(){
DeadlockRequestType::CleanUpWaitFor => {
if req.has_replace_locks_by_keys() {
// replace_locks_by_keys logic
}else{
// old logic
}
}
}|
PR needs rebase. 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 kubernetes-sigs/prow repository. |
| self.wait_for_map.clear(); | ||
| self.key_reverse_map.clear(); |
There was a problem hiding this comment.
Forget to shrink? An empty hashmap may still occupy memory.
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
|
Benchmarks cargo bench -p tests --bench deadlock_detectorThere will be obvious regression in the deadlock detector. |
…sts (tikv#17500) close tikv#17394 lock_manager: Skip updating lock wait info for non-fair-locking requests This is a simpler and lower-risky fix of the OOM issue tikv#17394 for released branches, as an alternative solution to tikv#17451 . In this way, for acquire_pessimistic_lock requests without enabling fair locking, the behavior of update_wait_for will be a noop. So that if fair locking is globally disabled, the behavior will be equivalent to versions before 7.0. Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
…sts (#17500) (#17870) close #17394 lock_manager: Skip updating lock wait info for non-fair-locking requests This is a simpler and lower-risky fix of the OOM issue #17394 for released branches, as an alternative solution to #17451 . In this way, for acquire_pessimistic_lock requests without enabling fair locking, the behavior of update_wait_for will be a noop. So that if fair locking is globally disabled, the behavior will be equivalent to versions before 7.0. Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
…sts (#17500) (#17869) close #17394 lock_manager: Skip updating lock wait info for non-fair-locking requests This is a simpler and lower-risky fix of the OOM issue #17394 for released branches, as an alternative solution to #17451 . In this way, for acquire_pessimistic_lock requests without enabling fair locking, the behavior of update_wait_for will be a noop. So that if fair locking is globally disabled, the behavior will be equivalent to versions before 7.0. Signed-off-by: MyonKeminta <MyonKeminta@users.noreply.github.com> Co-authored-by: MyonKeminta <MyonKeminta@users.noreply.github.com>
|
Is this abandoned? |
Currently no plan to continue this as its overhead is large and we've find it hard to determine if it's acceptable. |
|
@MyonKeminta: The following tests failed, say
Full PR test history. Your PR dashboard. 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 kubernetes-sigs/prow repository. I understand the commands that are listed here. |
What is changed and how it works?
Issue Number: Close #17394
What's Changed:
Related changes
Check List
Tests
Side effects
Release note