You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "fredia (via GitHub)" <gi...@apache.org> on 2025/04/07 08:41:54 UTC
[PR] [FLINK-37620][state/forst] ForSt Sync mode support remote storage [flink]
fredia opened a new pull request, #26412:
URL: https://github.com/apache/flink/pull/26412
<!--
*Thank you very much for contributing to Apache Flink - we are happy that you want to help us improve Flink. To help the community review your contribution in the best possible way, please go through the checklist below, which will get the contribution into a shape in which it can be best reviewed.*
*Please understand that we do not do this to make contributions to Flink a hassle. In order to uphold a high standard of quality for code contributions, while at the same time managing a large number of contributions, we need contributors to prepare the contributions well, and give reviewers enough contextual information for the review. Please also understand that contributions that do not follow this guide will take longer to review and thus typically be picked up with lower priority by the community.*
## Contribution Checklist
- Make sure that the pull request corresponds to a [JIRA issue](https://issues.apache.org/jira/projects/FLINK/issues). Exceptions are made for typos in JavaDoc or documentation files, which need no JIRA issue.
- Name the pull request in the form "[FLINK-XXXX] [component] Title of the pull request", where *FLINK-XXXX* should be replaced by the actual issue number. Skip *component* if you are unsure about which is the best component.
Typo fixes that have no associated JIRA issue should be named following this pattern: `[hotfix] [docs] Fix typo in event time introduction` or `[hotfix] [javadocs] Expand JavaDoc for PuncuatedWatermarkGenerator`.
- Fill out the template below to describe the changes contributed by the pull request. That will give reviewers the context they need to do the review.
- Make sure that the change passes the automated tests, i.e., `mvn clean verify` passes. You can set up Azure Pipelines CI to do that following [this guide](https://cwiki.apache.org/confluence/display/FLINK/Azure+Pipelines#AzurePipelines-Tutorial:SettingupAzurePipelinesforaforkoftheFlinkrepository).
- Each pull request should address only one issue, not mix up code from multiple issues.
- Each commit in the pull request has a meaningful commit message (including the JIRA id)
- Once all items of the checklist are addressed, remove the above text and this checklist, leaving only the filled out template below.
**(The sections below can be removed for hotfixes of typos)**
-->
## 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)
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-37620][state/forst] ForSt Sync mode support remote storage [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #26412:
URL: https://github.com/apache/flink/pull/26412#issuecomment-2782507746
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "f818133916a63feec3aba9361323b2c2231d0afd",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "f818133916a63feec3aba9361323b2c2231d0afd",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* f818133916a63feec3aba9361323b2c2231d0afd UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run azure` re-run the last Azure build
</details>
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-37620][state/forst] ForSt Sync mode support remote storage [flink]
Posted by "davidradl (via GitHub)" <gi...@apache.org>.
davidradl commented on code in PR #26412:
URL: https://github.com/apache/flink/pull/26412#discussion_r2030769398
##########
docs/layouts/shortcodes/generated/forst_configuration.html:
##########
@@ -116,6 +116,12 @@
<td>String</td>
<td>The primary directory where ForSt puts its SST files. By default, it will be the same as the checkpoint directory. Recognized shortcut name is 'checkpoint-dir', which means that ForSt shares the directory with checkpoint, and 'local-dir', which means that ForSt will use the local directory of TaskManager.</td>
</tr>
+ <tr>
+ <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>
Review Comment:
nit: is this true?
same job. -> same local job.
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-37620][state/forst] ForSt Sync mode support remote storage [flink]
Posted by "Zakelly (via GitHub)" <gi...@apache.org>.
Zakelly commented on code in PR #26412:
URL: https://github.com/apache/flink/pull/26412#discussion_r2030928114
##########
docs/content.zh/docs/ops/state/disaggregated_state.md:
##########
@@ -150,6 +150,18 @@ state.backend.forst.primary-dir: s3://your-bucket/forst-state
checkpoint and fast recovery, since the ForSt will perform file copy between the primary
storage location and the checkpoint directory during checkpointing and recovery.
+#### ForSt Local Storage Location
+
+ForSt stores the state of synchronous operators in the local disk by default, to avoid the high
Review Comment:
```suggestion
By default, ForSt will **ONLY** disaggregate state when asynchronous APIs (State V2) are used. When using synchronous state APIs in Datastream and SQL jobs, ForSt will only serve as **local state store**. Since a job
may contain multiple ForSt instances with API mixed usage, synchronous local state access along with asynchronous remote state access could help achieve better overall throughput. If you .......
```
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-37620][state/forst] ForSt Sync mode support remote storage [flink]
Posted by "fredia (via GitHub)" <gi...@apache.org>.
fredia commented on PR #26412:
URL: https://github.com/apache/flink/pull/26412#issuecomment-2783112395
> Should we also use ResourceGuard like [FLINK-37597](https://issues.apache.org/jira/browse/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 :)
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-37620][state/forst] ForSt Sync mode support remote storage [flink]
Posted by "fredia (via GitHub)" <gi...@apache.org>.
fredia merged PR #26412:
URL: https://github.com/apache/flink/pull/26412
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
Re: [PR] [FLINK-37620][state/forst] ForSt Sync mode support remote storage [flink]
Posted by "masteryhx (via GitHub)" <gi...@apache.org>.
masteryhx commented on PR #26412:
URL: https://github.com/apache/flink/pull/26412#issuecomment-2783084846
Thanks for the PR.
Just an extra comment: Should we also use ResourceGuard like [FLINK-37597](https://issues.apache.org/jira/browse/FLINK-37597) when using sync mode to access remote storage ?
--
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: issues-unsubscribe@flink.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org