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

Make sure files are not modified by more than one thread #195

Closed yhr closed 2 years ago

yhr commented 2 years ago

We don't explicitly disallow two writers to a single file, which we don't support, so we need to err out if the file is already open for writing.

Let's introduce a write mutex per zone file and try_lock this when reopening.

We should wait when re-opening a file that is being migrated. We must not migrate files that are opened for writing.