Skip to content

Conversation

@wenyihu6
Copy link
Contributor

Epic: CRDB-55052
Release note: none


mmaprototype: extract processRangeMsg from processStoreLeaseholderMsgInternal

This commit extracts a new function processRangeMsg from
processStoreLeaseholderMsgInternal so that we can use defer() to handle metrics
updates since it does continue in the loop.


mmaprototype: track span config normalization errors

This change splits the SpanConfigNormalizationError counter into two gauges
(HardError for nil conf, SoftError for usable best-effort conf) and adds a
hasNormalizationError field to rangeState so that errors persist until a new
config arrives.

Note that the gauge is updated in processStoreLeaseholderMsg rather than
rebalanceStores because it already iterates all leaseholder ranges at O(ranges)
cost, whereas rebalanceStores only iterates topK and would require an additional
full iteration.

…Internal

This commit extracts a new function processRangeMsg from
processStoreLeaseholderMsgInternal so that we can use defer() to handle metrics
updates since it does continue in the loop.
This change splits the SpanConfigNormalizationError counter into two gauges
(HardError for nil conf, SoftError for usable best-effort conf) and adds a
hasNormalizationError field to rangeState so that errors persist until a new
config arrives.

Note that the gauge is updated in processStoreLeaseholderMsg rather than
rebalanceStores because it already iterates all leaseholder ranges at O(ranges)
cost, whereas rebalanceStores only iterates topK and would require an additional
full iteration.
@wenyihu6 wenyihu6 requested review from a team as code owners December 19, 2025 01:13
@blathers-crl
Copy link

blathers-crl bot commented Dec 19, 2025

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.

@wenyihu6 wenyihu6 requested review from sumeerbhola and tbg December 19, 2025 01:13
@cockroach-teamcity
Copy link
Member

This change is Reviewable

@wenyihu6 wenyihu6 changed the title mmaprototype: extract processRangeMsg from processStoreLeaseholderMsg… mmaprototype: track span config normalization errors Dec 19, 2025
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.

2 participants