You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@hudi.apache.org by "slfan1989 (via GitHub)" <gi...@apache.org> on 2023/06/27 16:06:06 UTC
[GitHub] [hudi] slfan1989 opened a new pull request, #9065: [HUDI-6451]. Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath.
slfan1989 opened a new pull request, #9065:
URL: https://github.com/apache/hudi/pull/9065
### Change Logs
JIRA: [HUDI-6451]. Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath.
The HoodieMemoryConfig#getDefaultSpillableMapBasePath method retrieves a path from YARN's LOCAL_DIRS environment variable. However, the order of LOCAL_DIRS concatenation in YARN is typically fixed, resulting in the DefaultSpillableMapBasePath being a fixed value. Considering the disk load perspective, we should randomize the selection of a path from the array.
In typical scenarios, YARN's NodeManager (NM) with five disks, namely `/nm1/localdir`, `/nm2/localdir`, `/nm3/localdir`, `/nm4/localdir`, and `/nm5/localdir`, would choose `/nm1/localdir` as the preferred option.
We should randomly choose a disk.
### Impact
The disk selection strategy has been improved to ensure the availability of multiple disks.
### Risk level (write none, low medium or high below)
none.
### Documentation Update
_Describe any necessary documentation update if there is any new feature, config, or user-facing change_
- _The config description must be updated if new configs are added or the default value of the configs are changed_
- _Any new feature or user-facing change requires updating the Hudi website. Please create a Jira ticket, attach the
ticket number here and follow the [instruction](https://hudi.apache.org/contribute/developer-setup#website) to make
changes to the website._
### Contributor's checklist
- [ ] Read through [contributor's guide](https://hudi.apache.org/contribute/how-to-contribute)
- [ ] Change Logs and Impact were stated clearly
- [ ] Adequate tests were added if applicable
- [ ] CI passed
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] slfan1989 commented on a diff in pull request #9065: [HUDI-6451] Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath
Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on code in PR #9065:
URL: https://github.com/apache/hudi/pull/9065#discussion_r1244702211
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieMemoryConfig.java:
##########
@@ -140,7 +144,9 @@ private HoodieMemoryConfig() {
public static String getDefaultSpillableMapBasePath() {
String[] localDirs = FileIOUtils.getConfiguredLocalDirs();
- return (localDirs != null && localDirs.length > 0) ? localDirs[0] : "/tmp/";
+ List<String> localDirLists = Arrays.asList(localDirs);
+ Collections.shuffle(localDirLists);
+ return !localDirLists.isEmpty() ? localDirLists.get(0) : "/tmp/";
Review Comment:
Thank you very much for helping with the code review! `LOCAL_DIRS` is an environment variable set by YARN during Container startup, taking into consideration disk space availability and cases where a disk may be inaccessible.
- Hudi#FileIOUtils#getYarnLocalDirs
```
private static String getYarnLocalDirs() {
String localDirs = System.getenv("LOCAL_DIRS");
if (localDirs == null) {
throw new HoodieIOException("Yarn Local dirs can't be empty");
}
return localDirs;
}
```
- YARN
1. LinuxContainerExecutor#buildContainerRuntimeContext#setLocalDir
```
private ContainerRuntimeContext buildContainerRuntimeContext(
ContainerStartContext ctx, Path pidFilePath, String resourcesOptions,
String tcCommandFile, List<String> numaArgs) {
.....
Container container = ctx.getContainer();
ContainerRuntimeContext.Builder builder = new ContainerRuntimeContext
.Builder(container);
if (prefixCommands.size() > 0) {
builder.setExecutionAttribute(CONTAINER_LAUNCH_PREFIX_COMMANDS,
prefixCommands);
}
builder.setExecutionAttribute(LOCALIZED_RESOURCES,
ctx.getLocalizedResources())
.setExecutionAttribute(RUN_AS_USER, getRunAsUser(ctx.getUser()))
.setExecutionAttribute(USER, ctx.getUser())
.setExecutionAttribute(APPID, ctx.getAppId())
.....
.setExecutionAttribute(NM_PRIVATE_TRUSTSTORE_PATH,
ctx.getNmPrivateTruststorePath())
.setExecutionAttribute(PID_FILE_PATH, pidFilePath)
// (**) Set the environment variable LocalDir
.setExecutionAttribute(LOCAL_DIRS, ctx.getLocalDirs())
.....
if (tcCommandFile != null) {
builder.setExecutionAttribute(TC_COMMAND_FILE, tcCommandFile);
}
return builder.build();
}
```
2. ContainerLaunch#call#prepareLocalDirs
```
// dirsHandler is LocalDirsHandlerService
List<String> localDirs = dirsHandler.getLocalDirs();
if (truststore != null) {
addTruststoreVars(environment, containerWorkDir);
}
```
3. LocalDirsHandlerService#getLocalDirs
```
public List<String> getLocalDirs() {
return localDirs.getGoodDirs();
}
```
4. DirectoryCollection#checkDirs
```
switch (entry.getValue().cause) {
case DISK_FULL:
fullDirs.add(entry.getKey());
break;
case OTHER:
errorDirs.add(entry.getKey());
break;
default:
LOG.warn(entry.getValue().cause + " is unknown for disk error.");
break;
}
```
YARN's NodeManager automatically scans all managed disks and excludes any faulty disks based on criteria such as high disk utilization or disks that are unable to write data. When using LOCAL_DIRS in Hudi, we randomly select a disk, which should meet our requirements.
@danny0405 @XuQianJin-Stars
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] slfan1989 commented on a diff in pull request #9065: [HUDI-6451] Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath
Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on code in PR #9065:
URL: https://github.com/apache/hudi/pull/9065#discussion_r1244702211
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieMemoryConfig.java:
##########
@@ -140,7 +144,9 @@ private HoodieMemoryConfig() {
public static String getDefaultSpillableMapBasePath() {
String[] localDirs = FileIOUtils.getConfiguredLocalDirs();
- return (localDirs != null && localDirs.length > 0) ? localDirs[0] : "/tmp/";
+ List<String> localDirLists = Arrays.asList(localDirs);
+ Collections.shuffle(localDirLists);
+ return !localDirLists.isEmpty() ? localDirLists.get(0) : "/tmp/";
Review Comment:
Thank you very much for helping with the code review! `LOCAL_DIRS` is an environment variable set by YARN during Container startup, taking into consideration disk space availability and cases where a disk may be inaccessible.
- Hudi#FileIOUtils#getYarnLocalDirs
```
private static String getYarnLocalDirs() {
String localDirs = System.getenv("LOCAL_DIRS");
if (localDirs == null) {
throw new HoodieIOException("Yarn Local dirs can't be empty");
}
return localDirs;
}
```
- YARN
LinuxContainerExecutor#prepareContainer
```
builder.setExecutionAttribute(LOCALIZED_RESOURCES,
ctx.getLocalizedResources())
.setExecutionAttribute(USER, ctx.getUser())
.setExecutionAttribute(CONTAINER_LOCAL_DIRS,
ctx.getContainerLocalDirs())
.setExecutionAttribute(CONTAINER_RUN_CMDS, ctx.getCommands())
.setExecutionAttribute(CONTAINER_ID_STR,
ctx.getContainer().getContainerId().toString());
```
ContainerLaunch#call
```
List<String> containerLocalDirs = getContainerLocalDirs(localDirs);
if (truststore != null) {
addTruststoreVars(environment, containerWorkDir);
}
prepareContainer(localResources, containerLocalDirs);
// Write out the environment
exec.writeLaunchEnv(containerScriptOutStream, environment,
localResources, launchContext.getCommands(), containerLogDir, user, nmEnvVars);
```
ContainerLaunch#prepareContainer
```
protected List<String> getContainerLocalDirs(List<String> localDirs) {
List<String> containerLocalDirs = new ArrayList<>(localDirs.size());
String user = container.getUser();
String appIdStr = app.getAppId().toString();
String relativeContainerLocalDir = ContainerLocalizer.USERCACHE
+ Path.SEPARATOR + user + Path.SEPARATOR + ContainerLocalizer.APPCACHE
+ Path.SEPARATOR + appIdStr + Path.SEPARATOR;
for (String localDir : localDirs) {
containerLocalDirs.add(localDir + Path.SEPARATOR
+ relativeContainerLocalDir);
}
return containerLocalDirs;
}
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] XuQianJin-Stars commented on a diff in pull request #9065: [HUDI-6451] Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath
Posted by "XuQianJin-Stars (via GitHub)" <gi...@apache.org>.
XuQianJin-Stars commented on code in PR #9065:
URL: https://github.com/apache/hudi/pull/9065#discussion_r1244603442
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieMemoryConfig.java:
##########
@@ -140,7 +144,9 @@ private HoodieMemoryConfig() {
public static String getDefaultSpillableMapBasePath() {
String[] localDirs = FileIOUtils.getConfiguredLocalDirs();
- return (localDirs != null && localDirs.length > 0) ? localDirs[0] : "/tmp/";
+ List<String> localDirLists = Arrays.asList(localDirs);
+ Collections.shuffle(localDirLists);
+ return !localDirLists.isEmpty() ? localDirLists.get(0) : "/tmp/";
Review Comment:
> Nice catch ~
Nice catch +1, An optimization point, is it possible to return the path with the most available hard disk space?
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot commented on pull request #9065: [HUDI-6451]. Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath.
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9065:
URL: https://github.com/apache/hudi/pull/9065#issuecomment-1609847246
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6a5358f043b37588f903bb3422c9e46a01ae92ba",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "6a5358f043b37588f903bb3422c9e46a01ae92ba",
"triggerType" : "PUSH"
}, {
"hash" : "6ed85ba00caa5b33884b02fa54b86d7583ee5464",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "6ed85ba00caa5b33884b02fa54b86d7583ee5464",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 6a5358f043b37588f903bb3422c9e46a01ae92ba UNKNOWN
* 6ed85ba00caa5b33884b02fa54b86d7583ee5464 UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot 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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] danny0405 merged pull request #9065: [HUDI-6451] Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath
Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 merged PR #9065:
URL: https://github.com/apache/hudi/pull/9065
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] danny0405 commented on a diff in pull request #9065: [HUDI-6451]. Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath.
Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 commented on code in PR #9065:
URL: https://github.com/apache/hudi/pull/9065#discussion_r1244597833
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieMemoryConfig.java:
##########
@@ -140,7 +144,9 @@ private HoodieMemoryConfig() {
public static String getDefaultSpillableMapBasePath() {
String[] localDirs = FileIOUtils.getConfiguredLocalDirs();
- return (localDirs != null && localDirs.length > 0) ? localDirs[0] : "/tmp/";
+ List<String> localDirLists = Arrays.asList(localDirs);
+ Collections.shuffle(localDirLists);
+ return !localDirLists.isEmpty() ? localDirLists.get(0) : "/tmp/";
Review Comment:
Nice catch ~
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot commented on pull request #9065: [HUDI-6451]. Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath.
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9065:
URL: https://github.com/apache/hudi/pull/9065#issuecomment-1609912349
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6a5358f043b37588f903bb3422c9e46a01ae92ba",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "6a5358f043b37588f903bb3422c9e46a01ae92ba",
"triggerType" : "PUSH"
}, {
"hash" : "6ed85ba00caa5b33884b02fa54b86d7583ee5464",
"status" : "PENDING",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=18129",
"triggerID" : "6ed85ba00caa5b33884b02fa54b86d7583ee5464",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 6a5358f043b37588f903bb3422c9e46a01ae92ba UNKNOWN
* 6ed85ba00caa5b33884b02fa54b86d7583ee5464 Azure: [PENDING](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=18129)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot 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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] danny0405 commented on a diff in pull request #9065: [HUDI-6451] Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath
Posted by "danny0405 (via GitHub)" <gi...@apache.org>.
danny0405 commented on code in PR #9065:
URL: https://github.com/apache/hudi/pull/9065#discussion_r1244609302
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieMemoryConfig.java:
##########
@@ -140,7 +144,9 @@ private HoodieMemoryConfig() {
public static String getDefaultSpillableMapBasePath() {
String[] localDirs = FileIOUtils.getConfiguredLocalDirs();
- return (localDirs != null && localDirs.length > 0) ? localDirs[0] : "/tmp/";
+ List<String> localDirLists = Arrays.asList(localDirs);
+ Collections.shuffle(localDirLists);
+ return !localDirLists.isEmpty() ? localDirLists.get(0) : "/tmp/";
Review Comment:
Yeah, I'm fine with the change if we can sift out the dist that has no enough disk space.
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot commented on pull request #9065: [HUDI-6451]. Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath.
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9065:
URL: https://github.com/apache/hudi/pull/9065#issuecomment-1609835252
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6a5358f043b37588f903bb3422c9e46a01ae92ba",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "6a5358f043b37588f903bb3422c9e46a01ae92ba",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 6a5358f043b37588f903bb3422c9e46a01ae92ba UNKNOWN
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot 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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] hudi-bot commented on pull request #9065: [HUDI-6451]. Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath.
Posted by "hudi-bot (via GitHub)" <gi...@apache.org>.
hudi-bot commented on PR #9065:
URL: https://github.com/apache/hudi/pull/9065#issuecomment-1610142881
<!--
Meta data
{
"version" : 1,
"metaDataEntries" : [ {
"hash" : "6a5358f043b37588f903bb3422c9e46a01ae92ba",
"status" : "UNKNOWN",
"url" : "TBD",
"triggerID" : "6a5358f043b37588f903bb3422c9e46a01ae92ba",
"triggerType" : "PUSH"
}, {
"hash" : "6ed85ba00caa5b33884b02fa54b86d7583ee5464",
"status" : "FAILURE",
"url" : "https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=18129",
"triggerID" : "6ed85ba00caa5b33884b02fa54b86d7583ee5464",
"triggerType" : "PUSH"
} ]
}-->
## CI report:
* 6a5358f043b37588f903bb3422c9e46a01ae92ba UNKNOWN
* 6ed85ba00caa5b33884b02fa54b86d7583ee5464 Azure: [FAILURE](https://dev.azure.com/apache-hudi-ci-org/785b6ef4-2f42-4a89-8f0e-5f0d7039a0cc/_build/results?buildId=18129)
<details>
<summary>Bot commands</summary>
@hudi-bot supports the following commands:
- `@hudi-bot 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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] slfan1989 commented on a diff in pull request #9065: [HUDI-6451] Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath
Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on code in PR #9065:
URL: https://github.com/apache/hudi/pull/9065#discussion_r1244716949
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieMemoryConfig.java:
##########
@@ -140,7 +144,9 @@ private HoodieMemoryConfig() {
public static String getDefaultSpillableMapBasePath() {
String[] localDirs = FileIOUtils.getConfiguredLocalDirs();
- return (localDirs != null && localDirs.length > 0) ? localDirs[0] : "/tmp/";
+ List<String> localDirLists = Arrays.asList(localDirs);
+ Collections.shuffle(localDirLists);
+ return !localDirLists.isEmpty() ? localDirLists.get(0) : "/tmp/";
Review Comment:
In YARN, the NodeManager (NM) monitors the availability and utilization of local disks. In general, if a machine has 25% or more faulty disks, the NM will be marked as unavailable. Additionally, if the utilization of a disk exceeds 90%, it will also be marked as unavailable.
- yarn.nodemanager.disk-health-checker.min-healthy-disks
```
The minimum fraction of number of disks to be healthy for the nodemanager to launch new containers. This applies to nm-local-dirs and nm-log-dirs.
public static final String NM_MIN_HEALTHY_DISKS_FRACTION =
NM_DISK_HEALTH_CHECK_PREFIX + "min-healthy-disks";
public static final float DEFAULT_NM_MIN_HEALTHY_DISKS_FRACTION = 0.25F;
```
- yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentage
```
The maximum percentage of disk space that can be used after which a disk is
marked as offline. Values can range from 0.0 to 100.0. If the value is
greater than or equal to 100, NM will check for full disk. This applies to
nm-local-dirs and nm-log-dirs.
public static final String NM_MAX_PER_DISK_UTILIZATION_PERCENTAGE =
NM_DISK_HEALTH_CHECK_PREFIX + "max-disk-utilization-per-disk-percentage";
public static final float DEFAULT_NM_MAX_PER_DISK_UTILIZATION_PERCENTAGE = 90.0F;
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] slfan1989 commented on a diff in pull request #9065: [HUDI-6451] Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath
Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on code in PR #9065:
URL: https://github.com/apache/hudi/pull/9065#discussion_r1244716949
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieMemoryConfig.java:
##########
@@ -140,7 +144,9 @@ private HoodieMemoryConfig() {
public static String getDefaultSpillableMapBasePath() {
String[] localDirs = FileIOUtils.getConfiguredLocalDirs();
- return (localDirs != null && localDirs.length > 0) ? localDirs[0] : "/tmp/";
+ List<String> localDirLists = Arrays.asList(localDirs);
+ Collections.shuffle(localDirLists);
+ return !localDirLists.isEmpty() ? localDirLists.get(0) : "/tmp/";
Review Comment:
- yarn.nodemanager.disk-health-checker.min-healthy-disks
```
The minimum fraction of number of disks to be healthy for the nodemanager to launch new containers. This applies to nm-local-dirs and nm-log-dirs.
public static final String NM_MIN_HEALTHY_DISKS_FRACTION =
NM_DISK_HEALTH_CHECK_PREFIX + "min-healthy-disks";
public static final float DEFAULT_NM_MIN_HEALTHY_DISKS_FRACTION = 0.25F;
```
- yarn.nodemanager.disk-health-checker.max-disk-utilization-per-disk-percentage
```
The maximum percentage of disk space that can be used after which a disk is
marked as offline. Values can range from 0.0 to 100.0. If the value is
greater than or equal to 100, NM will check for full disk. This applies to
nm-local-dirs and nm-log-dirs.
public static final String NM_MAX_PER_DISK_UTILIZATION_PERCENTAGE =
NM_DISK_HEALTH_CHECK_PREFIX + "max-disk-utilization-per-disk-percentage";
public static final float DEFAULT_NM_MAX_PER_DISK_UTILIZATION_PERCENTAGE = 90.0F;
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org
[GitHub] [hudi] slfan1989 commented on a diff in pull request #9065: [HUDI-6451] Randomly obtain a path in HoodieMemoryConfig#getDefaultSpillableMapBasePath
Posted by "slfan1989 (via GitHub)" <gi...@apache.org>.
slfan1989 commented on code in PR #9065:
URL: https://github.com/apache/hudi/pull/9065#discussion_r1244702211
##########
hudi-client/hudi-client-common/src/main/java/org/apache/hudi/config/HoodieMemoryConfig.java:
##########
@@ -140,7 +144,9 @@ private HoodieMemoryConfig() {
public static String getDefaultSpillableMapBasePath() {
String[] localDirs = FileIOUtils.getConfiguredLocalDirs();
- return (localDirs != null && localDirs.length > 0) ? localDirs[0] : "/tmp/";
+ List<String> localDirLists = Arrays.asList(localDirs);
+ Collections.shuffle(localDirLists);
+ return !localDirLists.isEmpty() ? localDirLists.get(0) : "/tmp/";
Review Comment:
Thank you very much for helping with the code review! `LOCAL_DIRS` is an environment variable set by YARN during Container startup, taking into consideration disk space availability and cases where a disk may be inaccessible.
- Hudi#FileIOUtils#getYarnLocalDirs
```
private static String getYarnLocalDirs() {
String localDirs = System.getenv("LOCAL_DIRS");
if (localDirs == null) {
throw new HoodieIOException("Yarn Local dirs can't be empty");
}
return localDirs;
}
```
- YARN
ContainerLaunch#call
```
// dirsHandler is LocalDirsHandlerService
List<String> localDirs = dirsHandler.getLocalDirs();
List<String> containerLocalDirs = getContainerLocalDirs(localDirs);
if (truststore != null) {
addTruststoreVars(environment, containerWorkDir);
}
prepareContainer(localResources, containerLocalDirs);
// Write out the environment
exec.writeLaunchEnv(containerScriptOutStream, environment,
localResources, launchContext.getCommands(), containerLogDir, user, nmEnvVars);
```
ContainerLaunch#prepareContainer
```
protected List<String> getContainerLocalDirs(List<String> localDirs) {
List<String> containerLocalDirs = new ArrayList<>(localDirs.size());
String user = container.getUser();
String appIdStr = app.getAppId().toString();
String relativeContainerLocalDir = ContainerLocalizer.USERCACHE
+ Path.SEPARATOR + user + Path.SEPARATOR + ContainerLocalizer.APPCACHE
+ Path.SEPARATOR + appIdStr + Path.SEPARATOR;
for (String localDir : localDirs) {
containerLocalDirs.add(localDir + Path.SEPARATOR
+ relativeContainerLocalDir);
}
return containerLocalDirs;
}
```
LocalDirsHandlerService#getLocalDirs
```
public List<String> getLocalDirs() {
return localDirs.getGoodDirs();
}
```
--
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.
To unsubscribe, e-mail: commits-unsubscribe@hudi.apache.org
For queries about this service, please contact Infrastructure at:
users@infra.apache.org