mirror of
https://github.com/facebook/rocksdb.git
synced 2026-07-07 14:47:40 +08:00
Remove stats_ field from SstFileManagerImpl (#13757)
Summary: `SstFileManager` is supposed to be thread-safe for all of its public methods, but `SetStatisticsPtr` leads to a race condition because the access to `stat_` is not synchronized. We don't use `stat_` internally so we can get rid of it. Pull Request resolved: https://github.com/facebook/rocksdb/pull/13757 Test Plan: Existing unit tests. Reviewed By: mszeszko-meta Differential Revision: D77962592 Pulled By: archang19 fbshipit-source-id: e8e56194dda034935ddef44e479243770a73d065
This commit is contained in:
committed by
Facebook GitHub Bot
parent
9758482360
commit
29c65d8bff
@@ -162,7 +162,6 @@ class SstFileManagerImpl : public SstFileManager {
|
|||||||
void Close();
|
void Close();
|
||||||
|
|
||||||
void SetStatisticsPtr(const std::shared_ptr<Statistics>& stats) override {
|
void SetStatisticsPtr(const std::shared_ptr<Statistics>& stats) override {
|
||||||
stats_ = stats;
|
|
||||||
delete_scheduler_.SetStatisticsPtr(stats);
|
delete_scheduler_.SetStatisticsPtr(stats);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -216,7 +215,6 @@ class SstFileManagerImpl : public SstFileManager {
|
|||||||
std::list<ErrorHandler*> error_handler_list_;
|
std::list<ErrorHandler*> error_handler_list_;
|
||||||
// Pointer to ErrorHandler instance that is currently processing recovery
|
// Pointer to ErrorHandler instance that is currently processing recovery
|
||||||
ErrorHandler* cur_instance_;
|
ErrorHandler* cur_instance_;
|
||||||
std::shared_ptr<Statistics> stats_;
|
|
||||||
};
|
};
|
||||||
|
|
||||||
} // namespace ROCKSDB_NAMESPACE
|
} // namespace ROCKSDB_NAMESPACE
|
||||||
|
|||||||
Reference in New Issue
Block a user