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

[release-3.0] cherry pick: add commit log duration metrics #5881

Merged
merged 3 commits into from Nov 16, 2019

Conversation

NingLin-P
Copy link
Member

What have you changed?

cherry-pick: #5440 #5465

What is the type of the changes?

  • New feature (a change which adds functionality)

How is the PR tested?

No

Does this PR affect documentation (docs) or should it be mentioned in the release notes?

No

Does this PR affect tidb-ansible?

pingcap/tidb-ansible#577

NingLin-P and others added 2 commits November 13, 2019 19:54
Signed-off-by: linning <linningde25@gmail.com>
Signed-off-by: linning <linningde25@gmail.com>
@NingLin-P
Copy link
Member Author

/run-all-tests

@NingLin-P NingLin-P added the type/cherry-pick Type: PR - Cherry pick label Nov 13, 2019
Copy link
Member

@gengliqi gengliqi left a comment

Choose a reason for hiding this comment

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

LGTM

@BusyJay BusyJay added the priority/release-blocker This PR blocks a release. Please review it ASAP. label Nov 14, 2019
if !ready.committed_entries.as_ref().map_or(true, Vec::is_empty)
&& ctx.current_time.is_none()
{
ctx.current_time.replace(monotonic_raw_now());
Copy link
Member

Choose a reason for hiding this comment

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

Why not initialize it at L1285?

Copy link
Member Author

Choose a reason for hiding this comment

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

It look odd to initialize current_time here, but it based on a reason:
when there are proposal msg current_time will be initialize at L1650, and when there are not, initialize current_time here is more close to initialize at L1650 than L1285, as between here and L1650 there is no time consume work like send msg or write to disk.

@@ -1275,6 +1281,9 @@ impl Peer {
if lease_to_be_updated {
let propose_time = self.find_propose_time(entry.get_index(), entry.get_term());
if let Some(propose_time) = propose_time {
ctx.raft_metrics.commit_log.observe(duration_to_sec(
Copy link
Member

Choose a reason for hiding this comment

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

I think commit duration should be observed from the head instead of the tail.

Copy link
Member Author

Choose a reason for hiding this comment

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

You are right, PTAL again.

Signed-off-by: linning <linningde25@gmail.com>
@NingLin-P
Copy link
Member Author

/run-all-tests

@overvenus overvenus merged commit 68cb1bd into tikv:release-3.0 Nov 16, 2019
@AndreMouche AndreMouche added this to the v3.0.6 milestone Nov 19, 2019
fredchenbj pushed a commit to fredchenbj/tikv that referenced this pull request Dec 11, 2019
* cherry-pick: add commit log duration metrics

Signed-off-by: linning <linningde25@gmail.com>

* cherry pick: rename lease_time to current_time

Signed-off-by: linning <linningde25@gmail.com>

* observe first propose_time

Signed-off-by: linning <linningde25@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
priority/release-blocker This PR blocks a release. Please review it ASAP. type/cherry-pick Type: PR - Cherry pick
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

5 participants