apache / helix

Mirror of Apache Helix
Apache License 2.0
457 stars 218 forks source link

MissingTopState metric unreported when replica is set to ANY_LIVEINSTANCE #2803

Closed csudharsanan closed 2 months ago

csudharsanan commented 2 months ago

Describe the bug

The metric "MissingTopState" is not being calculated (hence not reported) as an exception is thrown prior to metric calculation in the ResourceMonitor.

https://github.com/linkedin/helix/blob/c480eac018932214886aaf55f3c28107d46e84b0/helix-core/src/main/java/org/apache/helix/monitoring/mbeans/ResourceMonitor.java#L279

Whenever the replica is set to ANY_LIVEINSTANCE, we encounter a NumberFormatException and return (as we try to get the replica count as Integer) before calculating rest of the metrics which includes the _numNonTopStatePartitions.

To Reproduce

Set replica to 'ANY_LIVEINSTANCE'

Expected behavior

_numNonTopStatePartitions reflecting right value when replica is set to ANY_LIVEINSTANCE.

Additional context

Add any other context about the problem here.