mirror of
https://github.com/facebook/rocksdb.git
synced 2024-11-26 16:30:56 +00:00
Fix flaky error_handler_fs_test.MultiDBCompactionError
(#7896)
Summary: The error recovery thread may out-live DBImpl object, which causing access released DBImpl.mutex. Close SstFileManager before closing DB. Pull Request resolved: https://github.com/facebook/rocksdb/pull/7896 Test Plan: the issue can be reproduced by adding sleep in recovery code. Pass the tests with sleep. Reviewed By: zhichao-cao Differential Revision: D26076655 Pulled By: jay-zhuang fbshipit-source-id: 0d9cc5639c12fcfc001427015e75a9736f33cd96
This commit is contained in:
parent
f9a30e0a5a
commit
9425acacce
|
@ -9,9 +9,9 @@
|
||||||
#ifndef ROCKSDB_LITE
|
#ifndef ROCKSDB_LITE
|
||||||
|
|
||||||
#include "db/db_test_util.h"
|
#include "db/db_test_util.h"
|
||||||
|
#include "file/sst_file_manager_impl.h"
|
||||||
#include "port/stack_trace.h"
|
#include "port/stack_trace.h"
|
||||||
#include "rocksdb/io_status.h"
|
#include "rocksdb/io_status.h"
|
||||||
#include "rocksdb/perf_context.h"
|
|
||||||
#include "rocksdb/sst_file_manager.h"
|
#include "rocksdb/sst_file_manager.h"
|
||||||
#if !defined(ROCKSDB_LITE)
|
#if !defined(ROCKSDB_LITE)
|
||||||
#include "test_util/sync_point.h"
|
#include "test_util/sync_point.h"
|
||||||
|
@ -1391,6 +1391,10 @@ TEST_F(DBErrorHandlingFSTest, MultiDBCompactionError) {
|
||||||
EXPECT_EQ(atoi(prop.c_str()), 1);
|
EXPECT_EQ(atoi(prop.c_str()), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SstFileManagerImpl* sfmImpl =
|
||||||
|
static_cast_with_check<SstFileManagerImpl>(sfm.get());
|
||||||
|
sfmImpl->Close();
|
||||||
|
|
||||||
for (auto i = 0; i < kNumDbInstances; ++i) {
|
for (auto i = 0; i < kNumDbInstances; ++i) {
|
||||||
char buf[16];
|
char buf[16];
|
||||||
snprintf(buf, sizeof(buf), "_%d", i);
|
snprintf(buf, sizeof(buf), "_%d", i);
|
||||||
|
@ -1524,6 +1528,10 @@ TEST_F(DBErrorHandlingFSTest, MultiDBVariousErrors) {
|
||||||
EXPECT_EQ(atoi(prop.c_str()), 1);
|
EXPECT_EQ(atoi(prop.c_str()), 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
SstFileManagerImpl* sfmImpl =
|
||||||
|
static_cast_with_check<SstFileManagerImpl>(sfm.get());
|
||||||
|
sfmImpl->Close();
|
||||||
|
|
||||||
for (auto i = 0; i < kNumDbInstances; ++i) {
|
for (auto i = 0; i < kNumDbInstances; ++i) {
|
||||||
char buf[16];
|
char buf[16];
|
||||||
snprintf(buf, sizeof(buf), "_%d", i);
|
snprintf(buf, sizeof(buf), "_%d", i);
|
||||||
|
|
Loading…
Reference in a new issue