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-16696: ABFS Always read ahead config, to use read ahead even for non sequential reads. #1708

Open
wants to merge 11 commits into
base: trunk
Choose a base branch
from

Conversation

sapant-msft
Copy link

Adding a config alwaysReadAhead, set to False by default, to be able to use abfs' read ahead capability, even for non-sequential reads. At the moment, only sequential reads support read ahead. A read ahead is queued only after a sequential read is made, so we miss out on gains where we have a non-sequential followed by a sequential read. For example, seek(n), read 1 byte, read 10 bytes , seek (m), could benefit from read ahead, but not currently supported.

@hadoop-yetus
Copy link

💔 -1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 34s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
-1 ❌ test4tests 0m 0s The patch doesn't appear to include any new or modified tests. Please justify why no new tests are needed for this patch. Also please list what manual steps were performed to verify this patch.
_ trunk Compile Tests _
+1 💚 mvninstall 17m 44s trunk passed
+1 💚 compile 0m 30s trunk passed
+1 💚 checkstyle 0m 25s trunk passed
+1 💚 mvnsite 0m 33s trunk passed
+1 💚 shadedclient 13m 25s branch has no errors when building and testing our client artifacts.
+1 💚 javadoc 0m 26s trunk passed
+0 🆗 spotbugs 0m 50s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 0m 47s trunk passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 27s the patch passed
+1 💚 compile 0m 24s the patch passed
+1 💚 javac 0m 24s the patch passed
+1 💚 checkstyle 0m 16s the patch passed
+1 💚 mvnsite 0m 26s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedclient 13m 12s patch has no errors when building and testing our client artifacts.
+1 💚 javadoc 0m 23s the patch passed
+1 💚 findbugs 0m 53s the patch passed
_ Other Tests _
+1 💚 unit 1m 21s hadoop-azure in the patch passed.
+1 💚 asflicense 0m 31s The patch does not generate ASF License warnings.
53m 55s
Subsystem Report/Notes
Docker Client=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/5/artifact/out/Dockerfile
GITHUB PR #1708
JIRA Issue HADOOP-16696
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux 3446e1da0241 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / de38045
Default Java 1.8.0_222
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/5/testReport/
Max. process+thread count 418 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-azure U: hadoop-tools/hadoop-azure
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/5/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@sapant-msft
Copy link
Author

No new feature added, additional configuration option was added, to allow clients more control over the readAhead feature. Therefore, no additional tests were added.

Tests were manually run results are as follows:
ABFS XNS enabled account test results:

[INFO] Tests run: 42, Failures: 0, Errors: 0, Skipped: 0

@apache apache deleted a comment from hadoop-yetus Nov 21, 2019
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. needs some docs
  2. needs at least one test

Have you any benchmark numbers? And how would it compare to a Parquet client using readFully over seek + read? As I believe there are opportunities there -and as https://issues.apache.org/jira/browse/IMPALA-8525 shows, significant benefits if the reader and the FS are best aligned

AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), contentLength,
abfsConfiguration.getReadBufferSize(), abfsConfiguration.getReadAheadQueueDepth(),
abfsConfiguration.getTolerateOobAppends(), eTag);
AbfsHttpConstants.FORWARD_SLASH + getRelativePath(path), contentLength, eTag, abfsConfiguration);
Copy link
Contributor

Choose a reason for hiding this comment

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

I'm not sure that passing the full config down is/is not the right approach compared to passing the explicit options in. Can you justify this?

Copy link
Author

Choose a reason for hiding this comment

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

The number of options we are passing to the Stream has increased to 4, causing Hadoop check style related issues (total arguments > 8). Also, increasing the number of arguments doesn't feel like a scalable approach, in my opinion. I agree, passing the whole abfsConfig object isn't very elegant either. How would you feel about a new abfsInputStreamConfig structure (class), to be used for passing stream related config options?

Thanks,
Saurabh

Copy link
Contributor

Choose a reason for hiding this comment

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

I'd prefer some structure "ReadContext" to pass in

@steveloughran
Copy link
Contributor

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 38s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 1s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 19m 36s trunk passed
+1 💚 compile 0m 31s trunk passed
+1 💚 checkstyle 0m 25s trunk passed
+1 💚 mvnsite 0m 36s trunk passed
+1 💚 shadedclient 14m 2s branch has no errors when building and testing our client artifacts.
+1 💚 javadoc 0m 27s trunk passed
+0 🆗 spotbugs 0m 54s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 0m 52s trunk passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 29s the patch passed
+1 💚 compile 0m 24s the patch passed
+1 💚 javac 0m 25s the patch passed
+1 💚 checkstyle 0m 16s the patch passed
+1 💚 mvnsite 0m 28s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedclient 13m 48s patch has no errors when building and testing our client artifacts.
+1 💚 javadoc 0m 22s the patch passed
+1 💚 findbugs 0m 55s the patch passed
_ Other Tests _
+1 💚 unit 1m 22s hadoop-azure in the patch passed.
+1 💚 asflicense 0m 29s The patch does not generate ASF License warnings.
57m 1s
Subsystem Report/Notes
Docker Client=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/8/artifact/out/Dockerfile
GITHUB PR #1708
JIRA Issue HADOOP-16696
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux be3590f26c69 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 049940e
Default Java 1.8.0_222
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/8/testReport/
Max. process+thread count 421 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-azure U: hadoop-tools/hadoop-azure
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/8/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@sapant-msft
Copy link
Author

Hi @steveloughran ,
Thank you for the suggestions. A new test was added (ITestAbfsReadWriteAndSeekReadAheadEnabled)
We have an internal spark workload which reads a parquet file (10 MB), has the following read pattern- Seek_1, Read_1, Seek_2, Read_2, Read_3. Currently, read ahead is disabled if there are seeks. This change request introduces a config , AlwaysReadAhead (disabled by default), which allows user to override this behavior if desired. With this option turned on, we were able to reduce the total service side requests by 1/3- as this option allowed readahead to couple the Read_2 and Read_3, thereby greatly improving the efficiency. As parquet files are widely used, especially for Spark workloads, we are confident this could improve performance (and reduce network I/O) for a large number of users.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 38s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 18m 3s trunk passed
+1 💚 compile 0m 31s trunk passed
+1 💚 checkstyle 0m 23s trunk passed
+1 💚 mvnsite 0m 33s trunk passed
+1 💚 shadedclient 13m 33s branch has no errors when building and testing our client artifacts.
+1 💚 javadoc 0m 27s trunk passed
+0 🆗 spotbugs 0m 51s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 0m 50s trunk passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 29s the patch passed
+1 💚 compile 0m 23s the patch passed
+1 💚 javac 0m 23s the patch passed
+1 💚 checkstyle 0m 16s the patch passed
+1 💚 mvnsite 0m 27s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedclient 13m 12s patch has no errors when building and testing our client artifacts.
+1 💚 javadoc 0m 24s the patch passed
+1 💚 findbugs 0m 52s the patch passed
_ Other Tests _
+1 💚 unit 1m 22s hadoop-azure in the patch passed.
+1 💚 asflicense 0m 31s The patch does not generate ASF License warnings.
54m 18s
Subsystem Report/Notes
Docker Client=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/9/artifact/out/Dockerfile
GITHUB PR #1708
JIRA Issue HADOOP-16696
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux 829e792c0573 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / ef950b0
Default Java 1.8.0_222
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/9/testReport/
Max. process+thread count 428 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-azure U: hadoop-tools/hadoop-azure
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/9/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@sapant-msft
Copy link
Author

Hi @steveloughran , @DadanielZ ,

Thank you for your comments, I have tried to address all of them with my latest commits. Please kindly review again and let me know if you have any suggestions/ concerns.

Thanks,
Saurabh

Copy link
Contributor

@DadanielZ DadanielZ left a comment

Choose a reason for hiding this comment

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

Looks good to me, thanks for the tests!
+1

@DadanielZ
Copy link
Contributor

@sapant-msft please run mvn -T 1C -Dparallel-tests=abfs -Dscale -DtestsThreadCount=8 clean verify and share the results , if it looks ok I will commit this PR.

@hadoop-yetus
Copy link

🎊 +1 overall

Vote Subsystem Runtime Comment
+0 🆗 reexec 0m 38s Docker mode activated.
_ Prechecks _
+1 💚 dupname 0m 0s No case conflicting files found.
+1 💚 @author 0m 0s The patch does not contain any @author tags.
+1 💚 test4tests 0m 0s The patch appears to include 1 new or modified test files.
_ trunk Compile Tests _
+1 💚 mvninstall 18m 25s trunk passed
+1 💚 compile 0m 30s trunk passed
+1 💚 checkstyle 0m 24s trunk passed
+1 💚 mvnsite 0m 34s trunk passed
+1 💚 shadedclient 13m 22s branch has no errors when building and testing our client artifacts.
+1 💚 javadoc 0m 26s trunk passed
+0 🆗 spotbugs 0m 50s Used deprecated FindBugs config; considering switching to SpotBugs.
+1 💚 findbugs 0m 48s trunk passed
_ Patch Compile Tests _
+1 💚 mvninstall 0m 26s the patch passed
+1 💚 compile 0m 24s the patch passed
+1 💚 javac 0m 24s the patch passed
+1 💚 checkstyle 0m 16s the patch passed
+1 💚 mvnsite 0m 26s the patch passed
+1 💚 whitespace 0m 0s The patch has no whitespace issues.
+1 💚 shadedclient 13m 19s patch has no errors when building and testing our client artifacts.
+1 💚 javadoc 0m 23s the patch passed
+1 💚 findbugs 0m 54s the patch passed
_ Other Tests _
+1 💚 unit 1m 21s hadoop-azure in the patch passed.
+1 💚 asflicense 0m 30s The patch does not generate ASF License warnings.
54m 48s
Subsystem Report/Notes
Docker Client=19.03.5 Server=19.03.5 base: https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/11/artifact/out/Dockerfile
GITHUB PR #1708
JIRA Issue HADOOP-16696
Optional Tests dupname asflicense compile javac javadoc mvninstall mvnsite unit shadedclient findbugs checkstyle
uname Linux ecbbcde35e10 4.15.0-58-generic #64-Ubuntu SMP Tue Aug 6 11:12:41 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
Build tool maven
Personality personality/hadoop.sh
git revision trunk / 8d82c44
Default Java 1.8.0_222
Test Results https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/11/testReport/
Max. process+thread count 413 (vs. ulimit of 5500)
modules C: hadoop-tools/hadoop-azure U: hadoop-tools/hadoop-azure
Console output https://builds.apache.org/job/hadoop-multibranch/job/PR-1708/11/console
versions git=2.7.4 maven=3.3.9 findbugs=3.1.0-RC1
Powered by Apache Yetus 0.11.1 https://yetus.apache.org

This message was automatically generated.

@sapant-msft
Copy link
Author

@DadanielZ Thanks for the suggestion, I made a minor fix to the test, please kindly help review. The test results post the fix are (ran using: mvn -T 1C -Dparallel-tests=abfs -Dscale clean verify)
Tests run: 398, Failures: 0, Errors: 1, Skipped: 21
The only failure seems to be unrelated-ITestAzureBlobFileSystemCLI>AbstractAbfsIntegrationTest.setup:137
Other results:
Tests run: 192, Failures: 0, Errors: 0, Skipped: 126
Please let me know if you need more information.

Thanks,
Saurabh

@sapant-msft
Copy link
Author

The 1 test (ITestAzureBlobFileSystemCLI) which was failing earlier was fixed in PR, after sync with trunk seems to be passing now.
Here are the latest test results:
default-test
Tests run: 52, Failures: 0, Errors: 0, Skipped: 0
integration-test-abfs-parallel-classesAndMethods
Tests run: 192, Failures: 0, Errors: 0, Skipped: 126

Thanks,
Saurabh

@apache apache deleted a comment from hadoop-yetus Dec 5, 2019
@apache apache deleted a comment from hadoop-yetus Dec 5, 2019
@apache apache deleted a comment from hadoop-yetus Dec 5, 2019
@apache apache deleted a comment from hadoop-yetus Dec 5, 2019
@apache apache deleted a comment from hadoop-yetus Dec 5, 2019
@apache apache deleted a comment from hadoop-yetus Dec 5, 2019
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.

just accidentally hit the review rather than comment button. sorry

@steveloughran
Copy link
Contributor

setting the readahead

I have seen the Parquet readFooter code and agree, readahead matters there.

For the S3A readahead (HADOOP-13208? I forget) we worked off ORC traces and optimised for the PositionedReadable reads, which offen surface as a pair of back-to-back reads; Setting a minimum read ahead range handles this codepath.

If you're going near read ahead, it would be good if you implement CanSetReadahead, as then Applications can configure their read ahead in a filesystem independent manner. I worry a bit about this as with object stores, the effective read ahead range does seem to depend on distance from and hence latency to the store.

Presumably your benchmarks were executed in Azure? That is the likely real-world deployment. I'd be curious

  • what experiments you've done to work out what a good range is with your store/client?
  • how things behave over long-distance connections?

Regarding the patch: when would we ever really want to turn this off?

Is a serious question. For ORC, our past studies with S3A say "readahead". For Parquet, the implication is the same as needed. What other uses it do we care about? an HBase trace would be good here.

A key thing I'm trying to emphasise is that a small readahead is not expensive compared to the delays caused by having to issue two near-adjacent GET Requests. The main penalty is on a seek outside the range we have to drain the stream, which is ~(bytes-remaining/bandwidth).

I would prefer that rather than a boolean value, the stream always does the readahead except when the range == 0. That way setReadahead(0) and the config options are the way to disable it. And as noted: I don't think it should be disabled on random IO.

S3A reads always show significant speed up with readahead > 0; the only issue is what makes a good value?

Testing

Looking at the test, if you add some package-private method to query the readahead state, e.g (a) the range value and (b) bytes remaining in the current buffer.

Then you can verify that

  • read(bytes[n]) decrements the buffer by n
  • seek(getPos()) doesn't drain the buffer;
  • seek(getPos() + 1) doesn't it either. a read() should then decrement it by one
  • seek(0), seek(getPos()) doesn't drain the buffer; a read() should then decrement it by one
  • setReadahead(0) removes the buffer on the next seek+read outside the buffer. (There's no point discarding the current read, is there?)

Yes I am adding extra homework. Sorry. But as others will note: I like my tests, and I like tests in the hadoop- test suites as they catch regressions without needing any external tests.

@steveloughran steveloughran changed the title HADOOP-16696: Always read ahead config, to use read ahead even for non sequential reads. HADOOP-16696: ABFS Always read ahead config, to use read ahead even for non sequential reads. Dec 5, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
5 participants