westerndigitalcorporation / zenfs

ZenFS is a storage backend for RocksDB that enables support for ZNS SSDs and SMR HDDs.
GNU General Public License v2.0
238 stars 87 forks source link

A question about ZenFS::MigrateExtents #242

Closed attack204 closed 1 year ago

attack204 commented 1 year ago

It seems if we call ZenFS::MigrateExtents(const std::vector<ZoneExtentSnapshot*>& extents); Then it will migrate the data to another zone. However, if we want to GC a zone, how can we get the data in zone? It seems no data structure was maintained in Zone Class.

yhr commented 1 year ago

@attack204 : See https://github.com/yhr/zenfs/blob/724cfc56ce59163e385077a8820bfecdb932b7d8/fs/fs_zenfs.cc#L272 for a reference GC implementation, we're reviewing it now and it will soon be merged as part of #184

attack204 commented 1 year ago

@yhr That's really good! So is this GC algorithm relatively stable or frequently optimized? I may do some modifications on it.

yhr commented 1 year ago

@attack204 : It's reasonably stable, we've been testing it both with percona-mysql-server and db_bench with good results (up to 10% space amp reduction). That said, it can probably be improved, so any experimentation/improvements from your side would be welcome! We set up target file sizes to match zone capacity when running with gc enabled.

attack204 commented 1 year ago

@yhr Thank you very much!