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

ui: display very large ranges in problematic ranges #129001

Merged
merged 1 commit into from
Aug 20, 2024

Conversation

iskettaneh
Copy link
Contributor

@iskettaneh iskettaneh commented Aug 14, 2024

This commit adds a column in the DB Console's page problematic ranges that displays the ranges that are too large. The threshold is set to be: 8 * the current range max size.

The two screenshots below show how that looks like. In order to generate that, I had to set the threshold multiplier to be 0.8 (instead of 8).
Screenshot 2024-08-15 at 11 13 28 AM

Screenshot 2024-08-15 at 11 14 15 AM

Fixes: #127843

Epic: None

Release note (ui change): Adding too large ranges to the problematic ranges
page in DB Console. If a range is larger than twice the max range
size, it will show up in the problematic ranges page.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@iskettaneh iskettaneh force-pushed the TooLargeRange branch 2 times, most recently from 4e5e6c8 to cb0219e Compare August 15, 2024 15:36
@iskettaneh iskettaneh self-assigned this Aug 15, 2024
@iskettaneh iskettaneh marked this pull request as ready for review August 15, 2024 16:48
@iskettaneh iskettaneh requested review from a team as code owners August 15, 2024 16:48
@iskettaneh iskettaneh requested review from angles-n-daemons and removed request for a team August 15, 2024 16:48
Copy link
Contributor

@miraradeva miraradeva left a comment

Choose a reason for hiding this comment

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

:lgtm:

Reviewed 9 of 9 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @angles-n-daemons, @arulajmani, and @iskettaneh)


pkg/kv/kvserver/replica_metrics.go line 368 at r1 (raw file):

}

func (r *Replica) splitSizeRLocked() (maxBytes int64) {

Can you add a comment for this new function?


pkg/kv/kvserver/replica_metrics_test.go line 60 at r1 (raw file):

		ctr, down, under, over, _ := calcRangeCounter(1100, threeVotersAndSingleNonVoter, leaseStatus, livenesspb.NodeVitalityMap{
			1000: livenesspb.FakeNodeVitality(true), // by NodeID
		}, 3 /* numVoters */, 4 /* numReplicas */, 4 /* clusterNodes */, 0 /*rangeTooLargeThreshold*/, 0 /*rangeSize*/)

nit: I think usually we put spaces within the comment, like /* rangeTooLargeThreshold */.

@arulajmani arulajmani requested a review from miraradeva August 16, 2024 18:10
Copy link
Collaborator

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

Reviewed 2 of 9 files at r1, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (waiting on @angles-n-daemons, @iskettaneh, and @miraradeva)


pkg/kv/kvserver/replica_metrics.go line 174 at r1 (raw file):

	const (
		raftLogTooLargeMultiple = 4
		rangeTooLargeMultiple   = 8

Should this be 2, given we set backpressureRangeSizeMultiplier to be 2 by default?


pkg/kv/kvserver/replica_metrics.go line 176 at r1 (raw file):

		rangeTooLargeMultiple   = 8
	)
	largeRangeThreshold := rangeTooLargeMultiple * d.rangeSplitSize

See my comment below, but I think we should just simplify this to be d.conf.MaxRangeBytes.


pkg/kv/kvserver/replica_metrics.go line 370 at r1 (raw file):

func (r *Replica) splitSizeRLocked() (maxBytes int64) {
	maxBytes = r.mu.conf.RangeMaxBytes
	if r.mu.largestPreviousMaxRangeSizeBytes > maxBytes {

This calculation is pretty contained to exceedsSplitSizeRLocked. IMO, we shouldn't let this bleed in elsewhere -- how do you feel about reverting this change and just using RangeMaxBytes in the calculation for whether a range is too large or not?


pkg/kv/kvserver/replica_metrics_test.go line 60 at r1 (raw file):

Previously, miraradeva (Mira Radeva) wrote…

nit: I think usually we put spaces within the comment, like /* rangeTooLargeThreshold */.

+1. Elsewhere in this file as well.

Copy link
Contributor Author

@iskettaneh iskettaneh left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @angles-n-daemons, @arulajmani, and @miraradeva)


pkg/kv/kvserver/replica_metrics.go line 174 at r1 (raw file):

Previously, arulajmani (Arul Ajmani) wrote…

Should this be 2, given we set backpressureRangeSizeMultiplier to be 2 by default?

Done.


pkg/kv/kvserver/replica_metrics.go line 176 at r1 (raw file):

Previously, arulajmani (Arul Ajmani) wrote…

See my comment below, but I think we should just simplify this to be d.conf.MaxRangeBytes.

Done.


pkg/kv/kvserver/replica_metrics.go line 368 at r1 (raw file):

Previously, miraradeva (Mira Radeva) wrote…

Can you add a comment for this new function?

Removed the functions based on Arul's comments.


pkg/kv/kvserver/replica_metrics.go line 370 at r1 (raw file):

Previously, arulajmani (Arul Ajmani) wrote…

This calculation is pretty contained to exceedsSplitSizeRLocked. IMO, we shouldn't let this bleed in elsewhere -- how do you feel about reverting this change and just using RangeMaxBytes in the calculation for whether a range is too large or not?

Sounds good to me.

@iskettaneh iskettaneh requested a review from arulajmani August 19, 2024 13:32
Copy link
Contributor

@miraradeva miraradeva left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @angles-n-daemons, @arulajmani, and @iskettaneh)


-- commits line 12 at r2:
This probably deserves a release note like Release note(ui): .... See https://cockroachlabs.atlassian.net/wiki/spaces/CRDB/pages/186548364/Release+notes.

Copy link
Contributor Author

@iskettaneh iskettaneh left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 1 stale) (waiting on @angles-n-daemons, @arulajmani, and @miraradeva)


-- commits line 12 at r2:

Previously, miraradeva (Mira Radeva) wrote…

This probably deserves a release note like Release note(ui): .... See https://cockroachlabs.atlassian.net/wiki/spaces/CRDB/pages/186548364/Release+notes.

Done.

@arulajmani arulajmani requested a review from miraradeva August 19, 2024 19:34
Copy link
Collaborator

@arulajmani arulajmani left a comment

Choose a reason for hiding this comment

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

:lgtm: modulo comment.

Reviewed 5 of 9 files at r1, 2 of 2 files at r2, all commit messages.
Reviewable status: :shipit: complete! 1 of 0 LGTMs obtained (and 1 stale) (waiting on @angles-n-daemons, @iskettaneh, and @miraradeva)


pkg/kv/kvserver/replica_metrics.go line 114 at r3 (raw file):

		raftLogSizeTrusted:       r.mu.raftLogSizeTrusted,
		rangeSize:                r.mu.state.Stats.Total(),
		rangeSplitSize:           r.mu.conf.RangeMaxBytes,

Is there benefit to carrying copying over this into rangeSplitSize and then using it below? Or, could we get rid of this field entirely and use d.conf.MaxRangeBytes in calcReplicaMetrics instead?

Copy link
Contributor Author

@iskettaneh iskettaneh left a comment

Choose a reason for hiding this comment

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

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (and 2 stale) (waiting on @angles-n-daemons, @arulajmani, and @miraradeva)


pkg/kv/kvserver/replica_metrics.go line 114 at r3 (raw file):

Previously, arulajmani (Arul Ajmani) wrote…

Is there benefit to carrying copying over this into rangeSplitSize and then using it below? Or, could we get rid of this field entirely and use d.conf.MaxRangeBytes in calcReplicaMetrics instead?

My bad, I didn't notice that r.mu.conf is passed already.

Done!

This commit adds a column in the DB Console's page problematic ranges
that displays the ranges that are too large. The threshold is set
to be: 8 * the current range max size.

Fixes: cockroachdb#127843

Epic: None

Release note (ui change): Adding too large ranges to the problematic ranges
page in DB Console. If a range is larger than twice the max range
size, it will show up in the problematic ranges page.
@iskettaneh
Copy link
Contributor Author

bors r+

@craig craig bot merged commit 7379814 into cockroachdb:master Aug 20, 2024
23 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

ui: display very large ranges in the problem ranges page
4 participants