add IsSyncThreadSafe() override to EncryptedWritableFile (#8993)
Summary: EncryptedWritableFile is derived from FSWritableFile, which implements the `IsSyncThreadSafe()` function as bool IsSyncThreadSafe() const { return false; } EncryptedWritableFile does not override this method from the base class, so the `IsSyncThreadSafe()` function on an EncryptedWritableFile will always return false. This change adds an override of `IsSyncThreadSafe()` to EncryptedWritableFile so that the latter will now ask its underlying `file_` object for the thread-safety of sync operations. Pull Request resolved: https://github.com/facebook/rocksdb/pull/8993 Reviewed By: jay-zhuang Differential Revision: D31613123 Pulled By: ajkr fbshipit-source-id: b18625e21a9911744eef3215c29913490e4b6001
This commit is contained in:
parent
fbb09cf7aa
commit
ab6755711b
10
env/env_encryption.cc
vendored
10
env/env_encryption.cc
vendored
@ -255,12 +255,18 @@ IOStatus EncryptedWritableFile::PositionedAppend(const Slice& data,
|
|||||||
return file_->PositionedAppend(dataToAppend, offset, options, dbg);
|
return file_->PositionedAppend(dataToAppend, offset, options, dbg);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Indicates the upper layers if the current WritableFile implementation
|
// Indicates the upper layers if the current WritableFile implementation
|
||||||
// uses direct IO.
|
// uses direct IO.
|
||||||
bool EncryptedWritableFile::use_direct_io() const {
|
bool EncryptedWritableFile::use_direct_io() const {
|
||||||
return file_->use_direct_io();
|
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
|
// Use the returned alignment value to allocate
|
||||||
// aligned buffer for Direct I/O
|
// aligned buffer for Direct I/O
|
||||||
size_t EncryptedWritableFile::GetRequiredBufferAlignment() const {
|
size_t EncryptedWritableFile::GetRequiredBufferAlignment() const {
|
||||||
|
@ -318,6 +318,10 @@ class EncryptedWritableFile : public FSWritableFile {
|
|||||||
const IOOptions& options,
|
const IOOptions& options,
|
||||||
IODebugContext* dbg) override;
|
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
|
// Indicates the upper layers if the current WritableFile implementation
|
||||||
// uses direct IO.
|
// uses direct IO.
|
||||||
bool use_direct_io() const override;
|
bool use_direct_io() const override;
|
||||||
|
Loading…
Reference in New Issue
Block a user