read entries using AIO
What is changed and how it works?
Issue Number: Ref #248
What's Changed:
1.Add fetch_ entries_aio() interface, which read entries using AIO.
Solution: Manage single entry-read requests in batch through AsyncIOContext. After submit read request according to different file blocks, fetch the byte stream collection of all blocks from AsyncIOContext. In the end, parse them into Entry in turn.
Check List
Tests
- Unit test
- Integration test
I have completed the code modification according to your comments and run the unit test locally, all of them have passed. PTAL. @tabokie
@ustc-wxy format and clippy failed.
Codecov Report
Patch coverage: 92.93% and project coverage change: -0.34 :warning:
Comparison is base (
3353011) 97.74% compared to head (f3a89c0) 97.40%.
:exclamation: Current head f3a89c0 differs from pull request most recent head a732d52. Consider uploading reports for the commit a732d52 to get more accurate results
Additional details and impacted files
@@ Coverage Diff @@
## master #286 +/- ##
==========================================
- Coverage 97.74% 97.40% -0.34%
==========================================
Files 30 30
Lines 11287 11668 +381
==========================================
+ Hits 11032 11365 +333
- Misses 255 303 +48
| Impacted Files | Coverage Δ | |
|---|---|---|
| src/file_pipe_log/mod.rs | 98.46% <ø> (ø) |
|
| src/pipe_log.rs | 95.45% <ø> (ø) |
|
| tests/failpoints/mod.rs | 100.00% <ø> (ø) |
|
| tests/failpoints/util.rs | 98.86% <ø> (-0.09%) |
:arrow_down: |
| src/env/obfuscated.rs | 85.71% <66.66%> (-9.94%) |
:arrow_down: |
| src/env/default.rs | 91.11% <87.64%> (-1.71%) |
:arrow_down: |
| src/engine.rs | 97.58% <92.37%> (-0.62%) |
:arrow_down: |
| src/file_pipe_log/format.rs | 99.10% <94.44%> (-0.41%) |
:arrow_down: |
| src/file_pipe_log/pipe.rs | 97.95% <95.60%> (-1.55%) |
:arrow_down: |
| src/file_pipe_log/pipe_builder.rs | 95.49% <96.12%> (-0.12%) |
:arrow_down: |
| ... and 6 more |
... and 1 file with indirect coverage changes
Help us with your feedback. Take ten seconds to tell us how you rate us. Have a feature suggestion? Share it here.
:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Do you have feedback about the report comment? Let us know in this issue.
@tabokie PTAL
@tabokie PTAL.
https://github.com/tikv/raft-engine/pull/286#discussion_r1118822597 is still not addressed. Is there any confusion?
shouldn't use unwrap.
expect is the same as unwrap except with some message. What I meant is the code shouldn't panic on error. It should bubble the error. And there're obviously other unwrap-s (like the line above it) beside the line I was pointing at.
@tabokie PTAL, thx!