@@ -334,18 +334,22 @@ where
334334 let _t = StopWatch :: new ( & * ENGINE_READ_ENTRY_DURATION_HISTOGRAM ) ;
335335 if let Some ( memtable) = self . memtables . get ( region_id) {
336336 let mut ents_idx: Vec < EntryIndex > = Vec :: with_capacity ( ( end - begin) as usize ) ;
337- memtable. read ( ) . fetch_entries_to ( begin, end, max_size, & mut ents_idx) ?;
337+ memtable
338+ . read ( )
339+ . fetch_entries_to ( begin, end, max_size, & mut ents_idx) ?;
338340 for i in ents_idx. iter ( ) {
339341 vec. push ( {
340342 match read_entry_from_file :: < M , _ > ( self . pipe_log . as_ref ( ) , i) {
341343 Ok ( entry) => entry,
342344 Err ( e) => {
343345 // The index is not found in the file, it means the entry is already
344- // stale by `compact` or `rewrite`. Retry to read the entry from the memtable.
346+ // stale by `compact` or `rewrite`. Retry to read the entry from the
347+ // memtable.
345348 let immutable = memtable. read ( ) ;
346- // Ensure that the corresponding memtable is locked with a read lock before
347- // completing the fetching of entries from the raft logs. This
348- // prevents the scenario where the index could become stale while
349+ // Ensure that the corresponding memtable is locked with a read lock
350+ // before completing the fetching of entries
351+ // from the raft logs. This prevents the
352+ // scenario where the index could become stale while
349353 // being concurrently updated by the `rewrite` operation.
350354 if let Some ( idx) = immutable. get_entry ( i. index ) {
351355 read_entry_from_file :: < M , _ > ( self . pipe_log . as_ref ( ) , & idx) ?
0 commit comments