Github user fhueske commented on the issue:
https://github.com/apache/flink/pull/4421
Hi @hequn8128, I think the change is good.
I don't think we need to remove `!validTimestamp` though. The clean-up is a
best effort cleanup and will register another clean-up timer if there are
records left in the state. So, we might not remove all expired records in one
run but also do not have to iterate over all timestamps. This is an
optimization for RocksDB state which provides the keys in sorted order, so in
this case all expired records are removed without going over all keys of the
MapState.
---
If your project is set up for it, you can reply to this email and have your
reply appear on GitHub as well. If your project does not have this feature
enabled and wishes so, or if the feature is enabled but not working, please
contact infrastructure at [email protected] or file a JIRA ticket
with INFRA.
---