[
https://issues.apache.org/jira/browse/HADOOP-18636?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17690545#comment-17690545
]
ASF GitHub Bot commented on HADOOP-18636:
-----------------------------------------
steveloughran opened a new pull request, #5412:
URL: https://github.com/apache/hadoop/pull/5412
Even though DiskChecker.mkdirsWithExistsCheck() will create the directory
tree, it is only called *after* the enumeration of directories with available
space has completed.
Directories which don't exist are reported as having 0 space, therefore the
mkdirs code is never reached.
Adding a simple mkdirs() -without bothering to check the outcome- ensures
that if a dir has been deleted then it will be reconstructed if possible. If it
can't it will still have 0 bytes of space reported and so be excluded from the
allocation.
No need to call exists() first as that is what mkdirs() does first anyway.
### How was this patch tested?
new tests, doing the s3a and abfs runs as diligence
### For code changes:
- [X] Does the title or this PR starts with the corresponding JIRA issue id
(e.g. 'HADOOP-17799. Your PR title ...')?
- [ ] Object storage: have the integration tests been executed and the
endpoint declared according to the connector-specific documentation?
- [ ] If adding new dependencies to the code, are these dependencies
licensed in a way that is compatible for inclusion under [ASF
2.0](http://www.apache.org/legal/resolved.html#category-a)?
- [ ] If applicable, have you updated the `LICENSE`, `LICENSE-binary`,
`NOTICE-binary` files?
> LocalDirAllocator cannot recover from directory tree deletion during the life
> of a filesystem client
> ----------------------------------------------------------------------------------------------------
>
> Key: HADOOP-18636
> URL: https://issues.apache.org/jira/browse/HADOOP-18636
> Project: Hadoop Common
> Issue Type: Bug
> Components: fs, fs/azure, fs/s3
> Affects Versions: 3.3.4
> Reporter: Steve Loughran
> Assignee: Steve Loughran
> Priority: Minor
>
> The s3a and abfs clients use LocalDirAllocator for allocating files in local
> (temporary) storage for buffering blocks to write, and, for the s3a staging
> committer, files being staged.
> When initialized (or when the configuration key value is updated)
> LocalDirAllocator enumerates all directories in the list and calls
> {{mkdirs()}} to create them.
> when you ask actually for a file, it will look for the parent dir, but it
> calls {{mkdir()}}, rather than {{mkdirs()}}
> This means it will recreate a missing parent file but cannot recover from a
> missing grandparent. If during the life of an application the temp directory
> is cleaned up, it can result in the failure of the application.
> Fix add an "s" to the right place in the production code, plus a new test.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]