You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by "Zakelly (via GitHub)" <gi...@apache.org> on 2024/05/17 09:07:18 UTC
[PR] [FLINK-32088][checkpoint] Space control in file merging [flink]
Zakelly opened a new pull request, #24807:
URL: https://github.com/apache/flink/pull/24807
## This PR is on top of #24806 , Will rebase once that's merged
## What is the purpose of the change
As we know, the checkpoint file merging will introduce space amplification. This PR introduce a space control in file merging, by rewriting old files and eliminate the empty slot on underlying files.
## Brief change log
- Space accounting and flags in file merging manager and physical files.
- Rewrite in RocksdbStateBackend
## Verifying this change
Added UTs for file merging manager.
## 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
- The S3 file system connector: no
## Documentation
- Does this pull request introduce a new feature? yes
- If yes, how is the feature documented? docs
--
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-32088][checkpoint] Space control in file merging [flink]
Posted by "masteryhx (via GitHub)" <gi...@apache.org>.
masteryhx commented on code in PR #24807:
URL: https://github.com/apache/flink/pull/24807#discussion_r1615759950
##########
flink-core/src/main/java/org/apache/flink/configuration/CheckpointingOptions.java:
##########
@@ -431,7 +431,8 @@ public class CheckpointingOptions {
*
* <p>TODO: remove '@Documentation.ExcludeFromDocumentation' after the feature is implemented.
Review Comment:
nit: Remove this.
##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/filemerging/FileMergingSnapshotManagerBase.java:
##########
@@ -569,6 +581,67 @@ public void reusePreviousStateHandle(
}
}
+ // ------------------------------------------------------------------------
+ // Space Control
+ // ------------------------------------------------------------------------
+
+ /**
+ * The core method that control space if needed. This method will compare the desired space
+ * amplification with current one, and if it exceeds the configured amplification, this method
+ * will mark minimal set of {@link PhysicalFile}s not to be reused anymore.
+ */
+ private void controlSpace() {
+ if (spaceStat.logicalFileSize.get() * maxSpaceAmplification
Review Comment:
Could we just add a method in `SpaceStat` about `SpaceAmplification` ?
Then It could also be exposed by metrics.
--
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-32088][checkpoint] Space control in file merging [flink]
Posted by "masteryhx (via GitHub)" <gi...@apache.org>.
masteryhx commented on code in PR #24807:
URL: https://github.com/apache/flink/pull/24807#discussion_r1616031216
##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/filemerging/FileMergingSnapshotManagerBase.java:
##########
@@ -569,6 +581,67 @@ public void reusePreviousStateHandle(
}
}
+ // ------------------------------------------------------------------------
+ // Space Control
+ // ------------------------------------------------------------------------
+
+ /**
+ * The core method that control space if needed. This method will compare the desired space
+ * amplification with current one, and if it exceeds the configured amplification, this method
+ * will mark minimal set of {@link PhysicalFile}s not to be reused anymore.
+ */
+ private void controlSpace() {
+ if (spaceStat.logicalFileSize.get() * maxSpaceAmplification
Review Comment:
Okay, I think we could consider it later in the metric PR.
--
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-32088][checkpoint] Space control in file merging [flink]
Posted by "flinkbot (via GitHub)" <gi...@apache.org>.
flinkbot commented on PR #24807:
URL: https://github.com/apache/flink/pull/24807#issuecomment-2117100787
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "c8ff5e79b0a2671cc978b02238eb6f83f4bfa19b",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "c8ff5e79b0a2671cc978b02238eb6f83f4bfa19b",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* c8ff5e79b0a2671cc978b02238eb6f83f4bfa19b 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-32088][checkpoint] Space control in file merging [flink]
Posted by "Zakelly (via GitHub)" <gi...@apache.org>.
Zakelly commented on PR #24807:
URL: https://github.com/apache/flink/pull/24807#issuecomment-2134887375
@flinkbot run azure
--
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-32088][checkpoint] Space control in file merging [flink]
Posted by "Zakelly (via GitHub)" <gi...@apache.org>.
Zakelly commented on PR #24807:
URL: https://github.com/apache/flink/pull/24807#issuecomment-2137702975
Rebased to resolve conflicts
--
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-32088][checkpoint] Space control in file merging [flink]
Posted by "Zakelly (via GitHub)" <gi...@apache.org>.
Zakelly merged PR #24807:
URL: https://github.com/apache/flink/pull/24807
--
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-32088][checkpoint] Space control in file merging [flink]
Posted by "Zakelly (via GitHub)" <gi...@apache.org>.
Zakelly commented on code in PR #24807:
URL: https://github.com/apache/flink/pull/24807#discussion_r1616015660
##########
flink-runtime/src/main/java/org/apache/flink/runtime/checkpoint/filemerging/FileMergingSnapshotManagerBase.java:
##########
@@ -569,6 +581,67 @@ public void reusePreviousStateHandle(
}
}
+ // ------------------------------------------------------------------------
+ // Space Control
+ // ------------------------------------------------------------------------
+
+ /**
+ * The core method that control space if needed. This method will compare the desired space
+ * amplification with current one, and if it exceeds the configured amplification, this method
+ * will mark minimal set of {@link PhysicalFile}s not to be reused anymore.
+ */
+ private void controlSpace() {
+ if (spaceStat.logicalFileSize.get() * maxSpaceAmplification
Review Comment:
Since there still be another code getting value from `spaceStat` and calculate with `maxSpaceAmplification` (Line 598), I'd suggest keep this as it is. Could you elaborate more on the metrics?
--
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