Skip to content

Rename Resume optimization: resume only if srcDir etag matches to the one with which rename was started.#85

Merged
saxenapranav merged 25 commits intoABFSDriver:ABFS_3.3.2_devfrom
saxenapranav:ABFS_3.3.2_dev_redo_optimization
Jul 27, 2023
Merged

Rename Resume optimization: resume only if srcDir etag matches to the one with which rename was started.#85
saxenapranav merged 25 commits intoABFSDriver:ABFS_3.3.2_devfrom
saxenapranav:ABFS_3.3.2_dev_redo_optimization

Conversation

@saxenapranav
Copy link
Collaborator

@saxenapranav saxenapranav commented Jul 24, 2023

  1. Resume the rename only if srcDirectory is present and it's etag matches to the one that was there at the time of rename. Else, just delete the pendingJson.
  2. PendingJson will now have Etag information of the srcDir at the time of rename.
  3. There is listStatus done after its found that renamePendingJson is there. But since there can be scenario where rename resume shouldnt be done (like srcDir not there, or original srcDir is changed(etag change)), the second listStatus shall be redundant. In case of not requirement, it will not be called.

:::: AGGREGATED TEST RESULT ::::

HNS-OAuth

[INFO] Results:
[INFO]
[WARNING] Tests run: 140, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:383 » TestTimedOut test timed o...
[INFO]
[ERROR] Tests run: 782, Failures: 0, Errors: 1, Skipped: 189
[INFO] Results:
[INFO]
[WARNING] Tests run: 279, Failures: 0, Errors: 0, Skipped: 45

HNS-SharedKey

[INFO] Results:
[INFO]
[WARNING] Tests run: 140, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:383 » TestTimedOut test timed o...
[INFO]
[ERROR] Tests run: 782, Failures: 0, Errors: 1, Skipped: 189
[INFO] Results:
[INFO]
[WARNING] Tests run: 279, Failures: 0, Errors: 0, Skipped: 45

NonHNS-SharedKey

[INFO] Results:
[INFO]
[WARNING] Tests run: 140, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestAzureBlobFileSystemRandomRead.testValidateSeekBounds:276->Assert.assertTrue:42->Assert.fail:89 There should not be any network I/O (elapsedTimeMs=155).
[INFO]
[ERROR] Tests run: 782, Failures: 1, Errors: 0, Skipped: 280
[INFO] Results:
[INFO]
[WARNING] Tests run: 279, Failures: 0, Errors: 0, Skipped: 45

NonHNS-OAuth

[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] TestAbfsClientThrottlingAnalyzer.testManySuccessAndErrorsAndWaiting:181->fuzzyValidate:64 The actual value 10 is not within the expected range: [5.60, 8.40].
[INFO]
[ERROR] Tests run: 140, Failures: 1, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[WARNING] Tests run: 782, Failures: 0, Errors: 0, Skipped: 280
[INFO] Results:
[INFO]
[WARNING] Tests run: 279, Failures: 0, Errors: 0, Skipped: 45

AppendBlob-HNS-OAuth

[INFO] Results:
[INFO]
[WARNING] Tests run: 140, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:383 » TestTimedOut test timed o...
[INFO]
[ERROR] Tests run: 782, Failures: 0, Errors: 1, Skipped: 189
[INFO] Results:
[INFO]
[WARNING] Tests run: 279, Failures: 0, Errors: 0, Skipped: 45

Time taken: 47 mins 6 secs.

azureuser@Hadoop-VM-EAST2:~/hadoop/hadoop-tools/hadoop-azure$ git log
commit bab6499eb99e289d75b98a71ad2c8afac1a248e7 (HEAD -> ABFS_3.3.2_dev_redo_optimization, origin/ABFS_3.3.2_dev_redo_optimization_less, origin/ABFS_3.3.2_dev_redo_optimization, ABFS_3.3.2_dev_redo_optimization_less)
Author: Pranav Saxena <>
Date:   Mon Jul 24 06:41:27 2023 -0700

    asssertion if the listStatus API of FS will give correct result when we are not making redundant listStatus backend call

@saxenapranav saxenapranav changed the title Abfs 3.3.2 dev redo optimization Rename Resume optimization: resume only if srcDir etag matches to the one with which rename was started. Jul 25, 2023
@saxenapranav saxenapranav marked this pull request as ready for review July 25, 2023 03:55
@@ -931,12 +931,28 @@ public FileStatus[] listStatus(final Path f) throws IOException {
== PrefixMode.BLOB) {
Copy link
Collaborator

Choose a reason for hiding this comment

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

Resume actions to be made only if incoming path is a parent to one of the configured atomic rename paths to stop parsing of all the List calls.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Taken.

@@ -931,12 +931,28 @@ public FileStatus[] listStatus(final Path f) throws IOException {
== PrefixMode.BLOB) {
FileStatus renamePendingFileStatus
= getAbfsStore().getRenamePendingFileStatus(result);
Copy link
Collaborator

Choose a reason for hiding this comment

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

Rename variable to renamePendingJSONStatus

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.

@@ -1083,15 +1099,20 @@ private FileStatus getFileStatus(final Path path,
&& getAbfsStore().isAtomicRenameKey(fileStatus.getPath().toUri().getPath())
Copy link
Collaborator

Choose a reason for hiding this comment

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

Same as prev comment, resume only if this qualifies as parent of atomic rename path.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

Current code already has the check.

@saxenapranav
Copy link
Collaborator Author


:::: AGGREGATED TEST RESULT ::::

HNS-OAuth

[INFO] Results:
[INFO]
[WARNING] Tests run: 140, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:383 » TestTimedOut test timed o...
[INFO]
[ERROR] Tests run: 785, Failures: 0, Errors: 1, Skipped: 192
[INFO] Results:
[INFO]
[WARNING] Tests run: 282, Failures: 0, Errors: 0, Skipped: 48

HNS-SharedKey

[INFO] Results:
[INFO]
[WARNING] Tests run: 140, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:366 » TestTimedOut test timed o...
[INFO]
[ERROR] Tests run: 785, Failures: 0, Errors: 1, Skipped: 192
[INFO] Results:
[INFO]
[WARNING] Tests run: 282, Failures: 0, Errors: 0, Skipped: 48

NonHNS-SharedKey

[INFO] Results:
[INFO]
[WARNING] Tests run: 140, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemRename.testRenameResumeThroughListStatusWithSrcDirDeletedJustBeforeResume:2350->assertTracingContextOnRenameResumeProcess:2232 » UnfinishedStubbing
[INFO]
[ERROR] Tests run: 785, Failures: 0, Errors: 1, Skipped: 280
[INFO] Results:
[INFO]
[WARNING] Tests run: 282, Failures: 0, Errors: 0, Skipped: 45

NonHNS-OAuth

[INFO] Results:
[INFO]
[WARNING] Tests run: 140, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestAzureBlobFileSystemRandomRead.testValidateSeekBounds:276->Assert.assertTrue:42->Assert.fail:89 There should not be any network I/O (elapsedTimeMs=105).
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemExplictImplicitRename.testImplicitDirectoryIntoSameNameImplicitDestination:601->explicitImplicitDirectoryRenameTestWithDestPathNames:796->createSourcePaths:837->AbstractAbfsIntegrationTest.createAzCopyFile:537 » IO
[INFO]
[ERROR] Tests run: 785, Failures: 1, Errors: 1, Skipped: 280
[INFO] Results:
[INFO]
[WARNING] Tests run: 282, Failures: 0, Errors: 0, Skipped: 45

AppendBlob-HNS-OAuth

[INFO] Results:
[INFO]
[WARNING] Tests run: 140, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestAzureBlobFileSystemRandomRead.testSkipBounds:225->Assert.assertTrue:42->Assert.fail:89 There should not be any network I/O (elapsedTimeMs=88).
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:366 » TestTimedOut test timed o...
[INFO]
[ERROR] Tests run: 785, Failures: 1, Errors: 1, Skipped: 192
[INFO] Results:
[INFO]
[WARNING] Tests run: 282, Failures: 0, Errors: 0, Skipped: 48

azureuser@Hadoop-VM-EAST2:~/hadoop/hadoop-tools/hadoop-azure$ git log
commit fbf0a244e882e0a9edf210d87069fb03afcc3d1d (HEAD -> ABFS_3.3.2_dev_redo_optimization, origin/ABFS_3.3.2_dev_redo_optimization_review, origin/ABFS_3.3.2_dev_redo_optimization, ABFS_3.3.2_dev_redo_optimization_review)
Merge: d9a38b893e8 e858497e875
Author: Pranav Saxena <>
Date:   Tue Jul 25 04:59:39 2023 -0700

    Merge branch 'ABFS_3.3.2_dev' into ABFS_3.3.2_dev_redo_optimization_review

@saxenapranav saxenapranav requested a review from snvijaya July 25, 2023 13:25
@saxenapranav
Copy link
Collaborator Author

saxenapranav commented Jul 27, 2023


:::: AGGREGATED TEST RESULT ::::

HNS-OAuth

[INFO] Results:
[INFO]
[WARNING] Tests run: 141, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:397->lambda$testAcquireRetry$6:403 » TestTimedOut
[INFO]
[ERROR] Tests run: 787, Failures: 0, Errors: 1, Skipped: 194
[INFO] Results:
[INFO]
[WARNING] Tests run: 283, Failures: 0, Errors: 0, Skipped: 49

HNS-SharedKey

[INFO] Results:
[INFO]
[WARNING] Tests run: 141, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestAzureBlobFileSystemRandomRead.testValidateSeekBounds:276->Assert.assertTrue:42->Assert.fail:89 There should not be any network I/O (elapsedTimeMs=74).
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:383 » TestTimedOut test timed o...
[INFO]
[ERROR] Tests run: 787, Failures: 1, Errors: 1, Skipped: 194
[INFO] Results:
[INFO]
[WARNING] Tests run: 283, Failures: 0, Errors: 0, Skipped: 49

NonHNS-SharedKey

[INFO] Results:
[INFO]
[WARNING] Tests run: 141, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[WARNING] Tests run: 787, Failures: 0, Errors: 0, Skipped: 279
[INFO] Results:
[INFO]
[WARNING] Tests run: 283, Failures: 0, Errors: 0, Skipped: 45

NonHNS-OAuth

[INFO] Results:
[INFO]
[WARNING] Tests run: 141, Failures: 0, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[WARNING] Tests run: 787, Failures: 0, Errors: 0, Skipped: 279
[INFO] Results:
[INFO]
[WARNING] Tests run: 283, Failures: 0, Errors: 0, Skipped: 45

AppendBlob-HNS-OAuth

[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] TestAbfsClientThrottlingAnalyzer.testManySuccessAndErrorsAndWaiting:181->fuzzyValidate:64 The actual value 10 is not within the expected range: [5.60, 8.40].
[INFO]
[ERROR] Tests run: 141, Failures: 1, Errors: 0, Skipped: 4
[INFO] Results:
[INFO]
[ERROR] Failures:
[ERROR] ITestAzureBlobFileSystemRandomRead.testValidateSeekBounds:276->Assert.assertTrue:42->Assert.fail:89 There should not be any network I/O (elapsedTimeMs=21).
[ERROR] Errors:
[ERROR] ITestAzureBlobFileSystemLease.testAcquireRetry:383 » TestTimedOut test timed o...
[INFO]
[ERROR] Tests run: 787, Failures: 1, Errors: 1, Skipped: 194
[INFO] Results:
[INFO]
[WARNING] Tests run: 283, Failures: 0, Errors: 0, Skipped: 49

Time taken: 48 mins 6 secs.

azureuser@Hadoop-VM-EAST2:~/hadoop/hadoop-tools/hadoop-azure$ git log
commit b76972e76fdd921167433c971c74bbb7021e8fc9 (HEAD -> ABFS_3.3.2_dev_redo_optimization, origin/ABFS_3.3.2_dev_redo_optimization_filestatus, origin/ABFS_3.3.2_dev_redo_optimization, ABFS_3.3.2_dev_redo_optimization_filestatus)
Author: Pranav Saxena <>
Date:   Wed Jul 26 20:58:52 2023 -0700

    fix tests in ITestAzureBlobFileSystemFileStatus

@saxenapranav
Copy link
Collaborator Author

Thanks @snvijaya for the approval.
The approval was on commit 14104c1

The new changes include:

  1. backport HADOOP-17682. ABFS: Support FileStatus input to OpenFileWithOptions() via OpenFileParameters apache/hadoop#2975 at commit: dcddc6a
  2. For the resume, fileStatus is already there with listStatus or getFileStatus for renamePendingJson file. On ABFS_3,3.2_dev, for reading the file, we have to open which needs getFileStatus. This is a redundant call and needs optimization.
  3. This new change on top of approved commit is take the optimization..

fileSystemId, FSOperationType.LISTSTATUS, true, tracingHeaderFormat,
listener);
FileStatus[] result = getAbfsStore().listStatus(qualifiedPath, tracingContext);
FileStatus[] result = getAbfsStore().listStatus(qualifiedPath,
Copy link
Collaborator

Choose a reason for hiding this comment

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

Used multiple times, can be stored into a variable

@saxenapranav saxenapranav merged commit 6fc5975 into ABFSDriver:ABFS_3.3.2_dev Jul 27, 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