Myasuka commented on code in PR #21835:
URL: https://github.com/apache/flink/pull/21835#discussion_r1263625354
##########
flink-core/src/main/java/org/apache/flink/api/common/state/StateTtlConfig.java:
##########
@@ -433,6 +461,12 @@ public static class RocksdbCompactFilterCleanupStrategy
implements CleanupStrategies.CleanupStrategy {
private static final long serialVersionUID = 3109278796506988980L;
+ /**
+ * Default value is 30 days (i.e 30 * 24 * 60 * 60) so that every file
goes through the
Review Comment:
I think we don't need a `i.e 30 * 24 * 60 * 60` here.
##########
docs/content/docs/dev/datastream/fault-tolerance/state.md:
##########
@@ -633,6 +633,15 @@ Updating the timestamp more often can improve cleanup speed
but it decreases compaction performance because it uses JNI call from native
code.
The default background cleanup for RocksDB backend queries the current
timestamp each time 1000 entries have been processed.
+Periodic compaction could speed up expired state entries cleanup, especially
for state entries rarely accessed.
+Files older than this value will be picked up for compaction, and re-written
to the same level as they were before.
+It makes sure a file goes through compaction filters periodically.
+You can change it and pass a custom value to
+`StateTtlConfig.newBuilder(...).cleanupInRocksdbCompactFilter(long
queryTimeAfterNumEntries, Time periodicCompactionTime)` method.
+The default value of Periodic compaction seconds is 30 days.
+You could set it to 0 to turn off periodic compaction or set a small value to
speed up expired state entries cleanup, but it
+may decrease compaction performance.
Review Comment:
I think a more proper description is that `it would trigger more
compactions`.
--
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]