pantsbuild / pants

The Pants Build System
https://www.pantsbuild.org
Apache License 2.0
3.33k stars 638 forks source link

use lmdb database statistics to shrink() the local ByteStore #10869

Open cosmicexplorer opened 4 years ago

cosmicexplorer commented 4 years ago

There's this line in the local store source above the shrink() method: https://github.com/pantsbuild/pants/blob/237e6a6e8b1c41d58a38426d92dac96f878f2159/src/rust/engine/fs/store/src/local.rs#L121

and in looking over that i found this environment::Stat object from our fork of the lmdb-rs crate: https://github.com/pantsbuild/lmdb-rs/blob/c64f0b4f8280190525a6430388e714739f18976b/src/environment.rs#L171:

/// Environment statistics.
///
/// Contains information about the size and layout of an LMDB environment.
pub struct Stat(ffi::MDB_stat);

Is that the info we would be looking for here?

stuhood commented 4 years ago

Probably. But I'm not sure what the actual impact of fixing this would be. Either removing the TODO or better explaining it would be good.