diff --git a/env/env.cc b/env/env.cc index 51614c12be6..6aad4a53e81 100644 --- a/env/env.cc +++ b/env/env.cc @@ -420,6 +420,7 @@ void AssignEnvOptions(EnvOptions* env_options, const DBOptions& options) { options.writable_file_max_buffer_size; env_options->allow_fallocate = options.allow_fallocate; env_options->strict_bytes_per_sync = options.strict_bytes_per_sync; + options.env->SanitizeEnvOptions(env_options); } } diff --git a/include/rocksdb/env.h b/include/rocksdb/env.h index 0c5e590b2f1..e70a49ffc43 100644 --- a/include/rocksdb/env.h +++ b/include/rocksdb/env.h @@ -528,6 +528,8 @@ class Env { return Status::NotSupported(); } + virtual void SanitizeEnvOptions(EnvOptions* /*env_opts*/) const {} + // If you're adding methods here, remember to add them to EnvWrapper too. protected: @@ -1363,6 +1365,9 @@ class EnvWrapper : public Env { Status GetFreeSpace(const std::string& path, uint64_t* diskfree) override { return target_->GetFreeSpace(path, diskfree); } + void SanitizeEnvOptions(EnvOptions* env_opts) const override { + target_->SanitizeEnvOptions(env_opts); + } private: Env* target_;