Skip to content

Unify fallback dependent api#69

Merged
anmolanmol1234 merged 14 commits intoABFS_3.3.2_devfrom
unifyFallbackDependentAPI
Jun 23, 2023
Merged

Unify fallback dependent api#69
anmolanmol1234 merged 14 commits intoABFS_3.3.2_devfrom
unifyFallbackDependentAPI

Conversation

@anmolanmol1234
Copy link
Collaborator

PR to make sure that if any API fallbacks to DFS endpoint, the dependent getFileStatus call should also go to DFS endpoint. Also refactored the code for openFileForRead and openFileForWrite to depend only on getFileStatus call.

@anmolanmol1234
Copy link
Collaborator Author

:::: AGGREGATED TEST RESULT ::::

HNS-OAuth

[INFO] Results:
[INFO]
[WARNING] Tests run: 111, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[WARNING] Tests run: 746, Failures: 0, Errors: 0, Skipped: 157
[INFO] Results:
[INFO]
[WARNING] Tests run: 273, Failures: 0, Errors: 0, Skipped: 41

HNS-SharedKey

[INFO] Results:
[INFO]
[WARNING] Tests run: 111, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[WARNING] Tests run: 746, Failures: 0, Errors: 0, Skipped: 157
[INFO] Results:
[INFO]
[WARNING] Tests run: 273, Failures: 0, Errors: 0, Skipped: 41

NonHNS-SharedKey

[INFO] Results:
[INFO]
[WARNING] Tests run: 111, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemExplictImplicitRename.testRenameImplicitDirectoryToExplicitDirectoryDestinationHavingSameNameSubFile:559->explicitImplicitDirectoryRenameTestWithDestPathNames:796->createSourcePaths:835->AbstractAbfsIntegrationTest.createAzCopyDirectory:524 » IO
[INFO]
[ERROR] Tests run: 746, Failures: 0, Errors: 1, Skipped: 275
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemBasics.tearDown:59->FileSystemContractBaseTest.tearDown:85->FileSystemContractBaseTest.cleanupDir:92 » TestTimedOut
[INFO]
[ERROR] Tests run: 273, Failures: 0, Errors: 1, Skipped: 45

NonHNS-OAuth

[INFO] Results:
[INFO]
[WARNING] Tests run: 111, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[WARNING] Tests run: 746, Failures: 0, Errors: 0, Skipped: 275
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemBasics.tearDown:59->FileSystemContractBaseTest.tearDown:82->FileSystemContractBaseTest.cleanupDir:92 » TestTimedOut
[INFO]
[ERROR] Tests run: 273, Failures: 0, Errors: 1, Skipped: 45

AppendBlob-HNS-OAuth

[INFO] Results:
[INFO]
[WARNING] Tests run: 111, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[WARNING] Tests run: 746, Failures: 0, Errors: 0, Skipped: 157
[INFO] Results:
[INFO]
[WARNING] Tests run: 273, Failures: 0, Errors: 0, Skipped: 41

Copy link
Collaborator

@anujmodi2021 anujmodi2021 left a comment

Choose a reason for hiding this comment

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

Added a small comment. Rest LGTM

}
if (getAbfsStore().getAbfsConfiguration().getPrefixMode()
tracingContext, useBlobEndpoint);
if (getAbfsStore().getAbfsConfiguration().getPrefixMode()
Copy link
Collaborator

Choose a reason for hiding this comment

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

Should be changed to getAbfsStore().getPrefixMode()

Copy link
Collaborator

@saxenapranav saxenapranav left a comment

Choose a reason for hiding this comment

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

Mostly look amazing. Two comments.

Comment on lines +1009 to 1012
boolean useBlobEndpoint = !(OperativeEndpoint.isIngressEnabledOnDFS(prefixMode, abfsConfiguration) ||
OperativeEndpoint.isMkdirEnabledOnDFS(prefixMode, abfsConfiguration) ||
OperativeEndpoint.isReadEnabledOnDFS(prefixMode, abfsConfiguration));
try {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why does redirect to dfs on mkdir/ingress/readEnabled matter here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

We want the getFileStatus call to go to dfs in all cases where either of the configs is enabled, though this doesn't come as part of fallback but helps to maintain consistency in the logic

} catch (AbfsRestOperationException ex) {
if (ex.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) {
fileStatus = (VersionedFileStatus) getFileStatus(new Path(relativePath), tracingContext, useBlobEndpoint);
} catch (IOException ex) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

if we keep it as AbfsRestOperationException, the behavior should be same?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

getFileStatus throws IOException and hence we would need to change the exception type here. It will catch AbfsRestOperationException as well as that extends from IOException

Copy link
Collaborator

Choose a reason for hiding this comment

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

Agree.

if (ex.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) {
fileStatus = (VersionedFileStatus) getFileStatus(new Path(relativePath), tracingContext, useBlobEndpoint);
} catch (IOException ex) {
AbfsRestOperationException ex1 = (AbfsRestOperationException) ex;
Copy link
Collaborator

Choose a reason for hiding this comment

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

It will lead to cast issue. Since all IOException may not be AbfsRestOperationException.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Addressed

} catch (AbfsRestOperationException ex) {
if (ex.getStatusCode() == HttpURLConnection.HTTP_NOT_FOUND) {
fileStatus = (VersionedFileStatus) getFileStatus(new Path(relativePath), tracingContext, useBlobEndpoint);
} catch (IOException ex) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Agree.

+ "to honor single writer semantics");
fileStatus = (VersionedFileStatus) getFileStatus(new Path(relativePath), tracingContext, useBlobEndpoint);
} catch (IOException ex) {
if (ex instanceof AbfsRestOperationException) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

since we are still throwing IOexception if not abfsRestOperationException. Lets catch AbfsRestOperationException only?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Makes sense

Copy link
Collaborator

@saxenapranav saxenapranav left a comment

Choose a reason for hiding this comment

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

LGTM! Thanks for taking all the comments.

@anmolanmol1234 anmolanmol1234 merged commit f0b75b7 into ABFS_3.3.2_dev Jun 23, 2023
PrefixMode prefixMode = getAbfsStore().getPrefixMode();
AbfsConfiguration abfsConfiguration = getAbfsStore().getAbfsConfiguration();

boolean useBlobEndpoint = !(OperativeEndpoint.isIngressEnabledOnDFS(prefixMode, abfsConfiguration) ||
Copy link
Collaborator

Choose a reason for hiding this comment

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

As discussed, let operativeEndpoint by the single point with the unified logic.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants