@ -471,6 +471,7 @@ IOStatus RandomAccessFileReader::ReadAsync(
( uintptr_t ( req . scratch ) & ( alignment - 1 ) ) = = 0 ;
read_async_info - > is_aligned_ = is_aligned ;
uint64_t elapsed = 0 ;
if ( use_direct_io ( ) & & is_aligned = = false ) {
FSReadRequest aligned_req = Align ( req , alignment ) ;
aligned_req . status . PermitUncheckedError ( ) ;
@ -491,12 +492,17 @@ IOStatus RandomAccessFileReader::ReadAsync(
assert ( read_async_info - > buf_ . CurrentSize ( ) = = 0 ) ;
StopWatch sw ( clock_ , nullptr /*stats*/ , 0 /*hist_type*/ , & elapsed ,
true /*overwrite*/ , true /*delay_enabled*/ ) ;
s = file_ - > ReadAsync ( aligned_req , opts , read_async_callback ,
read_async_info , io_handle , del_fn , nullptr /*dbg*/ ) ;
} else {
StopWatch sw ( clock_ , nullptr /*stats*/ , 0 /*hist_type*/ , & elapsed ,
true /*overwrite*/ , true /*delay_enabled*/ ) ;
s = file_ - > ReadAsync ( req , opts , read_async_callback , read_async_info ,
io_handle , del_fn , nullptr /*dbg*/ ) ;
}
RecordTick ( stats_ , READ_ASYNC_MICROS , elapsed ) ;
// Suppress false positive clang analyzer warnings.
// Memory is not released if file_->ReadAsync returns !s.ok(), because
@ -575,6 +581,8 @@ void RandomAccessFileReader::ReadAsyncCallback(const FSReadRequest& req,
}
if ( req . status . ok ( ) ) {
RecordInHistogram ( stats_ , ASYNC_READ_BYTES , req . result . size ( ) ) ;
} else if ( ! req . status . IsAborted ( ) ) {
RecordTick ( stats_ , ASYNC_READ_ERROR_COUNT , 1 ) ;
}
# ifndef ROCKSDB_LITE
if ( ShouldNotifyListeners ( ) ) {