[ 
https://issues.apache.org/jira/browse/FLINK-30409?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17647942#comment-17647942
 ] 

Mason Chen edited comment on FLINK-30409 at 12/15/22 9:02 AM:
--------------------------------------------------------------

I think that is a good proposal–we can keep the semantic that a group instance 
will always stay closed. We should then also discard the old metric group from 
AbstractMetricGroup state and we can do this lazily (if and when a group with 
same name is requested). Mind if I take a stab at the implementation and 
testing as I have been thinking about this problem a lot?


was (Author: mason6345):
I think that is a good proposal–we can keep the semantic that a group instance 
will always stay closed. We should then also discard the old metric group from 
AbstractMetricGroup state. Mind if I take a stab at the implementation and 
testing as I have been thinking about this problem a lot?

> Support reopening closed metric groups
> --------------------------------------
>
>                 Key: FLINK-30409
>                 URL: https://issues.apache.org/jira/browse/FLINK-30409
>             Project: Flink
>          Issue Type: Improvement
>          Components: Runtime / Metrics
>    Affects Versions: 1.17.0
>            Reporter: Mason Chen
>            Priority: Major
>
> Currently, metricGroup.close() will unregister metrics and the underlying 
> metric groups. If the metricGroup is created again via addGroup(), it will 
> silently fail to create metrics since the metric group is in a closed state.
> We need to close metric groups and reopen them because some of the metrics 
> may reference old objects that are no longer relevant/stale and we need to 
> re-create the metric/metric group to point to the new references. For 
> example, we may close `KafkaSourceReader` to remove a topic partition from 
> assignment and then recreate `KafkaSourceReader` with a different set of 
> topic partitions. The metrics should also reflect that.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

Reply via email to