Jackie-Jiang commented on code in PR #12403:
URL: https://github.com/apache/pinot/pull/12403#discussion_r1496246707
##########
pinot-controller/src/main/java/org/apache/pinot/controller/helix/SegmentStatusChecker.java:
##########
@@ -379,12 +384,11 @@ private void setStatusToDefault() {
}
private void resetTableMetrics(String tableName) {
- _controllerMetrics.setValueOfTableGauge(tableName,
ControllerGauge.NUMBER_OF_REPLICAS, Long.MIN_VALUE);
- _controllerMetrics.setValueOfTableGauge(tableName,
ControllerGauge.PERCENT_OF_REPLICAS, Long.MIN_VALUE);
- _controllerMetrics.setValueOfTableGauge(tableName,
ControllerGauge.SEGMENTS_IN_ERROR_STATE, Long.MIN_VALUE);
- _controllerMetrics.setValueOfTableGauge(tableName,
ControllerGauge.SEGMENTS_WITH_LESS_REPLICAS,
- Long.MIN_VALUE);
- _controllerMetrics.setValueOfTableGauge(tableName,
ControllerGauge.PERCENT_SEGMENTS_AVAILABLE, Long.MIN_VALUE);
+ for (ControllerGauge gauge : ControllerGauge.values()) {
Review Comment:
Not introduced in this PR, but this logic doesn't look correct to me. Can
you help check the history of this resetting logic, why not removing them but
resetting instead?
##########
pinot-server/src/main/java/org/apache/pinot/server/starter/helix/SegmentMessageHandlerFactory.java:
##########
@@ -173,6 +177,17 @@ public HelixTaskResult handleMessage()
try {
_instanceDataManager.deleteTable(_tableNameWithType);
helixTaskResult.setSuccess(true);
+ Arrays.stream(ServerMeter.values())
+ .filter(m -> !m.isGlobal())
+ .forEach(m -> _metrics.removeTableMeter(_tableNameWithType, m));
+ Arrays.stream(ServerGauge.values())
+ .filter(g -> !g.isGlobal())
+ .forEach(g -> _metrics.removeTableGauge(_tableNameWithType, g));
+ Arrays.stream(ServerTimer.values())
+ .filter(t -> !t.isGlobal())
+ .forEach(t -> _metrics.removeTableTimer(_tableNameWithType, t));
+ Arrays.stream(ServerQueryPhase.values())
+ .forEach(p -> _metrics.removePhaseTiming(_tableNameWithType, p));
} catch (Exception e) {
_metrics.addMeteredTableValue(_tableNameWithType,
ServerMeter.DELETE_TABLE_FAILURES, 1);
Review Comment:
Will the next run of `SegmentStatusChecker` clear this metric accidentally?
I guess we want to keep it, or change it to a global metric?
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]