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

zonefs support for ZenFS #210

Closed jsvaerke closed 2 years ago

jsvaerke commented 2 years ago

This change series introduces support for using zonefs to access a zoned block device in ZenFS. When using zonefs, the zones of a ZBD are exposed as individual files in a file system, e.g., sequential zone 5 is accessed through the path /seq/5. This makes read and write access somewhat different from the existing raw block device approach, where LBAs spanning the entire block device are used to specify a target range.

To continue to support the notion of a contiguous LBA space, the approach taken with zonefs is to map all sequential zones into into a contiguous LBA space such that sequential zone N has the LBA range [ N ; (N + 1) [. Read and write methods convert from this LBA space to offsets within zone files. A consequence of this is that all file operations now need to happen within the zoned block device support, and that raw FDs cannot be exposed to the FS and IO components anymore.

The use of zonefs is supported through a new URL: zenfs://zonefs: identifying a zonefs mountpoint. zonefs volumes should be mounted with the option "explicit-open", e.g., sudo mount -o explicit-open /dev/nvme0n2 /mnt after having created a zonefs filesystem on a device: sudo mkzonefs /dev/nvme0n2

The zenfs utility has been extended to accept either a zoned device or a zonefs mountpoint (using --zonefs=).

The change series is structured as follows: 1) Use of FDs outside of the ZonedBlockDevice are removed 2) ZonedBlockDevice is restructured such that all zbdlib specifics are moved to a ZonedBlockDeviceBackend object. 3) Support for the new URL for zonefs and the zenfs utility option is introduced. 4) zonefs support is added.

Closes #173

metaspace commented 2 years ago

TerarkDB build is failing because of addition of new files. I think we need to fix that before merging.

yhr commented 2 years ago

The terarkdb smoke test fails, but that'll be resolved by https://github.com/bytedance/terarkdb/pull/244 , we also need some testing for zonefs in the ci(will be addressed separately)