diff --git a/db/compact_files_test.cc b/db/compact_files_test.cc index 92975da87c..4152cb3793 100644 --- a/db/compact_files_test.cc +++ b/db/compact_files_test.cc @@ -387,7 +387,7 @@ TEST_F(CompactFilesTest, GetCompactionJobInfo) { auto l0_files_1 = collector->GetFlushedFiles(); CompactionOptions co; co.compression = CompressionType::kLZ4Compression; - CompactionJobInfo compaction_job_info; + CompactionJobInfo compaction_job_info{}; ASSERT_OK( db->CompactFiles(co, l0_files_1, 0, -1, nullptr, &compaction_job_info)); ASSERT_EQ(compaction_job_info.base_input_level, 0); diff --git a/db/db_impl/db_impl_compaction_flush.cc b/db/db_impl/db_impl_compaction_flush.cc index 0497e859a6..f742322440 100644 --- a/db/db_impl/db_impl_compaction_flush.cc +++ b/db/db_impl/db_impl_compaction_flush.cc @@ -570,7 +570,7 @@ void DBImpl::NotifyOnFlushBegin(ColumnFamilyData* cfd, FileMetaData* file_meta, // release lock while notifying events mutex_.Unlock(); { - FlushJobInfo info; + FlushJobInfo info{}; info.cf_id = cfd->GetID(); info.cf_name = cfd->GetName(); // TODO(yhchiang): make db_paths dynamic in case flush does not @@ -1107,7 +1107,7 @@ void DBImpl::NotifyOnCompactionBegin(ColumnFamilyData* cfd, Compaction* c, mutex_.Unlock(); TEST_SYNC_POINT("DBImpl::NotifyOnCompactionBegin::UnlockMutex"); { - CompactionJobInfo info; + CompactionJobInfo info{}; info.cf_name = cfd->GetName(); info.status = st; info.thread_id = env_->GetThreadID(); @@ -1181,7 +1181,7 @@ void DBImpl::NotifyOnCompactionCompleted( mutex_.Unlock(); TEST_SYNC_POINT("DBImpl::NotifyOnCompactionCompleted::UnlockMutex"); { - CompactionJobInfo info; + CompactionJobInfo info{}; BuildCompactionJobInfo(cfd, c, st, compaction_job_stats, job_id, current, &info); for (auto listener : immutable_db_options_.listeners) { diff --git a/db/flush_job.cc b/db/flush_job.cc index 83ce7e74f7..fc14b5b92b 100644 --- a/db/flush_job.cc +++ b/db/flush_job.cc @@ -431,7 +431,7 @@ Status FlushJob::WriteLevel0Table() { #ifndef ROCKSDB_LITE std::unique_ptr FlushJob::GetFlushJobInfo() const { db_mutex_->AssertHeld(); - std::unique_ptr info(new FlushJobInfo); + std::unique_ptr info(new FlushJobInfo{}); info->cf_id = cfd_->GetID(); info->cf_name = cfd_->GetName();