Skip to content

Conversation

@KarmaGYZ
Copy link
Contributor

…/process memory in creating TaskExecutorMemoryConfiguration

What is the purpose of the change

(For example: This pull request makes task deployment go through the blob server, rather than through RPC. That way we avoid re-transferring them on each deployment (during recovery).)

Brief change log

(for example:)

  • The TaskInfo is stored in the blob store on job creation time as a persistent artifact
  • Deployments RPC transmits only the blob storage reference
  • TaskManagers retrieve the TaskInfo from the blob cache

Verifying this change

(Please pick either of the following options)

This change is a trivial rework / code cleanup without any test coverage.

(or)

This change is already covered by existing tests, such as (please describe tests).

(or)

This change added tests and can be verified as follows:

(example:)

  • Added integration tests for end-to-end deployment with large payloads (100MB)
  • Extended integration test for recovery after master (JobManager) failure
  • Added test that validates that TaskInfo is transferred only once across recoveries
  • Manually verified the change by running a 4 node cluser with 2 JobManagers and 4 TaskManagers, a stateful streaming program, and killing one JobManager and two TaskManagers during the execution, verifying that recovery happens correctly.

Does this pull request potentially affect one of the following parts:

  • Dependencies (does it add or upgrade a dependency): (yes / no)
  • The public API, i.e., is any changed class annotated with @Public(Evolving): (yes / no)
  • The serializers: (yes / no / don't know)
  • The runtime per-record code paths (performance sensitive): (yes / no / don't know)
  • Anything that affects deployment or recovery: JobManager (and its components), Checkpointing, Kubernetes/Yarn/Mesos, ZooKeeper: (yes / no / don't know)
  • The S3 file system connector: (yes / no / don't know)

Documentation

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

@flinkbot
Copy link
Collaborator

flinkbot commented May 17, 2021

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 7b395b2 (Sat Aug 28 12:14:49 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!

Mention the bot in a comment to re-run the automated checks.

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 for a full explanation of the review process.


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 Bot commands
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

@flinkbot
Copy link
Collaborator

flinkbot commented May 17, 2021

CI report:

Bot commands 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

@KarmaGYZ KarmaGYZ force-pushed the FLINK-22683 branch 2 times, most recently from e46df61 to 259e9d4 Compare May 21, 2021 04:56
Comment on lines 157 to 189
public static long calculateTotalFlinkMemoryFromFactors(Configuration config) {
return config.get(TaskManagerOptions.TASK_HEAP_MEMORY)
.add(config.get(TaskManagerOptions.TASK_OFF_HEAP_MEMORY))
.add(config.get(TaskManagerOptions.NETWORK_MEMORY_MAX))
.add(config.get(TaskManagerOptions.MANAGED_MEMORY_SIZE))
.add(config.get(TaskManagerOptions.FRAMEWORK_HEAP_MEMORY))
.add(config.get(TaskManagerOptions.FRAMEWORK_OFF_HEAP_MEMORY))
.getBytes();
}

public static long calculateTotalProcessMemoryFromFactors(Configuration config) {
return calculateTotalFlinkMemoryFromFactors(config)
+ config.get(TaskManagerOptions.JVM_METASPACE)
.add(config.get(TaskManagerOptions.JVM_OVERHEAD_MAX))
.getBytes();
}
Copy link
Contributor

Choose a reason for hiding this comment

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

Better to add some assertions.

  • memory sizes explicitly configured
  • max == min for network & jvm-overhead

return resourceSpecFromConfig(adjustForLocalExecution(config));
}

public static long calculateTotalFlinkMemoryFromFactors(Configuration config) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public static long calculateTotalFlinkMemoryFromFactors(Configuration config) {
public static long calculateTotalFlinkMemoryFromComponents(Configuration config) {

.getBytes();
}

public static long calculateTotalProcessMemoryFromFactors(Configuration config) {
Copy link
Contributor

Choose a reason for hiding this comment

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

Suggested change
public static long calculateTotalProcessMemoryFromFactors(Configuration config) {
public static long calculateTotalProcessMemoryFromComponents(Configuration config) {

Comment on lines 217 to 219
configuration.set(TaskManagerOptions.TASK_HEAP_MEMORY, MemorySize.ofMebiBytes(10));
configuration.set(TaskManagerOptions.MANAGED_MEMORY_SIZE, MemorySize.ofMebiBytes(10));
Copy link
Contributor

Choose a reason for hiding this comment

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

I think the assumption is that memory sizes for all components should be explicitly configured before starting the TM process. Having only these two options set and the test doesn't fail is an indicator that we do not check the assumption strictly.

@KarmaGYZ KarmaGYZ force-pushed the FLINK-22683 branch 4 times, most recently from 0221799 to 74bf5ad Compare June 2, 2021 06:45
@KarmaGYZ
Copy link
Contributor Author

KarmaGYZ commented Jun 2, 2021

Thanks for the comments @xintongsong . PR updated.

…/process memory in creating TaskExecutorMemoryConfiguration
Copy link
Contributor

@xintongsong xintongsong left a comment

Choose a reason for hiding this comment

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

LGTM. Let's wait for the AZP green light before merging this.

xintongsong pushed a commit that referenced this pull request Jun 3, 2021
…/process memory in creating TaskExecutorMemoryConfiguration

This closes #15936
xintongsong pushed a commit to xintongsong/flink that referenced this pull request Jun 3, 2021
…/process memory in creating TaskExecutorMemoryConfiguration

This closes apache#15936
xintongsong pushed a commit to xintongsong/flink that referenced this pull request Jun 3, 2021
…/process memory in creating TaskExecutorMemoryConfiguration

This closes apache#15936
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.

4 participants