JunRuiLee commented on code in PR #23447:
URL: https://github.com/apache/flink/pull/23447#discussion_r1429512642


##########
flink-runtime/src/main/java/org/apache/flink/runtime/rest/handler/legacy/metrics/MetricStore.java:
##########
@@ -126,9 +140,14 @@ public synchronized void 
updateCurrentExecutionAttempts(Collection<JobDetails> j
                                                             
taskMetricStore.getSubtaskMetricStore(
                                                                     
subtaskIndex))
                                             .ifPresent(
-                                                    subtaskMetricStore ->
-                                                            
subtaskMetricStore.retainAttempts(
-                                                                    
attempts.getCurrentAttempts()));
+                                                    subtaskMetricStore -> {
+                                                        
subtaskMetricStore.retainAttempts(

Review Comment:
   Since the metrics for subtasks also exist in the taskMetricsStore in the 
form of taskInfo.subtaskIndex + "." + name, it is also necessary to clean up 
the transient metrics stored in the taskMetricsStore. Otherwise, it could lead 
to inconsistent behaviors that may confuse users, as depicted in the screenshot 
below.
   
![image](https://github.com/apache/flink/assets/107924572/ac8de662-7129-4445-a793-f0facca352e8)
   



-- 
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]

Reply via email to