-
Notifications
You must be signed in to change notification settings - Fork 9.2k
HADOOP-17990. Fix failing concurrent FS.initialize commands when fs.azure.createRemoteFileSystemDuringInitialization is enabled. #3620
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
Conversation
…zure.createRemoteFileSystemDuringInitialization is enabled.
|
💔 -1 overall
This message was automatically generated. |
| if (ex instanceof AzureBlobFileSystemException) { | ||
| checkException(null, (AzureBlobFileSystemException) ex, | ||
| AzureServiceErrorCode.FILE_SYSTEM_ALREADY_EXISTS); | ||
| } else if (ex.getCause() != null && ex.getCause() instanceof AzureBlobFileSystemException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
instanceof always returns false if source is null, so the null check here can be removed
| try { | ||
| this.createFileSystem(tracingContext); | ||
| } catch (IOException ex) { | ||
| if (ex instanceof AzureBlobFileSystemException) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
better to add a catch(AzureBlobFileSystemException) clause
|
|
||
| @Test | ||
| public void ensureFilesystemWillBeCreatedIfCreationConfigIsSet() throws Exception { | ||
| final AzureBlobFileSystem fs = createFileSystem(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
use try with resources to close afterwards
| final MockAzureBlobFileSystemStore store = new MockAzureBlobFileSystemStore(config); | ||
| fs.setAbfsStore(store); | ||
| fs.createFileSystemIfNotExist(getTestTracingContext(fs, true)); | ||
| assert(store.isCreateFileSystemCalled); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
assertj assertions with useful error text
|
had a quick look at the code
example #3611 (comment) |
|
💔 -1 overall
This message was automatically generated. |
|
Thanks for the review, I have addressed the commets.
Test result output |
|
I saw this compilation error coming from Yetus, is this expected? |
steveloughran
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM; thanks
|
yetus has been a bit flaky recently (I managed to break trunk & 3.3; some docker image/openssl issues, but these seem new) style |
|
💔 -1 overall
This message was automatically generated. |
|
We're closing this stale PR because it has been open for 100 days with no activity. This isn't a judgement on the merit of the PR in any way. It's just a way of keeping the PR queue manageable. |
Description of PR
When fs.azure.createRemoteFileSystemDuringInitialization is enabled, the filesystem will create a container if it does not already exist inside the initialize method. The current flow of creating the container will fail in the case of concurrent initialize methods being executed simultaneously (only one request can create the container, the rest will fail instead of moving on). This PR is fixing this issue by also catching org.apache.Hadoop.fs.FileAlreadyExistsException generated by the createFilesystem command.
How was this patch tested?
A new test in ITestAzureBlobFileSystemInitAndCreate is introduced which was breaking before the fox.
For code changes:
LICENSE,LICENSE-binary,NOTICE-binaryfiles?