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

storage: fix bug in calcRangeCounter #45253

Merged
merged 1 commit into from
Mar 2, 2020
Merged

Conversation

tbg
Copy link
Member

@tbg tbg commented Feb 20, 2020

Found by @andreimatei in #39936 (review)

Release note (bug fix): a bug in the range metrics collection could fail
to correctly identify a range that had lost quorum, causing it to not be
reported via the "unavailable ranges" metric. This is now fixed.

@cockroach-teamcity
Copy link
Member

This change is Reviewable

@tbg tbg force-pushed the range-counter branch 2 times, most recently from 5a2fc5c to dbf19c6 Compare March 2, 2020 13:01
@tbg tbg marked this pull request as ready for review March 2, 2020 13:01
@tbg tbg requested a review from andreimatei March 2, 2020 13:01
@tbg
Copy link
Member Author

tbg commented Mar 2, 2020

Fixed this up and added (admittedly quite rudimentary) test, PTAL.

Copy link
Contributor

@andreimatei andreimatei left a comment

Choose a reason for hiding this comment

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

LGTM

Reviewable status: :shipit: complete! 0 of 0 LGTMs obtained (waiting on @andreimatei and @tbg)


pkg/storage/replica_metrics_test.go, line 37 at r1 (raw file):

		ctr, down, under, over := calcRangeCounter(1100 /* storeID */, desc, IsLiveMap{
			1000: IsLiveMapEntry{IsLive: true}, // by NodeID
		}, 4, 3)

why did you need a 4 here, as opposed to 3?

Found by @andreimatei in cockroachdb#39936 (review)

Release note (bug fix): a bug in the range metrics collection could fail
to correctly identify a range that had lost quorum, causing it to not be
reported via the "unavailable ranges" metric. This is now fixed.
@tbg
Copy link
Member Author

tbg commented Mar 2, 2020

I didn't, changed it to 3. TFTR

bors r=andreimatei

@craig
Copy link
Contributor

craig bot commented Mar 2, 2020

Build succeeded

@craig craig bot merged commit 003fa43 into cockroachdb:master Mar 2, 2020
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.

None yet

3 participants