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

kvcoord: Add metric to keep track of restarted ranges in rangefeed #98980

Merged
merged 1 commit into from
Mar 22, 2023

Conversation

miretskiy
Copy link
Contributor

Add a distsender.rangefeed.restart_ranges metric to keep track of the number of ranges restarted due to transient error.

Epic: CRDB-25044
Release note: None

@miretskiy miretskiy requested review from erikgrinaker and a team March 19, 2023 13:16
@miretskiy miretskiy requested a review from a team as a code owner March 19, 2023 13:16
@blathers-crl
Copy link

blathers-crl bot commented Mar 19, 2023

It looks like your PR touches production code but doesn't add or edit any test code. Did you consider adding tests to your PR?

🦉 Hoot! I am a Blathers, a bot for CockroachDB. My owner is dev-inf.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@@ -653,6 +653,7 @@ func (ds *DistSender) singleRangeFeed(
// Ensure context is cancelled on all errors, to prevent gRPC stream leaks.
ctx, cancelFeed := context.WithCancel(ctx)
defer func() {
ds.metrics.RangefeedRestartRanges.Inc(1)
Copy link
Contributor

Choose a reason for hiding this comment

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

This is going to increment the metric when the rangefeed isn't restarted too, e.g. when cancelled.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Added check on ctx.Err.

Copy link
Contributor

Choose a reason for hiding this comment

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

It will also increment the metric when handleRangefeedError returns a permanent error. Shouldn't this be incremented in partialRangeFeed once we've actually determined to restart the rangefeed?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Yes, definitely

@miretskiy miretskiy force-pushed the muxrf branch 2 times, most recently from 43abde5 to 7bc7b46 Compare March 19, 2023 14:47
Add a `distsender.rangefeed.restart_ranges` metric to keep track
of the number of ranges restarted due to transient error.

Epic: CRDB-25044
Release note: None
@miretskiy
Copy link
Contributor Author

bors r+

@craig craig bot merged commit 5fc479d into cockroachdb:master Mar 22, 2023
@craig
Copy link
Contributor

craig bot commented Mar 22, 2023

Build succeeded:

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
backport-23.1.x Flags PRs that need to be backported to 23.1
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants