Skip to content

storage: fix bug in calcRangeCounter#45253

Merged
craig[bot] merged 1 commit intocockroachdb:masterfrom
tbg:range-counter
Mar 2, 2020
Merged

storage: fix bug in calcRangeCounter#45253
craig[bot] merged 1 commit intocockroachdb:masterfrom
tbg:range-counter

Conversation

@tbg
Copy link
Copy Markdown
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
Copy Markdown
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
Copy Markdown
Member Author

tbg commented Mar 2, 2020

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

Copy link
Copy Markdown
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 tbg force-pushed the range-counter branch from dbf19c6 to d471cb3 Compare March 2, 2020 16:51
@tbg
Copy link
Copy Markdown
Member Author

tbg commented Mar 2, 2020

I didn't, changed it to 3. TFTR

bors r=andreimatei

@craig
Copy link
Copy Markdown
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.

3 participants