Clean job_context

This commit is contained in:
Igor Canadi 2014-11-14 16:57:17 -08:00
parent 0ce38fe983
commit 23295b74b6
2 changed files with 3 additions and 0 deletions

View File

@ -69,6 +69,7 @@ Status DBImpl::EnableFileDeletions(bool force) {
if (should_purge_files) { if (should_purge_files) {
PurgeObsoleteFiles(job_context); PurgeObsoleteFiles(job_context);
} }
job_context.Clean();
LogFlush(db_options_.info_log); LogFlush(db_options_.info_log);
return Status::OK(); return Status::OK();
} }

View File

@ -85,6 +85,7 @@ TEST(FlushJobTest, Empty) {
SequenceNumber(), &job_context, nullptr, nullptr, SequenceNumber(), &job_context, nullptr, nullptr,
kNoCompression, nullptr); kNoCompression, nullptr);
ASSERT_OK(flush_job.Run()); ASSERT_OK(flush_job.Run());
job_context.Clean();
} }
TEST(FlushJobTest, NonEmpty) { TEST(FlushJobTest, NonEmpty) {
@ -113,6 +114,7 @@ TEST(FlushJobTest, NonEmpty) {
ASSERT_OK(flush_job.Run()); ASSERT_OK(flush_job.Run());
mutex_.Unlock(); mutex_.Unlock();
mock_table_factory_->AssertSingleFile(inserted_keys); mock_table_factory_->AssertSingleFile(inserted_keys);
job_context.Clean();
} }
} // namespace rocksdb } // namespace rocksdb