[
https://issues.apache.org/jira/browse/GOBBLIN-1619?focusedWorklogId=739784&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-739784
]
ASF GitHub Bot logged work on GOBBLIN-1619:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 11/Mar/22 00:40
Start Date: 11/Mar/22 00:40
Worklog Time Spent: 10m
Work Description: homatthew opened a new pull request #3477:
URL: https://github.com/apache/gobblin/pull/3477
Dear Gobblin maintainers,
Please accept this PR. I understand that it will not be reviewed until I
have checked off all the steps below!
### JIRA
- [Z] My PR addresses the following [Gobblin
JIRA](https://issues.apache.org/jira/browse/GOBBLIN/) issues and references
them in the PR title. For example, "[GOBBLIN-1619] My Gobblin PR"
- https://issues.apache.org/jira/browse/GOBBLIN-1619
### Description
- [X] Here are some details about my PR, including screenshots (if
applicable):
#### The current implementation recursively calls fs.mkdirs has the
following issues:
- Race condition for creating parent directories, causing FileNotFound
exception even when the file exists on file system
- HDFS fs.mkdirs atomically creates missing parent directories. Thus, the
recursive approach is making unnecessary calls.
In HDFS, which the current
[FileSystem](https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/fs/FileSystem.html)
interface is built upon, guarantees the parents will be created. So, all
FileSystem class implementations should also follow this behavior.
See the
[FileSystem](https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/fs/FileSystem.html)
abstract class documentation:
> The behaviour of the filesystem is [specified in the Hadoop documentation.
](https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/filesystem/filesystem.html)However,
the normative specification of the behavior of this class is actually HDFS: if
HDFS does not behave the way these Javadocs or the specification in the Hadoop
documentations define, assume that the documentation is incorrect
### Tests
- [X] My PR adds the following unit tests __OR__ does not need testing for
this extremely good reason:
Unit tests added and change tested internally at LinkedIn on parallel
fastingest test pipeline. The parallel test pipeline compared the permissions
created with previous implementation and with new implementation. There were
not any differences in the way permissions are set, so the change is completely
transparent and non-breaking.
### Commits
- [X] My commits all reference JIRA issues in their subject lines, and I
have squashed multiple commits if they address the same issue. In addition, my
commits follow the guidelines from "[How to write a good git commit
message](http://chris.beams.io/posts/git-commit/)":
1. Subject is separated from body by a blank line
2. Subject is limited to 50 characters
3. Subject does not end with a period
4. Subject uses the imperative mood ("add", not "adding")
5. Body wraps at 72 characters
6. Body explains "what" and "why", not "how"
--
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: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 739784)
Remaining Estimate: 0h
Time Spent: 10m
> WriterUtils.mkdirsWithRecursivePermission contains race condition and puts
> unnecessary load on filesystem
> ---------------------------------------------------------------------------------------------------------
>
> Key: GOBBLIN-1619
> URL: https://issues.apache.org/jira/browse/GOBBLIN-1619
> Project: Apache Gobblin
> Issue Type: Bug
> Reporter: Matthew Ho
> Priority: Minor
> Time Spent: 10m
> Remaining Estimate: 0h
>
> The current implementation recursively calls fs.mkdirs has the following
> issues:
> * *Race condition for creating parent directories, causing FileNotFound
> exception even when the file exists on file system*
> * {*}HDFS fs.mkdirs atomically creates missing parent directories. Thus, the
> recursive approach is making unnecessary calls.{*}{*}{*}
> HDFS, which the current FileSystem interface is built upon, guarantees the
> parents will be created. So all FileSystem class implementations should also
> follow this behavior.
>
> *Note the
> [FileSystem|https://hadoop.apache.org/docs/stable/api/org/apache/hadoop/fs/FileSystem.html]
> abstract class documentation says the following:*
> The behaviour of the filesystem is [specified in the Hadoop documentation.
> |https://hadoop.apache.org/docs/stable/hadoop-project-dist/hadoop-common/filesystem/filesystem.html]However,
> the normative specification of the behavior of this class is actually HDFS:
> {color:#de350b}if HDFS does not behave the way these Javadocs or the
> specification in the Hadoop documentations define, assume that the
> documentation is incorrect{color}
--
This message was sent by Atlassian Jira
(v8.20.1#820001)