sangkyoonnam opened a new pull request, #29602: URL: https://github.com/apache/flink/pull/29602
## What is the purpose of the change With TTL enabled on a merging-window `ListState`, reading the merge target after `merge_partitioned_state` can return its stale cached contents. `RemoteKeyedStateBackend.clear_state_cache` builds the cache keys to invalidate without the TTL config, while the cached bag states were created with it, so the invalidation misses them. See [FLINK-41108](https://issues.apache.org/jira/browse/FLINK-41108). ## Brief change log - `clear_state_cache` builds the bag state key with the state's TTL config, the same key the cached state uses. ## Verifying this change This change added tests and can be verified as follows: - `test_merge_partitioned_state_with_ttl` in `ProcessWindowTests` uses a merging trigger with a TTL-enabled `ListState`, based on the reproduction in the ticket: it reads the merge target, merges, and reads it again. On `master` the second read returns `[]` instead of `[1]` and the job fails; it passes with the change. The test runs with parallelism 1 to keep the two records in order and restores the parallelism afterward. - `ProcessWindowTests` passes locally (21 tests). ## 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)`: no - The serializers: no - The runtime per-record code paths (performance sensitive): yes, cache invalidation during the namespace merges that window record processing triggers. - 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) AI was used for the implementation, the verification runs and this description. Generated-by: Claude Code 2.1.308 (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]
