diff --git a/env/env_encryption.cc b/env/env_encryption.cc index 22e2e5190..accc07c9a 100644 --- a/env/env_encryption.cc +++ b/env/env_encryption.cc @@ -255,12 +255,18 @@ IOStatus EncryptedWritableFile::PositionedAppend(const Slice& data, return file_->PositionedAppend(dataToAppend, offset, options, dbg); } - // Indicates the upper layers if the current WritableFile implementation - // uses direct IO. +// Indicates the upper layers if the current WritableFile implementation +// uses direct IO. bool EncryptedWritableFile::use_direct_io() const { return file_->use_direct_io(); } +// true if Sync() and Fsync() are safe to call concurrently with Append() +// and Flush(). +bool EncryptedWritableFile::IsSyncThreadSafe() const { + return file_->IsSyncThreadSafe(); +} + // Use the returned alignment value to allocate // aligned buffer for Direct I/O size_t EncryptedWritableFile::GetRequiredBufferAlignment() const { diff --git a/include/rocksdb/env_encryption.h b/include/rocksdb/env_encryption.h index e243e3eb7..239e6bb87 100644 --- a/include/rocksdb/env_encryption.h +++ b/include/rocksdb/env_encryption.h @@ -318,6 +318,10 @@ class EncryptedWritableFile : public FSWritableFile { const IOOptions& options, IODebugContext* dbg) override; + // true if Sync() and Fsync() are safe to call concurrently with Append() + // and Flush(). + bool IsSyncThreadSafe() const override; + // Indicates the upper layers if the current WritableFile implementation // uses direct IO. bool use_direct_io() const override;