Skip to content

Conversation

@anmolanmol1234
Copy link
Collaborator

@anmolanmol1234 anmolanmol1234 commented May 16, 2023

Added support for expect header and account level throttling.
Added a sepcial handling in case of PutBlockList to not retry without append header if request fails with 409, as that is handled for fallback.

@saxenapranav
Copy link
Collaborator

Very huge changes!
Hope these are brought in by cherry-picking the merged commits in trunk. Can you please add reference to those commits. Let me know if cherry-pick is not the option used.

Thanks.

files="org[\\/]apache[\\/]hadoop[\\/]fs[\\/]azurebfs[\\/]utils[\\/]Base64.java"/>
<suppress checks="ParameterNumber|VisibilityModifier"
files="org[\\/]apache[\\/]hadoop[\\/]fs[\\/]azurebfs[\\/]ITestSmallWriteOptimization.java"/>
<<<<<<< HEAD
Copy link
Collaborator

Choose a reason for hiding this comment

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

git conflict

@anmolanmol1234
Copy link
Collaborator Author

Pull requests merged in trunk added as part of this PR :- apache#5516
apache#5034

}

public boolean accountThrottlingEnabled() {
return accountThrottlingEnabled;

Choose a reason for hiding this comment

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

[nit] In case we can either do return this. or just return for all the methods, it would be helpful in terms of readability.

wasbUri,
rawConfig,
new AzureFileSystemInstrumentation(rawConfig));
wasbUri,

Choose a reason for hiding this comment

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

[nit] some spacing changes have creeped in.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed.

import org.apache.hadoop.fs.azurebfs.services.AbfsRestOperation;
import org.apache.hadoop.fs.azurebfs.services.AbfsHttpOperation;
import org.apache.hadoop.fs.azurebfs.services.TestAbfsClient;

Choose a reason for hiding this comment

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

[nit] extra line

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Fixed

*/

package org.apache.hadoop.fs.azurebfs.services;

Choose a reason for hiding this comment

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

Would it affect any backward dependencies of other parts of code depending on TestAbfsClient? (Esp if any within the current set of PRs being raised)

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

No this branch has been backmerged to dev, should not cause any issues.

@saxenapranav
Copy link
Collaborator

throttling part looks good.

@saxenapranav
Copy link
Collaborator

since it has been made up by cherry-picking the prs of throttling and 100continue, can you please attach the test-results in the pr please @anmolanmol1234

Copy link
Collaborator

Choose a reason for hiding this comment

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

code match

Comment on lines +873 to +878
private boolean checkUserErrorBlob(int responseStatusCode) {
return (responseStatusCode >= HttpURLConnection.HTTP_BAD_REQUEST
&& responseStatusCode < HttpURLConnection.HTTP_INTERNAL_ERROR
&& responseStatusCode != HttpURLConnection.HTTP_CONFLICT);
}

Copy link
Collaborator

Choose a reason for hiding this comment

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

Please give reasoning for excluding 409.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Added

if (contentLength > 0) {
singleton.writeThrottler.addBytesTransferred(contentLength,
isFailedOperation);
writeThrottler.addBytesTransferred(contentLength,
Copy link
Collaborator

Choose a reason for hiding this comment

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

lets add this part as well:

/**
   * Updates the metrics for the case when response code signifies throttling
   * but there are some expected bytes to be sent.
   * @param isThrottledOperation returns true if status code is HTTP_UNAVAILABLE
   * @param abfsHttpOperation Used for status code and data transferred.
   * @return true if the operation is throttled and has some bytes to transfer.
   */
  private boolean updateBytesTransferred(boolean isThrottledOperation,
      AbfsHttpOperation abfsHttpOperation) {
    return isThrottledOperation && abfsHttpOperation.getExpectedBytesToBeSent() > 0;
  }

Copy link
Collaborator

Choose a reason for hiding this comment

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

 if (contentLength == 0) {
          /*
            Signifies the case where we could not update the bytesSent due to
            throttling but there were some expectedBytesToBeSent.
           */
          if (updateBytesTransferred(isThrottledOperation, abfsHttpOperation)) {
            LOG.debug("Updating metrics due to throttling for path {}", abfsHttpOperation.getConnUrl().getPath());
            contentLength = abfsHttpOperation.getExpectedBytesToBeSent();
          }
        }

Copy link
Collaborator

Choose a reason for hiding this comment

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


 if (contentLength > 0) {
          writeThrottler.addBytesTransferred(contentLength,
              isFailedOperation);

Copy link
Collaborator

Choose a reason for hiding this comment

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

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Sorry this code piece got missed, added it. Thanks

tracingContext.constructHeader(httpOperation);

signRequest(httpOperation, hasRequestBody ? bufferLength : 0);
switch(client.getAuthType()) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

why are we pulling back code of signRequest to the executeHttpOperation

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Refactored

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! Please add test results before merging. Thanks.

@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]
[ERROR] Failures:
[ERROR] ITestAzureBlobFileSystemCreate.testDefaultCreateOverwriteFileTest:1025->testCreateFileOverwrite:1067->AbstractAbfsIntegrationTest.assertAbfsStatistics:510->Assert.assertEquals:647->Assert.failNotEquals:835->Assert.fail:89 Mismatch in connections_made expected:<5> but was:<4>
[INFO]
[ERROR] Tests run: 744, Failures: 1, Errors: 0, Skipped: 155
[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]
[ERROR] Failures:
[ERROR] ITestAzureBlobFileSystemCreate.testDefaultCreateOverwriteFileTest:1025->testCreateFileOverwrite:1067->AbstractAbfsIntegrationTest.assertAbfsStatistics:510->Assert.assertEquals:647->Assert.failNotEquals:835->Assert.fail:89 Mismatch in connections_made expected:<5> but was:<4>
[INFO]
[ERROR] Tests run: 744, Failures: 1, Errors: 0, Skipped: 155
[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.testRenameImplicitDirectoryContainingImplicitDirectory:210->explicitImplicitDirectoryRenameTest:758->createSourcePaths:835->AbstractAbfsIntegrationTest.createAzCopyDirectory:524 » IO
[INFO]
[ERROR] Tests run: 744, Failures: 0, Errors: 1, Skipped: 275
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemBasics>FileSystemContractBaseTest.testOverWriteAndRead:620->FileSystemContractBaseTest.writeAndRead:927 » 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: 744, Failures: 0, Errors: 0, Skipped: 275
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemBasics>FileSystemContractBaseTest.testOverWriteAndRead:620->FileSystemContractBaseTest.writeAndRead:932 » 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]
[ERROR] Failures:
[ERROR] ITestAzureBlobFileSystemCreate.testDefaultCreateOverwriteFileTest:1025->testCreateFileOverwrite:1067->AbstractAbfsIntegrationTest.assertAbfsStatistics:510->Assert.assertEquals:647->Assert.failNotEquals:835->Assert.fail:89 Mismatch in connections_made expected:<5> but was:<4>
[INFO]
[ERROR] Tests run: 744, Failures: 1, Errors: 0, Skipped: 155
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAbfsReadWriteAndSeek.testReadAndWriteWithDifferentBufferSizesAndSeek:78->testReadWriteAndSeek:120 » TestTimedOut
[INFO]
[ERROR] Tests run: 273, Failures: 0, Errors: 1, Skipped: 41

@anmolanmol1234 anmolanmol1234 merged commit b558a4c into ABFS_3.3.2_dev May 31, 2023
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