-
Notifications
You must be signed in to change notification settings - Fork 5.9k
New issue
Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
domain: batch handle the privilege reload event #59934
base: master
Are you sure you want to change the base?
Conversation
Hi @tiancaiamao. Thanks for your PR. PRs from untrusted users cannot be marked as trusted with I understand the commands that are listed here. Instructions 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. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #59934 +/- ##
================================================
+ Coverage 72.9252% 74.8454% +1.9202%
================================================
Files 1701 1748 +47
Lines 469722 478399 +8677
================================================
+ Hits 342546 358060 +15514
+ Misses 106059 97756 -8303
- Partials 21117 22583 +1466
Flags with carried forward coverage won't be shown. Click here to find out more.
🚀 New features to boost your workflow:
|
pkg/domain/domain.go
Outdated
func ignoreBatchData(ch clientv3.WatchChan) { | ||
ticker := time.NewTicker(5 * time.Millisecond) | ||
defer ticker.Stop() | ||
for i := 0; i < 1024; i++ { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Does 1024
here means maxBatchSize? Maybe use a const is more reasonable.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: Defined2014 The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
[LGTM Timeline notifier]Timeline:
|
/retest |
@tiancaiamao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions 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. |
/retest |
@tiancaiamao: Cannot trigger testing until a trusted user reviews the PR and leaves an In response to this:
Instructions 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. |
What problem does this PR solve?
Issue Number: close #59400
Problem Summary:
After a
NotifyPrivilegeUpdate()
, the notification from etcd is laggy.When we're in a batch of privilege modification operations, the laggy event cause that even when the workload is done,
tidb still have a long period of time handling the laggy events.
This use 100% cpu (1 core) even there are no other events.
What changed and how does it work?
Wait for a while to get a batch of the laggy events, handle them together.
Check List
Tests
Before:

After:

As you can see, after the workload finish, the CPU drop to 0 immediately with this commit.
Side effects
Documentation
Release note
Please refer to Release Notes Language Style Guide to write a quality release note.