-
Notifications
You must be signed in to change notification settings - Fork 9.9k
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
etcdserver: add more detailed traces on linearized reading #12335
etcdserver: add more detailed traces on linearized reading #12335
Conversation
@@ -775,6 +778,7 @@ func (s *EtcdServer) linearizableReadLoop() { | |||
if !done { | |||
continue | |||
} | |||
trace.Step("read index received") |
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.
can we add following fields to improve observability?
trace.AddField(traceutil.Field{Key: "appliedIndex", Value: s.getAppliedIndex})
trace.AddField(traceutil.Field{Key: "readStateIndex", Value: rs.Index})
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.
ci is failed. https://travis-ci.com/github/etcd-io/etcd/jobs/391026189
0fe5424
to
a9ad9a9
Compare
etcdserver/v3_server.go
Outdated
@@ -715,6 +716,9 @@ func (s *EtcdServer) linearizableReadLoop() { | |||
return | |||
} | |||
|
|||
// as a single loop is can unlock multiple reads, it is not very useful | |||
// to propagate the trace from Txn or Range. | |||
trace := traceutil.New("linearizableReadLoop", s.lg) |
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.
lg should be s.getLogger().
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.
ci still failed.
To improve debuggability of `agreement among raft nodes before linearized reading`, we added some tracing inside `linearizableReadLoop`. This will allow us to know the timing of `s.r.ReadIndex` vs `s.applyWait.Wait(rs.Index)`.
a9ad9a9
to
19129ef
Compare
lgtm. thanks @PierreZ |
This PR is related to #11884
Why
To improve debuggability of
agreement among raft nodes before linearized reading
, we added some tracing insidelinearizableReadLoop
.This will allow us to know the timing of
s.r.ReadIndex
vss.applyWait.Wait(rs.Index)
.Results
The patch has been deployed on clusters running v3.4.9, here's some traces: