Introduce background stale AppendVec shrink mechanism (#9219)

* Introduce background AppendVec shrink mechanism

* Support ledger tool

* Clean up

* save

* save

* Fix CI

* More clean up

* Add tests

* Clean up yet more

* Use account.hash...

* Fix typo....

* Add comment

* Rename accounts_cleanup_service
This commit is contained in:
Ryo Onodera
2020-04-06 17:30:23 +09:00
committed by GitHub
parent 7b68628e6c
commit b28ec430e4
6 changed files with 412 additions and 49 deletions

View File

@@ -160,7 +160,9 @@ impl AppendVec {
data.seek(SeekFrom::Start(0)).unwrap();
data.flush().unwrap();
//UNSAFE: Required to create a Mmap
let map = unsafe { MmapMut::map_mut(&data).expect("failed to map the data file") };
let map = unsafe { MmapMut::map_mut(&data) };
let map =
map.unwrap_or_else(|e| panic!("failed to map the data file (size: {}): {}", size, e));
AppendVec {
path: file.to_path_buf(),