Pedro Mázala
07/18/2023, 11:17 AMregisterProcessingTimeTimer. I’ve encountered an issue with the onTimer method not getting fired in certain scenarios, and I was wondering if anyone has come across a similar problem and could offer some guidance.
Here’s some context: we have a Stream API named “Consolidation,” which utilizes registerProcessingTimeTimer to schedule delayed processing for a specific field based on certain criteria. During testing on our staging environment with a low processing time (10 minutes), everything works fine. However, when we move to production with a larger processing time window (72 hours), it seems that the onTimer method is not triggered as expected.
Upon further investigation, I’ve noticed that our Flink instances occasionally restart due to our k8s node assignment policy. This leads me to suspect that the restarts may be causing the created timers to be wiped out. Is it a valid expectation for registerProcessingTimeTimer to maintain the timers’ state and trigger them even after a restart? Should we be implementing something differently to ensure this expected behavior?
Just to provide some additional information, our deployment process is based on Flink Operator, and the upgradeMode is set to “savepoint.” Our state backend is configured as follows:
state.backend: rocksdb
state.backend.incremental: true
On a side note, I have experimented with smaller window times, and without the restarts, the timers work as expected.
While researching this issue, I came across the following excerpt from the documentation:
Timers are always asynchronously checkpointed, except for the combination of RocksDB backend / with incremental snapshots / with heap-based timers (will be resolved with FLINK-10026). Notice that large numbers of timers can increase the checkpointing time because timers are part of the checkpointed state. See the “Timer Coalescing” section for advice on how to reduce the number of timers.If anyone has any insights or experiences to share regarding the behavior of
registerProcessingTimeTimer after Task Manager restarts or any suggestions on how to tackle this issue, I would greatly appreciate your input.
Thank you all in advance for your help!Pedro Mázala
07/19/2023, 9:20 AMDavid Anderson
07/19/2023, 4:41 PM