After adding some managed state during processing we have spotted worrisome grow of checkpoints size and duration despite using incremental checkpointing with RocksDb.
To isolate the problem we created simple topology with source, a map operator and sink.
Source creates in memory arbitrary number of events with 1 event per second throughput. Every event has unique id that is used to partitioned stream (using keyBy operator) and goes through map function that adds around 100kB to managed state (ValueState used). Then events are simply passed to sink that does nothing.
Using set up described above we have sent 1200 events with checkpointing interval and minimal pause set to 5 sec. As events came with constant speed and equal amount of state we expected checkpoints size to be more or less constant. However we observed linearly growing peaks of checkpoints size (with the last peak having almost 120MB, close to size of whole expected managed state) with small checkpoints in between. For monitoring we used metric exposed by Flink and Prometheus with Grafana, please see some: checkpoint charts
We would like to understand why do we observe CPs peaks and why they are constantly growing?
What causes that some CPs saves expected size (around 500kB) and some have size around whole current managed state size even the load is constant?
What exactly is measured by lastCheckpointSize metric when incremental checkpointing is used?
Any hints, explanations will be much appreciated,
Thanks in advance.