diff --git a/include/rocksdb/perf_context.h b/include/rocksdb/perf_context.h index 03a282f7dae6772ab2418cac917e4a26c525db65..3d61000cc57a3a6d4f7f7a1163e4590fd145500e 100644 --- a/include/rocksdb/perf_context.h +++ b/include/rocksdb/perf_context.h @@ -30,10 +30,10 @@ struct PerfContextByLevel { // total number of user key returned (only include keys that are found, does // not include keys that are deleted or merged without a final put - uint64_t user_key_return_count; + uint64_t user_key_return_count = 0; // total nanos spent on reading data from SST files - uint64_t get_from_table_nanos; + uint64_t get_from_table_nanos = 0; uint64_t block_cache_hit_count = 0; // total number of block cache hits uint64_t block_cache_miss_count = 0; // total number of block cache misses diff --git a/memtable/memtablerep_bench.cc b/memtable/memtablerep_bench.cc index b44bc06fd476e5fb6e81e8b6c9cd8fb6e099e307..cbe62cc854995c27bb9d9e6464c00ea11a347bda 100644 --- a/memtable/memtablerep_bench.cc +++ b/memtable/memtablerep_bench.cc @@ -452,8 +452,8 @@ class Benchmark { MemTableRep* table_; KeyGenerator* key_gen_; uint64_t* sequence_; - uint64_t num_write_ops_per_thread_; - uint64_t num_read_ops_per_thread_; + uint64_t num_write_ops_per_thread_ = 0; + uint64_t num_read_ops_per_thread_ = 0; const uint32_t num_threads_; }; diff --git a/port/port_posix.h b/port/port_posix.h index 065572a8aca816dce6f2d58f1f06937adae51ba1..a24c7b690e29a3272a761b67bb5c3bad73a0da92 100644 --- a/port/port_posix.h +++ b/port/port_posix.h @@ -124,7 +124,7 @@ class Mutex { friend class CondVar; pthread_mutex_t mu_; #ifndef NDEBUG - bool locked_; + bool locked_ = false; #endif }; diff --git a/table/table_test.cc b/table/table_test.cc index 4b8167371e660f8fe704fdb42d9232f3f6ed59d2..d7e95ac5e10c07171a331d3b82491a96d74cac35 100644 --- a/table/table_test.cc +++ b/table/table_test.cc @@ -1189,11 +1189,11 @@ class FileChecksumTestHelper { public: FileChecksumTestHelper(bool convert_to_internal_key = false) : convert_to_internal_key_(convert_to_internal_key) { - sink_ = new test::StringSink(); } ~FileChecksumTestHelper() {} void CreateWriteableFile() { + sink_ = new test::StringSink(); file_writer_.reset(test::GetWritableFileWriter(sink_, "" /* don't care */)); } @@ -1291,7 +1291,7 @@ class FileChecksumTestHelper { std::unique_ptr file_reader_; std::unique_ptr table_builder_; stl_wrappers::KVMap kv_map_; - test::StringSink* sink_; + test::StringSink* sink_ = nullptr; static uint64_t checksum_uniq_id_; }; diff --git a/tools/db_bench_tool.cc b/tools/db_bench_tool.cc index f0511d05f38265ee5bf6cc4f14f23aad558b9573..2233810980d2fc875ef57279306fb41614417262 100644 --- a/tools/db_bench_tool.cc +++ b/tools/db_bench_tool.cc @@ -1851,7 +1851,7 @@ class CombinedStats; class Stats { private: int id_; - uint64_t start_; + uint64_t start_ = 0; uint64_t sine_interval_; uint64_t finish_; double seconds_; diff --git a/trace_replay/block_cache_tracer.h b/trace_replay/block_cache_tracer.h index 5849273dcc4cc3d18d882d410e137a3772ecefb1..9dc62b7fba8058275ef3993700d0b10d2751509c 100644 --- a/trace_replay/block_cache_tracer.h +++ b/trace_replay/block_cache_tracer.h @@ -220,7 +220,7 @@ class BlockCacheHumanReadableTraceWriter { class BlockCacheTraceReader { public: BlockCacheTraceReader(std::unique_ptr&& reader); - ~BlockCacheTraceReader() = default; + virtual ~BlockCacheTraceReader() = default; // No copy and move. BlockCacheTraceReader(const BlockCacheTraceReader&) = delete; BlockCacheTraceReader& operator=(const BlockCacheTraceReader&) = delete; diff --git a/utilities/backupable/backupable_db.cc b/utilities/backupable/backupable_db.cc index e4eb8e19cdd908a24c7c6a408ef3a09e644b2fd8..2183ef553290d78f68a748e88a5be87289de656a 100644 --- a/utilities/backupable/backupable_db.cc +++ b/utilities/backupable/backupable_db.cc @@ -538,6 +538,7 @@ Status BackupEngine::Open(const BackupableDBOptions& options, Env* env, BackupEngineImpl::BackupEngineImpl(const BackupableDBOptions& options, Env* db_env, bool read_only) : initialized_(false), + threads_cpu_priority_(), latest_backup_id_(0), latest_valid_backup_id_(0), stop_backup_(false),