-
Notifications
You must be signed in to change notification settings - Fork 289
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
kv-client: use multiple sync.Map to reduce lock contention #1439
kv-client: use multiple sync.Map to reduce lock contention #1439
Conversation
/run-all-tests |
7035d36
to
c9ec547
Compare
/run-all-tests |
c9ec547
to
c6fb15e
Compare
/run-integration-tests |
cdc/kv/region_worker_test.go
Outdated
|
||
var wg sync.WaitGroup | ||
wg.Add(2) | ||
go func() { |
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.
could you please add more goroutine to make sure the thread-safety?
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.
addressed
LGTM |
LGTM |
/merge |
Your auto merge job has been accepted, waiting for:
|
/run-all-tests |
@amyangfei merge failed. |
/merge |
/run-all-tests |
/run-kafka-tests |
Signed-off-by: ti-srebot <ti-srebot@pingcap.com>
cherry pick to release-4.0 in PR #1476 |
What problem does this PR solve?
part 3 of #1393, please review this PR after #1426 is merged
sync.Map
is faster than RWMutex and Mutex. Note this is concluded from some benchmarks, such as sync: RWMutex scales poorly with CPU count golang/go#17973, https://www.jianshu.com/p/cffffa914381, but maybe not quite suitable for our scene, we need more tests for this point, the most important thing here is to simulate the real world workload.sync.Map
can accelerate map accessWhat is changed and how it works?
sync.Map
s for regionFeedState get/put operation.sync.Map
pool is determined by cpu number, min threshold, and max thresholdCheck List
Tests
Release note