Skip to content
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

rafthttp: make "ActiveSince" non-blocking on write lock #9366

Merged
merged 1 commit into from
Feb 27, 2018

Conversation

gyuho
Copy link
Contributor

@gyuho gyuho commented Feb 27, 2018

"ActiveSince" is read-only, and should be able to call
concurrently, as long as there is no routine holding
write lock (send, send snapshot).

e.g. "ActiveSince" is used around etcd server
"processInternalRaftRequestOnce", should be non-blocking

"ActiveSince" is read-only, and should be able to call
concurrently, as long as there is no routine holding
write lock (send, send snapshot).

e.g. "ActiveSince" is used around etcd server
"processInternalRaftRequestOnce", should be non-blocking

Signed-off-by: Gyuho Lee <gyuhox@gmail.com>
@codecov-io
Copy link

Codecov Report

Merging #9366 into master will decrease coverage by 0.24%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff            @@
##           master   #9366      +/-   ##
=========================================
- Coverage   72.74%   72.5%   -0.25%     
=========================================
  Files         361     361              
  Lines       30717   30717              
=========================================
- Hits        22346   22272      -74     
- Misses       6766    6828      +62     
- Partials     1605    1617      +12
Impacted Files Coverage Δ
rafthttp/transport.go 83.24% <100%> (ø) ⬆️
etcdctl/ctlv3/command/printer.go 22.64% <0%> (-21.7%) ⬇️
pkg/tlsutil/tlsutil.go 86.2% <0%> (-6.9%) ⬇️
clientv3/namespace/watch.go 72.72% <0%> (-6.07%) ⬇️
etcdserver/api/v3rpc/lease.go 77.02% <0%> (-5.41%) ⬇️
proxy/grpcproxy/watcher.go 89.79% <0%> (-4.09%) ⬇️
etcdserver/v2_server.go 80.76% <0%> (-3.85%) ⬇️
etcdserver/api/v3election/election.go 64.7% <0%> (-2.95%) ⬇️
etcdserver/api/v3rpc/watch.go 81.27% <0%> (-2.56%) ⬇️
pkg/netutil/netutil.go 66.66% <0%> (-2.09%) ⬇️
... and 116 more

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update d6b46ac...fbe6767. Read the comment docs.

@xiang90
Copy link
Contributor

xiang90 commented Feb 27, 2018

Is this change purely for performance? Or there might be a deadlock somewhere if trying to hold a write lock?

@gyuho
Copy link
Contributor Author

gyuho commented Feb 27, 2018

@xiang90 Just minor performance improvements.

Found out while adding another method to rafthttp #9364.

@xiang90
Copy link
Contributor

xiang90 commented Feb 27, 2018

lgtm

@gyuho gyuho merged commit f802cd9 into etcd-io:master Feb 27, 2018
@gyuho gyuho deleted the rafthttp-mu branch February 27, 2018 03:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

Successfully merging this pull request may close these issues.

3 participants