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

clientv3/ordering: adjust violation count. #10580

Closed
wants to merge 1 commit into from
Closed

clientv3/ordering: adjust violation count. #10580

wants to merge 1 commit into from

Conversation

johncming
Copy link
Contributor

@johncming johncming commented Mar 23, 2019

three changes

first:
func (c *Client) Endpoints() (eps []string) remove naked return

second:
Concurrent access is possible infunc (c *Client) Endpoints() (eps []string) , so mutex required.

etcd/clientv3/client.go

Lines 164 to 175 in ebb559a

func (c *Client) Sync(ctx context.Context) error {
mresp, err := c.MemberList(ctx)
if err != nil {
return err
}
var eps []string
for _, m := range mresp.Members {
eps = append(eps, m.ClientURLs...)
}
c.SetEndpoints(eps...)
return nil
}

third:
violationCount should reset after endpoints changed.

@codecov-io
Copy link

codecov-io commented Mar 23, 2019

Codecov Report

Merging #10580 into master will increase coverage by 0.07%.
The diff coverage is 100%.

Impacted file tree graph

@@            Coverage Diff             @@
##           master   #10580      +/-   ##
==========================================
+ Coverage   71.63%    71.7%   +0.07%     
==========================================
  Files         393      393              
  Lines       36568    36574       +6     
==========================================
+ Hits        26195    26227      +32     
+ Misses       8538     8515      -23     
+ Partials     1835     1832       -3
Impacted Files Coverage Δ
clientv3/client.go 80.22% <100%> (+0.11%) ⬆️
clientv3/ordering/util.go 100% <100%> (ø) ⬆️
etcdserver/api/v3rpc/lease.go 71.59% <0%> (-5.69%) ⬇️
pkg/logutil/zap_grpc.go 47.61% <0%> (-4.77%) ⬇️
pkg/testutil/recorder.go 77.77% <0%> (-3.71%) ⬇️
clientv3/concurrency/election.go 79.68% <0%> (-2.35%) ⬇️
clientv3/balancer/grpc1.7-health.go 58.13% <0%> (-1.17%) ⬇️
etcdserver/server.go 74.67% <0%> (-0.51%) ⬇️
etcdserver/api/rafthttp/stream.go 79.39% <0%> (-0.43%) ⬇️
clientv3/watch.go 92.4% <0%> (+0.63%) ⬆️
... and 14 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 7a5acb4...ebb559a. Read the comment docs.

@xiang90
Copy link
Contributor

xiang90 commented Mar 28, 2019

@johncming

Can you separate this PR to two PRs? One for the locking thing, the other one for the ordering pkg? Thanks!

@johncming
Copy link
Contributor Author

@johncming

Can you separate this PR to two PRs? One for the locking thing, the other one for the ordering pkg? Thanks!

OK. I will do it.

@jingyih
Copy link
Contributor

jingyih commented Apr 15, 2019

cc @jpbetz

@xiang90
Copy link
Contributor

xiang90 commented May 2, 2019

@johncming can you update this one as the split PR is merged?

@stale
Copy link

stale bot commented Apr 6, 2020

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Apr 6, 2020
@stale stale bot closed this Apr 27, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Development

Successfully merging this pull request may close these issues.

4 participants