westerndigitalcorporation / zenfs

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

Why do we need `Sync()` in `Zone::Append()` ? #39

Closed royguo closed 3 years ago

royguo commented 3 years ago

https://github.com/westerndigitalcorporation/zenfs/blob/4f577cd4d4bf4b40b65ecd8b8680f37dc7b7780c/fs/zbd_zenfs.cc#L151-L160

Why do we need to Sync() here in a synchronize Append() method? Isn't it true that a successful pwrite guarantees data persistency?

skyzh commented 3 years ago

This is newly added in the experimental branch to support aio. If I/O is issued through pwrite instead of aio, it is not needed to do this.

yhr commented 3 years ago

This is done in the experimental branch to ensure we won't exceed more than one outstanding write. We could increase the number of buffers / queue depth if needed, but having async buffer flushes(one background write) improved things considerably so its probably not motivated.

yhr commented 3 years ago

@royguo : Can we close this?