You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@flink.apache.org by GitBox <gi...@apache.org> on 2021/11/25 09:51:08 UTC
[GitHub] [flink] wanglijie95 opened a new pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
wanglijie95 opened a new pull request #17905:
URL: https://github.com/apache/flink/pull/17905
## What is the purpose of the change
The adaptive batch scheduler needs to know the size of each result partition when the task is finished.
This pr will introduce the numBytesProduced counter and register it into TaskIOMetricGroup, to record the size of each result partition.
## Brief change log
- Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
## Verifying this change
Add some unit 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): (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)
--
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
[GitHub] [flink] flinkbot edited a comment on pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17905:
URL: https://github.com/apache/flink/pull/17905#issuecomment-979045985
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "0ef17f2152395847d231acff55c846201b96e358",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27049",
"triggerID" : "0ef17f2152395847d231acff55c846201b96e358",
"triggerType" : "PUSH"
}, {
"hash" : "45af3a8dfc3df81d1be7d467468f2b859f53b305",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "45af3a8dfc3df81d1be7d467468f2b859f53b305",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 0ef17f2152395847d231acff55c846201b96e358 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27049)
* 45af3a8dfc3df81d1be7d467468f2b859f53b305 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
[GitHub] [flink] wanglijie95 commented on a change in pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
wanglijie95 commented on a change in pull request #17905:
URL: https://github.com/apache/flink/pull/17905#discussion_r759344265
##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ResultPartitionTest.java
##########
@@ -822,6 +822,55 @@ public void testBufferSizeNotChanged() throws IOException {
assertEquals(bufferSize, subpartition1.pollBuffer().buffer().getSize());
}
+ @Test
+ public void testNumBytesProducedCounterForPipelinedUnicast() throws IOException {
Review comment:
I will simplify them.
--
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
[GitHub] [flink] zhuzhurk closed pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
zhuzhurk closed pull request #17905:
URL: https://github.com/apache/flink/pull/17905
--
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
[GitHub] [flink] flinkbot commented on pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #17905:
URL: https://github.com/apache/flink/pull/17905#issuecomment-979045985
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "0ef17f2152395847d231acff55c846201b96e358",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "0ef17f2152395847d231acff55c846201b96e358",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 0ef17f2152395847d231acff55c846201b96e358 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
[GitHub] [flink] zhuzhurk commented on a change in pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
zhuzhurk commented on a change in pull request #17905:
URL: https://github.com/apache/flink/pull/17905#discussion_r759094376
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BufferWritingResultPartition.java
##########
@@ -391,6 +391,7 @@ private BufferBuilder requestNewBufferBuilderFromPool(int targetSubpartition)
private void finishUnicastBufferBuilder(int targetSubpartition) {
final BufferBuilder bufferBuilder = unicastBufferBuilders[targetSubpartition];
if (bufferBuilder != null) {
+ numBytesProduced.inc(bufferBuilder.finish());
Review comment:
We should invoke `finish()` once and record the result. The result can be used multiple times.
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BufferWritingResultPartition.java
##########
@@ -406,6 +407,7 @@ private void finishUnicastBufferBuilders() {
private void finishBroadcastBufferBuilder() {
if (broadcastBufferBuilder != null) {
+ numBytesProduced.inc(broadcastBufferBuilder.finish());
Review comment:
We should invoke `finish()` once and record the result. The result can be used multiple times.
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java
##########
@@ -111,6 +111,14 @@
protected Counter numBuffersOut = new SimpleCounter();
+ /**
+ * The difference with {@link #numBytesOut} : numBytesProduced represents the number of bytes
+ * actually produced, and numBytesOut represents the number of bytes sent downstream tasks. In
Review comment:
sent -> sent to
##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/metrics/groups/TaskIOMetricGroupTest.java
##########
@@ -71,4 +74,29 @@ public void testTaskIOMetricGroup() throws InterruptedException {
assertThat(
taskIO.getBackPressuredTimePerSecond().getCount(), greaterThanOrEqualTo(sleepTime));
}
+
+ @Test
+ public void testNumBytesProducedOfPartitionsMetrics() {
+ TaskMetricGroup task = UnregisteredMetricGroups.createUnregisteredTaskMetricGroup();
+ TaskIOMetricGroup taskIO = task.getIOMetricGroup();
+
+ Counter c1 = new SimpleCounter();
+ c1.inc(32L);
+ Counter c2 = new SimpleCounter();
+ c2.inc(64L);
+
+ IntermediateResultPartitionID resultPartitionID1 = new IntermediateResultPartitionID();
+ IntermediateResultPartitionID resultPartitionID2 = new IntermediateResultPartitionID();
+
+ taskIO.registerNumBytesProducedCounterForPartition(resultPartitionID1, c1);
+ taskIO.registerNumBytesProducedCounterForPartition(resultPartitionID2, c2);
+
+ // check
Review comment:
I think this comment is not needed
##########
File path: flink-runtime/src/test/java/org/apache/flink/runtime/io/network/partition/ResultPartitionTest.java
##########
@@ -822,6 +822,55 @@ public void testBufferSizeNotChanged() throws IOException {
assertEquals(bufferSize, subpartition1.pollBuffer().buffer().getSize());
}
+ @Test
+ public void testNumBytesProducedCounterForPipelinedUnicast() throws IOException {
Review comment:
The change does not differentiate with ResultPartitionType, so I think there is not need to add different tests against different ResultPartitionTypes.
--
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
[GitHub] [flink] flinkbot edited a comment on pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17905:
URL: https://github.com/apache/flink/pull/17905#issuecomment-979045985
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "0ef17f2152395847d231acff55c846201b96e358",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27049",
"triggerID" : "0ef17f2152395847d231acff55c846201b96e358",
"triggerType" : "PUSH"
}, {
"hash" : "45af3a8dfc3df81d1be7d467468f2b859f53b305",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27299",
"triggerID" : "45af3a8dfc3df81d1be7d467468f2b859f53b305",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 45af3a8dfc3df81d1be7d467468f2b859f53b305 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27299)
<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
[GitHub] [flink] wanglijie95 commented on pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
wanglijie95 commented on pull request #17905:
URL: https://github.com/apache/flink/pull/17905#issuecomment-982704336
Thanks for review, @zhuzhurk. I have made changes based on your comments. Please take a look.
--
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
[GitHub] [flink] wanglijie95 commented on a change in pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
wanglijie95 commented on a change in pull request #17905:
URL: https://github.com/apache/flink/pull/17905#discussion_r759343002
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BufferWritingResultPartition.java
##########
@@ -391,6 +391,7 @@ private BufferBuilder requestNewBufferBuilderFromPool(int targetSubpartition)
private void finishUnicastBufferBuilder(int targetSubpartition) {
final BufferBuilder bufferBuilder = unicastBufferBuilders[targetSubpartition];
if (bufferBuilder != null) {
+ numBytesProduced.inc(bufferBuilder.finish());
Review comment:
You are right, I will fix it.
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/BufferWritingResultPartition.java
##########
@@ -406,6 +407,7 @@ private void finishUnicastBufferBuilders() {
private void finishBroadcastBufferBuilder() {
if (broadcastBufferBuilder != null) {
+ numBytesProduced.inc(broadcastBufferBuilder.finish());
Review comment:
You are right, I will fix it.
--
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
[GitHub] [flink] wanglijie95 commented on a change in pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
wanglijie95 commented on a change in pull request #17905:
URL: https://github.com/apache/flink/pull/17905#discussion_r759343595
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/io/network/partition/ResultPartition.java
##########
@@ -111,6 +111,14 @@
protected Counter numBuffersOut = new SimpleCounter();
+ /**
+ * The difference with {@link #numBytesOut} : numBytesProduced represents the number of bytes
+ * actually produced, and numBytesOut represents the number of bytes sent downstream tasks. In
Review comment:
Thanks for pointing it out.
--
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
[GitHub] [flink] flinkbot commented on pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #17905:
URL: https://github.com/apache/flink/pull/17905#issuecomment-979044899
Thanks a lot for your contribution to the Apache Flink project. I'm the @flinkbot. I help the community
to review your pull request. We will use this comment to track the progress of the review.
## Automated Checks
Last check on commit 0ef17f2152395847d231acff55c846201b96e358 (Thu Nov 25 09:54:17 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
* **This pull request references an unassigned [Jira ticket](https://issues.apache.org/jira/browse/FLINK-24980).** According to the [code contribution guide](https://flink.apache.org/contributing/contribute-code.html), tickets need to be assigned before starting with the implementation work.
<sub>Mention the bot in a comment to re-run the automated checks.</sub>
## Review Progress
* ❓ 1. The [description] looks good.
* ❓ 2. There is [consensus] that the contribution should go into to Flink.
* ❓ 3. Needs [attention] from.
* ❓ 4. The change fits into the overall [architecture].
* ❓ 5. Overall code [quality] is good.
Please see the [Pull Request Review Guide](https://flink.apache.org/contributing/reviewing-prs.html) for a full explanation of the review process.<details>
The Bot is tracking the review progress through labels. Labels are applied according to the order of the review items. For consensus, approval by a Flink committer of PMC member is required <summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot approve description` to approve one or more aspects (aspects: `description`, `consensus`, `architecture` and `quality`)
- `@flinkbot approve all` to approve all aspects
- `@flinkbot approve-until architecture` to approve everything until `architecture`
- `@flinkbot attention @username1 [@username2 ..]` to require somebody's attention
- `@flinkbot disapprove architecture` to remove an approval you gave earlier
</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
[GitHub] [flink] flinkbot edited a comment on pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17905:
URL: https://github.com/apache/flink/pull/17905#issuecomment-979045985
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "0ef17f2152395847d231acff55c846201b96e358",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27049",
"triggerID" : "0ef17f2152395847d231acff55c846201b96e358",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 0ef17f2152395847d231acff55c846201b96e358 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27049)
<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
[GitHub] [flink] flinkbot edited a comment on pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17905:
URL: https://github.com/apache/flink/pull/17905#issuecomment-979045985
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "0ef17f2152395847d231acff55c846201b96e358",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27049",
"triggerID" : "0ef17f2152395847d231acff55c846201b96e358",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 0ef17f2152395847d231acff55c846201b96e358 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27049)
<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
[GitHub] [flink] flinkbot edited a comment on pull request #17905: [FLINK-24980] Introduce numBytesProduced counter into ResultPartition to record the size of result partition.
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #17905:
URL: https://github.com/apache/flink/pull/17905#issuecomment-979045985
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "0ef17f2152395847d231acff55c846201b96e358",
"status" : "SUCCESS",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27049",
"triggerID" : "0ef17f2152395847d231acff55c846201b96e358",
"triggerType" : "PUSH"
}, {
"hash" : "45af3a8dfc3df81d1be7d467468f2b859f53b305",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27299",
"triggerID" : "45af3a8dfc3df81d1be7d467468f2b859f53b305",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 0ef17f2152395847d231acff55c846201b96e358 Azure: [SUCCESS](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27049)
* 45af3a8dfc3df81d1be7d467468f2b859f53b305 Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=27299)
<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