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/03/23 04:05:53 UTC
[GitHub] [flink] dianfu opened a new pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
dianfu opened a new pull request #15337:
URL: https://github.com/apache/flink/pull/15337
## What is the purpose of the change
*This pull request relaxes the restriction that multiple ManagedMemoryUseCase could no be used for the same operator, e.g. PYTHON and OPERATOR.*
## Brief change log
- *Remove the restriction in SimpleTransformationTranslator*
- *Add validation to make sure that two sets of weights should be consistent*
## Verifying this change
This change added tests and can be verified as follows:
- *Added tests testManagedMemoryUseCaseWeightsConfiguredWithConsistentValue and testManagedMemoryUseCaseWeightsConfiguredWithConflictValue in ManagedMemoryUtilsTest *
## 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/Mesos, 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15337:
URL: https://github.com/apache/flink/pull/15337#issuecomment-804610022
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15230",
"triggerID" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"triggerType" : "PUSH"
}, {
"hash" : "a7f9add4ad44811fadc9944046e5c698473bb1de",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "a7f9add4ad44811fadc9944046e5c698473bb1de",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fe8a261ff73f5e252902403d8d7c3e396420d6db Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15230)
* a7f9add4ad44811fadc9944046e5c698473bb1de UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] xintongsong commented on a change in pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
xintongsong commented on a change in pull request #15337:
URL: https://github.com/apache/flink/pull/15337#discussion_r599389303
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/util/config/memory/ManagedMemoryUtils.java
##########
@@ -155,4 +155,19 @@ public static double getFractionRoundedDown(final long dividend, final long divi
BigDecimal.ROUND_DOWN)
.doubleValue();
}
+
+ public static void validateManagedMemoryUseCaseWeights(
+ Map<ManagedMemoryUseCase, Integer> existingOperatorScopeUseCaseWeights,
+ Map<ManagedMemoryUseCase, Integer> newOperatorScopeUseCaseWeights) {
Review comment:
It's a bit unclear from the method name what does the method validate.
I'd suggest `validateUseCaseWeightsNoConflict(weights1, weights2)`.
##########
File path: flink-streaming-java/src/main/java/org/apache/flink/streaming/api/graph/StreamNode.java
##########
@@ -209,6 +210,8 @@ public void setResources(ResourceSpec minResources, ResourceSpec preferredResour
public void setManagedMemoryUseCaseWeights(
Map<ManagedMemoryUseCase, Integer> operatorScopeUseCaseWeights,
Set<ManagedMemoryUseCase> slotScopeUseCases) {
+ validateManagedMemoryUseCaseWeights(
+ managedMemoryOperatorScopeUseCaseWeights, operatorScopeUseCaseWeights);
Review comment:
I think the requirement that no existing weights should be overwritten does not come from `StreamNode`, but from `TransformationTranslator`. Therefore, I'd suggest to enforce this validation in `SimpleTransformationTranslator` rather than here.
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/util/config/memory/ManagedMemoryUtils.java
##########
@@ -155,4 +155,19 @@ public static double getFractionRoundedDown(final long dividend, final long divi
BigDecimal.ROUND_DOWN)
.doubleValue();
}
+
+ public static void validateManagedMemoryUseCaseWeights(
+ Map<ManagedMemoryUseCase, Integer> existingOperatorScopeUseCaseWeights,
+ Map<ManagedMemoryUseCase, Integer> newOperatorScopeUseCaseWeights) {
+ for (Map.Entry<ManagedMemoryUseCase, Integer> entry :
+ newOperatorScopeUseCaseWeights.entrySet()) {
+ Integer existingWeight = existingOperatorScopeUseCaseWeights.get(entry.getKey());
+ if (existingWeight != null && !existingWeight.equals(entry.getValue())) {
+ throw new IllegalConfigurationException(
+ String.format(
+ "The new value '%d' mismatch with the existing value '%d' for managed memory consumer weight '%s'.",
+ entry.getValue(), existingWeight, entry.getKey()));
+ }
+ }
Review comment:
The validation can be simplified as follows.
```
weights1.forEach(
(useCase, weight) ->
checkState(
weights2.getOrDefault(useCase, weight).equals(weight), "err msg"));
```
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] dianfu closed pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
dianfu closed pull request #15337:
URL: https://github.com/apache/flink/pull/15337
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] dianfu commented on pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
dianfu commented on pull request #15337:
URL: https://github.com/apache/flink/pull/15337#issuecomment-804751939
@xintongsong Thanks for the review. Updated the PR accordingly~
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] dianfu commented on a change in pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
dianfu commented on a change in pull request #15337:
URL: https://github.com/apache/flink/pull/15337#discussion_r599471761
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/util/config/memory/ManagedMemoryUtils.java
##########
@@ -155,4 +157,20 @@ public static double getFractionRoundedDown(final long dividend, final long divi
BigDecimal.ROUND_DOWN)
.doubleValue();
}
+
+ public static void validateUseCaseWeightsNoConflict(
+ Map<ManagedMemoryUseCase, Integer> existingOperatorScopeUseCaseWeights,
+ Map<ManagedMemoryUseCase, Integer> newOperatorScopeUseCaseWeights) {
Review comment:
Good catch! Agree, I will address this during merging the 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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #15337:
URL: https://github.com/apache/flink/pull/15337#issuecomment-804610022
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fe8a261ff73f5e252902403d8d7c3e396420d6db UNKNOWN
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15337:
URL: https://github.com/apache/flink/pull/15337#issuecomment-804610022
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15230",
"triggerID" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"triggerType" : "PUSH"
}, {
"hash" : "a7f9add4ad44811fadc9944046e5c698473bb1de",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15260",
"triggerID" : "a7f9add4ad44811fadc9944046e5c698473bb1de",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fe8a261ff73f5e252902403d8d7c3e396420d6db Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15230)
* a7f9add4ad44811fadc9944046e5c698473bb1de Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15260)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot commented on pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
flinkbot commented on pull request #15337:
URL: https://github.com/apache/flink/pull/15337#issuecomment-804604377
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 fe8a261ff73f5e252902403d8d7c3e396420d6db (Tue Mar 23 04:17:12 UTC 2021)
**Warnings:**
* No documentation files were touched! Remember to keep the Flink docs up to date!
<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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15337:
URL: https://github.com/apache/flink/pull/15337#issuecomment-804610022
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15230",
"triggerID" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fe8a261ff73f5e252902403d8d7c3e396420d6db Azure: [PENDING](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15230)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] dianfu commented on pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
dianfu commented on pull request #15337:
URL: https://github.com/apache/flink/pull/15337#issuecomment-804601164
cc @xintongsong
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] xintongsong commented on a change in pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
xintongsong commented on a change in pull request #15337:
URL: https://github.com/apache/flink/pull/15337#discussion_r599461642
##########
File path: flink-runtime/src/main/java/org/apache/flink/runtime/util/config/memory/ManagedMemoryUtils.java
##########
@@ -155,4 +157,20 @@ public static double getFractionRoundedDown(final long dividend, final long divi
BigDecimal.ROUND_DOWN)
.doubleValue();
}
+
+ public static void validateUseCaseWeightsNoConflict(
+ Map<ManagedMemoryUseCase, Integer> existingOperatorScopeUseCaseWeights,
+ Map<ManagedMemoryUseCase, Integer> newOperatorScopeUseCaseWeights) {
Review comment:
nit:
Do we need to identify the two maps (in both arguments and the error message) by "existing" and "new"? From the perspective of this util method, it should make no difference which one is the existing and which one is the new.
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] dianfu commented on pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
dianfu commented on pull request #15337:
URL: https://github.com/apache/flink/pull/15337#issuecomment-805397275
It seems that the tests have failed because of network issues.
Merging as it has passed in my personal azure pipeline: https://dev.azure.com/dianfu/Flink/_build/results?buildId=298&view=results
--
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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15337:
URL: https://github.com/apache/flink/pull/15337#issuecomment-804610022
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15230",
"triggerID" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* fe8a261ff73f5e252902403d8d7c3e396420d6db Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15230)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [flink] flinkbot edited a comment on pull request #15337: [FLINK-21916] Allows multiple kinds of ManagedMemoryUseCase for the same operator
Posted by GitBox <gi...@apache.org>.
flinkbot edited a comment on pull request #15337:
URL: https://github.com/apache/flink/pull/15337#issuecomment-804610022
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"status" : "DELETED",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15230",
"triggerID" : "fe8a261ff73f5e252902403d8d7c3e396420d6db",
"triggerType" : "PUSH"
}, {
"hash" : "a7f9add4ad44811fadc9944046e5c698473bb1de",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15260",
"triggerID" : "a7f9add4ad44811fadc9944046e5c698473bb1de",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* a7f9add4ad44811fadc9944046e5c698473bb1de Azure: [FAILURE](https://dev.azure.com/apache-flink/98463496-1af2-4620-8eab-a2ecc1a2e6fe/_build/results?buildId=15260)
<details>
<summary>Bot commands</summary>
The @flinkbot bot supports the following commands:
- `@flinkbot run travis` re-run the last Travis build
- `@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.
For queries about this service, please contact Infrastructure at:
users@infra.apache.org