Skip to content

Commit

Permalink
don't scan and check when reopening mmap file
Browse files Browse the repository at this point in the history
  • Loading branch information
HaoranYi committed Jul 11, 2024
1 parent c338fbc commit 3af12a5
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions accounts-db/src/append_vec.rs
Original file line number Diff line number Diff line change
Expand Up @@ -437,9 +437,14 @@ impl AppendVec {
self.flush().expect("flush must succeed");
// we are re-opening the file, so don't remove the file on disk when the old mmapped one is dropped
self.remove_file_on_drop.store(false, Ordering::Release);
AppendVec::new_from_file(self.path.clone(), self.len(), StorageAccess::File)
.ok()
.map(|(av, _size)| av)

// The file should have already been sanitized. Don't need to check when we open the file again.
AppendVec::new_from_file_unchecked(
self.path.clone(),
self.len(),
StorageAccess::File,
)
.ok()
}
}
}
Expand Down

0 comments on commit 3af12a5

Please sign in to comment.