Skip to content
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

HADOOP-17811: ABFS ExponentialRetryPolicy doesn't pick up configuration values #3221

Merged
merged 4 commits into from
Jul 28, 2021

Conversation

brianloss
Copy link
Member

Allow ExponentialRetryPolicy to be fully configured from the hadoop
configuration. Properties are already defined for this, so ensure that
they are passed along when the retry policy is constructed and that
documentation has been updated.

Allow ExponentialRetryPolicy to be fully configured from the hadoop
configuration. Properties are already defined for this, so ensure that
they are passed along when the retry policy is constructed and that
documentation has been updated.
* Add spotbugs exclusion for IS2_INCONSISTENT_SYNC on
  NativeAzureFsInputStream.in to fix errant bug trigger introduced in
  PR apache#3149.
* Refactor TestExponentialRetryPolicy to use a variable with the value
  offset rather than hard-coded numbers in order to satisfy checkstyle.
@apache apache deleted a comment from hadoop-yetus Jul 27, 2021
Copy link
Contributor

@steveloughran steveloughran left a comment

Choose a reason for hiding this comment

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

Seems reasonable; made some minor suggestions.

One thing I like for config options is to be able to include the unit (time, capacity) in the option, e.g "500ms", "2min". Configuration.getTimeDuration() does this, including allowing a default time unit to retrofit the feature to existing properties.

Can we use that here? It may need a change in the ABFS config

Also please look at the policy in testing_azure.md and declare which abfs endpoint you tested against. No declaration: no review. Sorry, but we have to be this strict because we can't give yetus any credentials

@@ -57,12 +61,38 @@ public void testDifferentMaxIORetryCount() throws Exception {
@Test
public void testDefaultMaxIORetryCount() throws Exception {
AbfsConfiguration abfsConfig = getAbfsConfig();
Assert.assertTrue(
Assert.assertEquals(
Copy link
Contributor

Choose a reason for hiding this comment

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

If you use AssertJ.assertThat() you can use its describedAs for sprintf-style formatting. We're embracing that for new code and more complex assertions, so don't be afraid to use it here

Copy link
Member Author

Choose a reason for hiding this comment

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

I only changed this line because my IDE was warning me about it--it's not otherwise relevant to my change. I looked at doing what you suggested and unfortunately the assertj version of assertThat cannot be statically imported since there are assertThat methods on the base class that the test extends. Given that, I think this change would make the code less readable.

@brianloss
Copy link
Member Author

Seems reasonable; made some minor suggestions.

@steveloughran, thanks for taking a look! I addressed the suggestions that I thought made sense, and will push them in just a minute.

One thing I like for config options is to be able to include the unit (time, capacity) in the option, e.g "500ms", "2min". Configuration.getTimeDuration() does this, including allowing a default time unit to retrofit the feature to existing properties.

Can we use that here? It may need a change in the ABFS config

I like the idea, but it looks like it will be a more involved change since the configuration properties are read via annotation-driven code and updating that will be much more involved. I'm happy to take a look, but was thinking that should be a separate issue/PR.

Also please look at the policy in testing_azure.md and declare which abfs endpoint you tested against. No declaration: no review. Sorry, but we have to be this strict because we can't give yetus any credentials

I did what I could here in East US. The instructions aren't clear as to what must be done. I ran the runtests.sh script, according to the Testing the Azure ABFS Client section. I found several tests to be flaky, and all seem to be unrelated to my change. I had failures in the following tests, but they all succeeded when I ran individually:

  • ITestAbfsStreamStatistics.testAbfsStreamOps (failed in AppendBlob-HNS-OAuth)
  • ITestAzureBlobFileSystemLease.testTwoWritersCreateAppendNoInfiniteLease (failed in AppendBlob-HNS-OAuth)
  • ITestAzureBlobFileSystemRandomRead.testValidateSeekBounds (failed in HNS-OAuth and HNS-SharedKey)
  • ITestAbfsRestOperationException.testCustomTokenFetchRetryCount (failed in NonHNS-SharedKey)
  • ITestGetNameSpaceEnabled.testGetIsNamespaceEnabledWhenConfigIsFalse (failed in NonHNS-SharedKey)
  • ITestGetNameSpaceEnabled.testGetIsNamespaceEnabledWhenConfigIsTrue (failed in NonHNS-SharedKey)
  • ITestGetNameSpaceEnabled.testNonXNSAccount (failed in NonHNS-SharedKey)

I also had failures in ITestAzureBlobFileSystemLease.testFileSystemClose and ITestAzureBlobFileSystemLease.testTwoCreate. These fail when I run individually and also fail when I run the tests on trunk. I am also unable to get ITestAzureBlobFileSystemCheckAccess.testCheckAccessForAccountWithoutNS to pass (on either my branch or trunk) despite following the special instructions for that.

Please let me know if there's anything else I need to run/test. Thanks.

* Update doc formatting as requested to include backticks on class name
* Fix some spelling errors in testing_azure.md
* Add assertion failure messages for new test case
Copy link
Contributor

@steveloughran steveloughran left a comment

Choose a reason for hiding this comment

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

+1 for this, merging to trunk and then soon 3.3.2.

interesting you are seeing all the test failures. I don't go near Oauth myself (long story).

@steveloughran steveloughran changed the title HADOOP-17811: Configure ExponentialRetryPolicy HADOOP-17811: ABFS ExponentialRetryPolicy doesn't pick up configuration values Jul 28, 2021
@steveloughran steveloughran merged commit 1d03c69 into apache:trunk Jul 28, 2021
@brianloss
Copy link
Member Author

+1 for this, merging to trunk and then soon 3.3.2.

interesting you are seeing all the test failures. I don't go near Oauth myself (long story).

Yeah, strange behavior. I rebuilt my storage accounts in a different tenant, and it's doing better now. I'm still seeing some weirdness in a few tests. ITestAzureBlobFileSystemLease I can get to pass if I don't use the runtests.sh script and set all of the right properties in azure-auth-keys.xml. I can't get ITestAbfsStreamStatistics to pass in the appendblob configuration (even on trunk). But other than those, everything else is running now. Thanks for merging!

@brianloss brianloss deleted the feature/configure-retry-policy branch July 28, 2021 19:24
@steveloughran
Copy link
Contributor

ITestAzureBlobFileSystemLease
talk to @billierinaldi there.

w.r.t ITestAbfsStreamStatistics, if there's no JIRA on that test failure, file one, with the stack trace. It'll inevitably be some counting mismatch

Can you do the cherrypick and test of the branch-3.3 locally, let me know if it's all good there and I'll merge it in there too.

@brianloss
Copy link
Member Author

Can you do the cherrypick and test of the branch-3.3 locally, let me know if it's all good there and I'll merge it in there too.

@steveloughran my local cherry pick against branch-3.3 had no problems running tests in East US. There were two failures that ran fine individually: ITestAzureBlobFileSystemRandomRead.testValidateSeekBounds (HNS-SharedKey) and ITestAbfsListStatusRemoteIterator.testWithAbfsIteratorDisabledWithoutHasNext (NonHNS-SharedKey).

sumangala-patki pushed a commit to sumangala17/hadoop that referenced this pull request Aug 2, 2021
…on values (apache#3221)

Contributed by Brian Loss.

(cherry picked from commit 1d03c69)
asfgit pushed a commit that referenced this pull request Aug 2, 2021
…on values (#3221)

Contributed by Brian Loss.

Change-Id: I5f24196d1d02de91336c3679abaf8d55cfaed746
@apache apache deleted a comment from hadoop-yetus Aug 2, 2021
@apache apache deleted a comment from hadoop-yetus Aug 2, 2021
kiran-maturi pushed a commit to kiran-maturi/hadoop that referenced this pull request Nov 24, 2021
jojochuang pushed a commit to jojochuang/hadoop that referenced this pull request May 23, 2023
… configuration values (apache#3221)

Contributed by Brian Loss.

Change-Id: I5f24196d1d02de91336c3679abaf8d55cfaed746
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.

2 participants