Skip to content

Conversation

@Zakelly
Copy link
Contributor

@Zakelly Zakelly commented Oct 28, 2025

What is the purpose of the change

The StateBackend#isSafeToReuseKVState is exposed to SQL layer to indicate whether it can perform object reuse. Currently it does not consider the heap timer when using RocksDB/ForSt, which may cause checkpoint broken as the FLINK-38558 describes. This PR fixes the implementation.

Brief change log

  • Change StateBackend#isSafeToReuseKVState to consider heap timer factory.

Verifying this change

This change is a trivial rework and changes the corresponding test of StateBackendTestBase.

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): 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

@flinkbot
Copy link
Collaborator

flinkbot commented Oct 28, 2025

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

Copy link
Member

@fsk119 fsk119 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@Override
public boolean isSafeToReuseKVState() {
return true;
return !(priorityQueueFactory instanceof HeapPriorityQueueSetFactory);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

As this is set in the constructor - it would be better to do the instanceof there and then set an instance field flag. At the moment we do the instanceof every call of this method.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If you read the code that invokes this method, you may find it only invoked once when the subtask start. So don't worry about the performance. I'd prefer keep this as it's more readable.

@github-actions github-actions bot added the community-reviewed PR has been reviewed by the community. label Oct 28, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

community-reviewed PR has been reviewed by the community.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants