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

[3.4] etcdserver: add more detailed traces on linearized reading #14240

Merged
merged 2 commits into from Jul 20, 2022

Conversation

chaochn47
Copy link
Member

Cherry-pick #12335

ref. #14232

@ahrtr

@ahrtr ahrtr mentioned this pull request Jul 20, 2022
25 tasks
@ahrtr ahrtr changed the title etcdserver: add more detailed traces on linearized reading [3.4] etcdserver: add more detailed traces on linearized reading Jul 20, 2022
trace.AddField(traceutil.Field{Key: "readStateIndex", Value: index})

ai := s.getAppliedIndex()
trace.AddField(traceutil.Field{Key: "appliedIndex", Value: strconv.FormatUint(ai, 10)})
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Just a minor comment, why do we need to use strconv.FormatUint here, but use the original uint64 value (line 792) above?

I understand you just backport the PR, so this comment should be added for the original PR.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggest to make them consistent, and update it in the main branch as well.

Copy link
Member Author

@chaochn47 chaochn47 Jul 20, 2022

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I agree. slow request logging should also be consistent with metric proposalsApplied.Set(float64(ep.appliedi)) and etcdctl endpoint status output. Not to mention those two index logically are the same. Both points to different positions of raft log.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is just a backporting PR, so it might be better to merge it for now, and address the comment in separate PR(s).

Are you updating this PR? If not, then let me merge this PR firstly. If you are in progress of updating this PR, then feel free to continue to do it.

PierreZ and others added 2 commits July 20, 2022 12:07
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)`.

Signed-off-by: Chao Chen <chaochn@amazon.com>
Signed-off-by: Chao Chen <chaochn@amazon.com>
Copy link
Member

@ahrtr ahrtr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Thank you @chaochn47

@ahrtr
Copy link
Member

ahrtr commented Jul 20, 2022

Since it's just a minor change, and there is no any change on the functionality, so merging it right now.

@ahrtr ahrtr merged commit 40ccb8b into etcd-io:release-3.4 Jul 20, 2022
@chaochn47 chaochn47 deleted the cherry-pick-12335 branch July 20, 2022 20:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Development

Successfully merging this pull request may close these issues.

None yet

3 participants