Skip to content

Conversation

@KarmaGYZ
Copy link
Contributor

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

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 8cd1586 (Thu Jul 22 03:37:50 UTC 2021)

✅no warnings

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 Jul 22, 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

@sjwiesman sjwiesman self-requested a review August 2, 2021 14:01
Copy link
Contributor

@sjwiesman sjwiesman left a comment

Choose a reason for hiding this comment

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

I've made a first pass

## How it works

As described in [Flink Architecture]({{< ref "docs/concepts/flink-architecture" >}}#anatomy-of-a-flink-cluster),
the resource for task execution in TaskManager is split into a bunch of slots, where job tasks are scheduled.
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
the resource for task execution in TaskManager is split into a bunch of slots, where job tasks are scheduled.
task execution resources in a TaskManager are split into many slots.


As described in [Flink Architecture]({{< ref "docs/concepts/flink-architecture" >}}#anatomy-of-a-flink-cluster),
the resource for task execution in TaskManager is split into a bunch of slots, where job tasks are scheduled.
The slot is the basic unit of both resource scheduling and resource requirement in Flink runtime.
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
The slot is the basic unit of both resource scheduling and resource requirement in Flink runtime.
The slot is the basic unit of both resource scheduling and resource requirement in Flinks runtime.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Maybe Flink's?

Comment on lines 60 to 62
In fine-grained resource management, the slots are requested with specific resource profiles, which can be specified by users.
Flink will respect those user-specified resource requirements and dynamically cut an exactly-matched slot out of the TaskManager’s available
resources. As shown above, there is a requirement for a slot with 0.25 Core and 1GB memory and Flink allocates *Slot 1* for it.
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
In fine-grained resource management, the slots are requested with specific resource profiles, which can be specified by users.
Flink will respect those user-specified resource requirements and dynamically cut an exactly-matched slot out of the TaskManager’s available
resources. As shown above, there is a requirement for a slot with 0.25 Core and 1GB memory and Flink allocates *Slot 1* for it.
With fine-grained resource management, the slots requests contain specific resource profiles, which users can specify.
Flink will respect those user-specified resource requirements and dynamically cut an exactly-matched slot out of the TaskManager’s available
resources. As shown above, there is a requirement for a slot with 0.25 Core and 1GB memory, and Flink allocates *Slot 1* for it.

Comment on lines +57 to +63
Previously in Flink, the resource requirement only contained the number of the required slots, without fine-grained resource
profiles, namely **coarse-grained resource management**. The TaskManager contained a fixed number of identical slots to fulfill those requirements.
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
Previously in Flink, the resource requirement only contained the number of the required slots, without fine-grained resource
profiles, namely **coarse-grained resource management**. The TaskManager contained a fixed number of identical slots to fulfill those requirements.

I moved this down

In fine-grained resource management, the slots are requested with specific resource profiles, which can be specified by users.
Flink will respect those user-specified resource requirements and dynamically cut an exactly-matched slot out of the TaskManager’s available
resources. As shown above, there is a requirement for a slot with 0.25 Core and 1GB memory and Flink allocates *Slot 1* for it.

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
{{< hint info >}}
Previously in Flink, the resource requirement only contained the number of the required slots, without fine-grained resource
profiles, namely **coarse-grained resource management**. The TaskManager contained a fixed number of identical slots to fulfill those requirements.
{{< /hint >}}

Comment on lines 175 to 177
<div class="alert alert-info">
<strong>Note:</strong> Each slot sharing group can only attach to one specified resource, any conflict will fail the compiling of your job.
</div>
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
<div class="alert alert-info">
<strong>Note:</strong> Each slot sharing group can only attach to one specified resource, any conflict will fail the compiling of your job.
</div>
{{< hint warning >}}
**Note:** Each slot sharing group can only attach to one specified resource, any conflict will fail the compiling of your job.
{{< /hint >}}

Flink will respect those user-specified resource requirements and dynamically cut an exactly-matched slot out of the TaskManager’s available
resources. As shown above, there is a requirement for a slot with 0.25 Core and 1GB memory and Flink allocates *Slot 1* for it.

For the resource requirement without a specified resource profile, Flink will automatically decide the resource profile of it.
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
For the resource requirement without a specified resource profile, Flink will automatically decide the resource profile of it.
For the resource requirement without a specified resource profile, Flink will automatically decide a resource profile.

the Flink runtime selects a TaskManager to cut slots and allocates TaskManagers on [Native Kubernetes]({{< ref "docs/deployment/resource-providers/native_kubernetes" >}})
and [YARN]({{< ref "docs/deployment/resource-providers/yarn" >}}). Note that the resource allocation strategy is pluggable in
Flink runtime and here we introduce its default implementation in the first step of fine-grained resource
management. In the future, there might be various strategies that can be selected for different scenarios.
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
management. In the future, there might be various strategies that can be selected for different scenarios.
management. In the future, there might be various strategies that users can select for different scenarios.

Comment on lines 28 to 29
Apache Flink allows you to control the resource consumption of your workload in a finer granularity, namely **fine-grained resource management**.
It provides means for users to further improve Flink’s resource efficiency with knowledge of their specific scenarios.
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
Apache Flink allows you to control the resource consumption of your workload in a finer granularity, namely **fine-grained resource management**.
It provides means for users to further improve Flink’s resource efficiency with knowledge of their specific scenarios.
Apache Flink works hard to auto-derive sensible default resource requirements for all applications out of the box.
For users who wish to fine-tune their resource consumption, based on knowledge of their specific scenarios, Flink offers **fine-grained resource management**.

I want to make it clear to new users that you don't have to do this.

@KarmaGYZ
Copy link
Contributor Author

KarmaGYZ commented Aug 3, 2021

Thanks for the valuable comments! @sjwiesman PR updated.

@KarmaGYZ KarmaGYZ requested a review from sjwiesman August 9, 2021 03:35
@KarmaGYZ
Copy link
Contributor Author

@sjwiesman Hi, would you like to give it another pass?

@sjwiesman sjwiesman closed this in d2002c1 Aug 17, 2021
hhkkxxx133 pushed a commit to hhkkxxx133/flink that referenced this pull request Aug 25, 2021
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