Skip to content

Commit 9d8e798

Browse files
Make format.
Signed-off-by: lucasliang <nkcs_lykx@hotmail.com>
1 parent 961d779 commit 9d8e798

File tree

1 file changed

+9
-5
lines changed

1 file changed

+9
-5
lines changed

src/engine.rs

Lines changed: 9 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -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

Comments
 (0)