Skip to content

Conversation

@jinxing64
Copy link
Contributor

What is the purpose of the change

Calculating and announcing the volume of required network memory for shuffle is an important part of 'fine grained resource management'(FLIP-156). This PR proposes the implementation and help user avoid suffering from network memory shortage.

Brief change log

  • Add an interface in ShuffleMaster to calculate network memory requirements of ExecutionJobVertex
  • SSGNetworkMemoryCalculator sums up network memory requirements of ExecutionJobVertex in the same SlotSharingGroup and update the corresponding ResourceProfile before scheduling

Verifying this change

  • unit tests are added for SSGNetworkMemoryCalculator
  • unit tests are added for NettyShuffleUtils
  • unit tests are modified for EdgeManagerBuildUtil

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 Jun 16, 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 536c625 (Thu Sep 23 17:57:03 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.

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 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 Jun 16, 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

@jinxing64 jinxing64 changed the title [WIP][FLINK-15031][runtime] Calculate required shuffle memory before allocating slots if resources are specified [FLINK-15031][runtime] Calculate required shuffle memory before allocating slots if resources are specified Jun 17, 2021
@KarmaGYZ
Copy link
Contributor

Thanks for the PR, @jinxing64 . Would you like to rebase on the lastest master and resolve the conflict? I think @zhuzhurk may help to review it.

@jinxing64 jinxing64 force-pushed the FLINK-15031 branch 2 times, most recently from 9b3f70d to c036cb8 Compare June 28, 2021 06:32
Copy link
Contributor

@zhuzhurk zhuzhurk left a comment

Choose a reason for hiding this comment

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

Thanks for opening this PR @jinxing64
The change generally looks good to me. There are some minor comments though.

My major concern is about the possible doubled network memory requirement if include floating buffers into the announced memory. One idea I can think of is to introduce a fraction style config to make the extra network memory configurable. See comment in FLINK-15031.

@jinxing64 jinxing64 force-pushed the FLINK-15031 branch 4 times, most recently from 8862f89 to 7ee72c3 Compare July 1, 2021 03:56
@jinxing64
Copy link
Contributor Author

Thanks a lot for shepherd on this @zhuzhurk ~
I updated the PR according your comments and CI gives green now ~
Please take a second round of review when you have time ~

@jinxing64
Copy link
Contributor Author

Thanks @zhuzhurk for your comments and I updated accordingly;
I will test by real Flink job after #16307 this merged and get back then.

@jinxing64
Copy link
Contributor Author

@zhuzhurk Thanks for deep review ~

I verified the network memory requirement calculating algorithm by real Flink job. The result is in line with expectation.
The testing dimensions includes:

  1. Blocking & Pipelined shuffle;
  2. ALL_TO_ALL & POINTWISE edge;
  3. Sort & Hash shuffle algorithm;
  4. Unknown & Fine grained ResourceProfile;

Copy link
Contributor

@zhuzhurk zhuzhurk left a comment

Choose a reason for hiding this comment

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

Thanks for addressing all the comments! @jinxing64
The change looks good to me.
Will merge it once CI gives green.

@zhuzhurk
Copy link
Contributor

zhuzhurk commented Jul 6, 2021

Merging.

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.

5 participants