Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[FLINK-25402] Introduce working directory for Flink processes #18083

Merged
merged 8 commits into from
Jan 19, 2022

Conversation

tillrohrmann
Copy link
Contributor

@tillrohrmann tillrohrmann commented Dec 10, 2021

This PR implements FLIP-198. It consists of several commits that implement the proposed changes:

b70bdca: Make JobManager process resource id configurable via jobmanager.resource-id

This commit introduces a new configuration option jobmanager.resource-id to control the ResourceID of the JobManager process.

308bb99: Introduce ClusterOptions.PROCESS_WORKING_DIR_BASE for configuring a process directory

This commit introduces the configuration options process.working-dir, process.jobmanager.working-dir and process.taskmanager.working-dir to configure a working directory for the JobManager
and TaskManager process. The resulting working directory will be <WORKING_DIR_BASE>/jm_<RESOURCE_ID> and <WORKING_DIR_BASE>/tm_<RESOURCE_ID>.

45d92bb: Clear tmp directory when setting up the working directory

This commit introduces a tmp directory that will be created in each working directory. Moreover, this tmp directory is cleaned whenever the process restarts.

f51113f: Let taskmanager.state.local.root-dirs default to <WORKING_DIR>/localState

This commit makes <WORKING_DIR>/localState the default for taskmanager.state.local.root-dirs. That way the local state will be stored in the working directory if not explicitly configured.

dd6db5f: Set state.backend.rocksdb.localdir to default to <WORKING_DIR>/tmp

This commit makes <WORKING_DIR>/tmp the default for state.backend.rocksdb.localdir if not explicitly configured. This is a behaviour change because before the RocksDB local dir would default to io.tmp.dirs. With this change, the default RocksDB working directory is colocated on the same volume as the local state directory.

@flinkbot
Copy link
Collaborator

flinkbot commented Dec 10, 2021

CI report:

Bot commands The @flinkbot bot supports the following commands:
  • @flinkbot run azure re-run the last Azure build

@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 7370627 (Fri Dec 10 16:49:12 UTC 2021)

Warnings:

  • No documentation files were touched! Remember to keep the Flink docs up to date!
  • Invalid pull request title: No valid Jira ID provided

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

@tillrohrmann tillrohrmann marked this pull request as ready for review December 21, 2021 15:19
@tillrohrmann tillrohrmann changed the title [Draft][FLIP-198] Introduce working directory for Flink processes [FLIP-198] Introduce working directory for Flink processes Dec 21, 2021
@tillrohrmann tillrohrmann changed the title [FLIP-198] Introduce working directory for Flink processes [FLINK-25402] Introduce working directory for Flink processes Dec 21, 2021
Copy link
Member

@Myasuka Myasuka left a comment

Choose a reason for hiding this comment

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

Haven't gone through the whole PR, just care about how to handle multi directories from java.io.tmpdir property.

@tillrohrmann
Copy link
Contributor Author

Thanks a lot for the review @zentol. I've addressed most of your comments. The one I only addressed by commenting on it, I've left unresolved. I've pushed and update (unfortunately I screwed up and had to force push :-( ). PTAL.

@tillrohrmann
Copy link
Contributor Author

@zentol I've update the PR. Hopefully, I have addressed all your comments. PTAL.

Copy link
Member

@Myasuka Myasuka left a comment

Choose a reason for hiding this comment

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

Please take a look at my comment to shuffle the tmp directories with multi disks.

Copy link
Contributor

@zentol zentol left a comment

Choose a reason for hiding this comment

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

+1 from my side.

@tillrohrmann
Copy link
Contributor Author

Thanks for your reviews @Myasuka and @zentol. I've addressed all your comments and pushed an updated version. If AZP gives green light, then I will merge it later.

Copy link
Member

@Myasuka Myasuka 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 the update! LGTM.

Renames

ShutdownBehaviour.STOP_APPLICATION -> ShutdownBehaviour.GRACEFUL_SHUTDOWN
ShutdownBehaviour.STOP_PROCESS -> ShutdownBehaviour.PROCESS_FAILURE
…onfiguring a process directory

This commit introduces the configuration option to configure a working directory for the JobManager
and TaskManager process. The resulting working directory will be <WORKING_DIR_BASE>/jm_<RESOURCE_ID>
and <WORKING_DIR_BASE>/tm_<RESOURCE_ID> respectively.
This commit ensures that the <WORKING_DIR>/tmp directory is always empty when a
process is being started.
…NG_DIR>/tmp

This is a behaviour change because before the RocksDB local dir would default to io.tmp.dirs.

This closes apache#18083.
@tillrohrmann tillrohrmann merged commit 95f3f7d into apache:master Jan 19, 2022
@tillrohrmann tillrohrmann deleted the FLIP-198 branch January 19, 2022 15:48
niklassemmler pushed a commit to niklassemmler/flink that referenced this pull request Feb 3, 2022
…NG_DIR>/tmp

This is a behaviour change because before the RocksDB local dir would default to io.tmp.dirs.

This closes apache#18083.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants