xiangfu0 commented on code in PR #12940: URL: https://github.com/apache/pinot/pull/12940#discussion_r1577976012
########## pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java: ########## @@ -135,6 +138,17 @@ protected void postprocess(Context context) { _controllerMetrics.setValueOfGlobalGauge(ControllerGauge.UPSERT_TABLE_COUNT, context._upsertTableCount); _controllerMetrics.setValueOfGlobalGauge(ControllerGauge.DISABLED_TABLE_COUNT, context._disabledTables.size()); + _tierBackendGauges.forEach(_controllerMetrics::removeGauge); Review Comment: Do you want to clear `_tierBackendGauges` as well? Or you can keep track all the valid metric names from this loop in a set: `context._tierBackendTableCountMap.forEach((tier, count) -> {...}` say `newTierBackendGauges`, then call `_tierBackendGauges. retainAll(newTierBackendGauges)` to get the gauge names not existed. Then call `removeGauge` and last thing is ``` _tierBackendGauges.clear(); _tierBackendGauges.putAll(newTierBackendGauges) ``` -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org For additional commands, e-mail: commits-h...@pinot.apache.org