hequn8128 commented on a change in pull request #6918: [FLINK-10543][table] 
Leverage efficient timer deletion in relational operators
URL: https://github.com/apache/flink/pull/6918#discussion_r238512298
 
 

 ##########
 File path: 
flink-libraries/flink-table/src/main/scala/org/apache/flink/table/runtime/aggregate/ProcessFunctionWithCleanupState.scala
 ##########
 @@ -58,6 +58,10 @@ abstract class 
ProcessFunctionWithCleanupState[IN,OUT](queryConfig: StreamQueryC
         val cleanupTime = currentTime + maxRetentionTime
         // register timer and remember clean-up time
         ctx.timerService().registerProcessingTimeTimer(cleanupTime)
+        // delete expired timer
+        if (curCleanupTime != null) {
+          ctx.timerService().deleteProcessingTimeTimer(curCleanupTime)
 
 Review comment:
   This is a good question. The `needToCleanupState` is useless in 
`GroupAggProcessFunction`, `RowTimeBoundedRangeOver`, etc. But it is used in 
`ProcTimeBoundedRangeOver`. 
   In `ProcTimeBoundedRangeOver`, both state cleanup and computation will 
register proctime timer, so that we still need this `needToCleanupState` to 
judge whether to clean up the state.

----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on GitHub and use the
URL above to go to the specific comment.
 
For queries about this service, please contact Infrastructure at:
[email protected]


With regards,
Apache Git Services

Reply via email to