seokjin0414 opened a new pull request, #30227:
URL: https://github.com/apache/flink/pull/30227

   ## What is the purpose of the change
   
   The periodic compaction time passed to 
`StateTtlConfig.Builder#cleanupInRocksdbCompactFilter(long, Duration)` was set 
on a `ColumnFamilyOptions` object after the column family had been created or 
opened, so it never reached RocksDB. This pull request applies it to the open 
column family with `RocksDB#setOptions`.
   
   ## Brief change log
   
   - `RocksDbTtlCompactFiltersManager#configCompactFilter` sets 
`periodic_compaction_seconds` on the open column family with 
`RocksDB#setOptions`. The manager no longer keeps the column family options or 
the backend's periodic compaction time.
   - Only a value passed to the two-argument `cleanupInRocksdbCompactFilter` is 
applied. With `cleanupInRocksdbCompactFilter(long)`, 
`state.backend.rocksdb.compaction.filter.periodic-compaction-time` or the 
options factory stays in effect, as before.
   - `RocksdbCompactFilterCleanupStrategy` gets an `@Internal 
isPeriodicCompactionTimeConfigured()`. `getPeriodicCompactionTime()` still 
returns 30 days for the one-argument variant.
   
   ## Verifying this change
   
   This change added tests and can be verified as follows:
   
   - `RocksDBTtlPeriodicCompactionTest` reads `periodic_compaction_seconds` of 
the column family from the latest OPTIONS file. 7 tests set the value in the 
TTL config (also after restore, zero, over the configuration option and the 
options factory, per state) and fail without the fix. 5 tests check that the 
configuration option, the options factory and the RocksDB default are kept when 
the TTL config does not set it.
   - `StateTtlConfigTest` covers both builder variants, including Java 
serialization.
   - Manually checked that with an explicit 1 s value, expired entries are 
removed by periodic compaction alone (size-triggered compaction disabled), also 
after restore, and that they stay with `Duration.ZERO`.
   
   ## Does this pull request potentially affect one of the following parts:
   
     - Dependencies (does it add or upgrade a dependency): no
     - The public API, i.e., is any changed class annotated with 
`@Public(Evolving)`: yes, an `@Internal` method is added to 
`StateTtlConfig.RocksdbCompactFilterCleanupStrategy` (`@PublicEvolving`); 
existing methods keep their behaviour
     - The serializers: no
     - The runtime per-record code paths (performance sensitive): no
     - Anything that affects deployment or recovery: JobManager (and its 
components), Checkpointing, Kubernetes/Yarn, ZooKeeper: no
     - The S3 file system connector: no
   
   ## Documentation
   
     - Does this pull request introduce a new feature? no
     - If yes, how is the feature documented? not applicable
   
   ---
   
   ##### Was generative AI tooling used to co-author this PR?
   
   - [X] Yes (please specify the tool below)
   
   Generated-by: Claude Code (Claude Opus 5.5)
   


-- 
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]

Reply via email to