Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-37620][state/forst] ForSt Sync mode support remote storage #26412

Merged
merged 2 commits into from
Apr 9, 2025

Conversation

fredia
Copy link
Contributor

@fredia fredia commented Apr 7, 2025

What is the purpose of the change

This PR makes ForSt Sync mode support remote storage and provide state.backend.forst.sync.enforce-local.

Brief change log

  • Add state.backend.forst.sync.enforce-local to ForStOptions.
  • Set remote directory for ForStSyncKeyedStateBackend when configured.
  • Remove some useless code in ForStSyncKeyedStateBackend.java

Verifying this change

This change added tests and can be verified as follows:

  • ForStStateBackendTest#testCreateKeyedStateBackend

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: (yes / no )
  • The S3 file system connector: (yes / no / don't know)

Documentation

  • Does this pull request introduce a new feature? (no)
  • If yes, how is the feature documented? (not applicable / docs / JavaDocs / not documented)

@flinkbot
Copy link
Collaborator

flinkbot commented Apr 7, 2025

CI report:

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

<td><h5>state.backend.forst.sync.enforce-local</h5></td>
<td style="word-wrap: break-word;">false</td>
<td>Boolean</td>
<td>Whether to enforce local state for operators in synchronous mode when enabling disaggregated state. This is useful in cases where both synchronous operators and asynchronous operators are used in the same job.</td>
Copy link
Contributor

Choose a reason for hiding this comment

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

nit: is this true?
same job. -> same local job.

Copy link
Contributor

@Zakelly Zakelly left a comment

Choose a reason for hiding this comment

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

Overall LGTM. One suggestion: how about add descriptions explaining the state.backend.forst.sync.enforce-local under https://nightlies.apache.org/flink/flink-docs-release-2.0/docs/ops/state/disaggregated_state/#forst-primary-storage-location

@masteryhx
Copy link
Contributor

Thanks for the PR.
Just an extra comment: Should we also use ResourceGuard like FLINK-37597 when using sync mode to access remote storage ?

@fredia
Copy link
Contributor Author

fredia commented Apr 7, 2025

Should we also use ResourceGuard like FLINK-37597 when using sync mode to access remote storage ?

ResourceGuard is used to ensure that the snapshot threads are completed before ForStSyncKeyedStateBackend disposing, and ForStSyncKeyedStateBackend#dispose() has already achieved this.

IIUC, the remote storage accessing in ForStSyncKeyedStateBackend is done in the main task thread, maybe extra work is not necessary, correct me if I'm wrong :)

@fredia fredia merged commit 3bc9600 into apache:master Apr 9, 2025
fredia added a commit to fredia/flink that referenced this pull request Apr 9, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

5 participants