mirror of https://github.com/facebook/rocksdb.git
64cead919f
Summary: valgrind complains "Conditional jump or move depends on uninitialised value(s)". A sample error message: ``` [ RUN ] DBCompactionTest.DrainUnnecessaryLevelsAfterDBBecomesSmall ==3353864== Conditional jump or move depends on uninitialised value(s) ==3353864== at 0x8647B4: rocksdb::VersionStorageInfo::ComputeCompactionScore(rocksdb::ImmutableOptions const&, rocksdb::MutableCFOptions const&) (version_set.cc:3414) ==3353864== by 0x86B340: rocksdb::VersionSet::AppendVersion(rocksdb::ColumnFamilyData*, rocksdb::Version*) (version_set.cc:4946) ==3353864== by 0x876B88: rocksdb::VersionSet::CreateColumnFamily(rocksdb::ColumnFamilyOptions const&, rocksdb::VersionEdit const*) (version_set.cc:6876) ==3353864== by 0xBA66FE: rocksdb::VersionEditHandler::CreateCfAndInit(rocksdb::ColumnFamilyOptions const&, rocksdb::VersionEdit const&) (version_edit_handler.cc:483) ==3353864== by 0xBA4A81: rocksdb::VersionEditHandler::Initialize() (version_edit_handler.cc:187) ==3353864== by 0xBA3927: rocksdb::VersionEditHandlerBase::Iterate(rocksdb::log::Reader&, rocksdb::Status*) (version_edit_handler.cc:31) ==3353864== by 0x870173: rocksdb::VersionSet::Recover(std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool) (version_set.cc:5729) ==3353864== by 0x7538FA: rocksdb::DBImpl::Recover(std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const&, bool, bool, bool, unsigned long*, rocksdb::DBImpl::RecoveryContext*) (db_impl_open.cc:522) ==3353864== by 0x75BA0F: rocksdb::DBImpl::Open(rocksdb::DBOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const&, std::vector<rocksdb::ColumnFamilyHandle*, std::allocator<rocksdb::ColumnFamilyHandle*> >*, rocksdb::DB**, bool, bool) (db_impl_open.cc:1928) ==3353864== by 0x75A735: rocksdb::DB::Open(rocksdb::DBOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const&, std::vector<rocksdb::ColumnFamilyHandle*, std::allocator<rocksdb::ColumnFamilyHandle*> >*, rocksdb::DB**) (db_impl_open.cc:1743) ==3353864== by 0x75A510: rocksdb::DB::Open(rocksdb::Options const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rocksdb::DB**) (db_impl_open.cc:1720) ==3353864== by 0x5925FD: rocksdb::DBTestBase::TryReopen(rocksdb::Options const&) (db_test_util.cc:710) ==3353864== Uninitialised value was created by a heap allocation ==3353864== at 0x4842F0F: operator new(unsigned long) (vg_replace_malloc.c:422) ==3353864== by 0x876AF4: rocksdb::VersionSet::CreateColumnFamily(rocksdb::ColumnFamilyOptions const&, rocksdb::VersionEdit const*) (version_set.cc:6870) ==3353864== by 0xBA66FE: rocksdb::VersionEditHandler::CreateCfAndInit(rocksdb::ColumnFamilyOptions const&, rocksdb::VersionEdit const&) (version_edit_handler.cc:483) ==3353864== by 0xBA4A81: rocksdb::VersionEditHandler::Initialize() (version_edit_handler.cc:187) ==3353864== by 0xBA3927: rocksdb::VersionEditHandlerBase::Iterate(rocksdb::log::Reader&, rocksdb::Status*) (version_edit_handler.cc:31) ==3353864== by 0x870173: rocksdb::VersionSet::Recover(std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const&, bool, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*, bool) (version_set.cc:5729) ==3353864== by 0x7538FA: rocksdb::DBImpl::Recover(std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const&, bool, bool, bool, unsigned long*, rocksdb::DBImpl::RecoveryContext*) (db_impl_open.cc:522) ==3353864== by 0x75BA0F: rocksdb::DBImpl::Open(rocksdb::DBOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const&, std::vector<rocksdb::ColumnFamilyHandle*, std::allocator<rocksdb::ColumnFamilyHandle*> >*, rocksdb::DB**, bool, bool) (db_impl_open.cc:1928) ==3353864== by 0x75A735: rocksdb::DB::Open(rocksdb::DBOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, std::vector<rocksdb::ColumnFamilyDescriptor, std::allocator<rocksdb::ColumnFamilyDescriptor> > const&, std::vector<rocksdb::ColumnFamilyHandle*, std::allocator<rocksdb::ColumnFamilyHandle*> >*, rocksdb::DB**) (db_impl_open.cc:1743) ==3353864== by 0x75A510: rocksdb::DB::Open(rocksdb::Options const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, rocksdb::DB**) (db_impl_open.cc:1720) ==3353864== by 0x5925FD: rocksdb::DBTestBase::TryReopen(rocksdb::Options const&) (db_test_util.cc:710) ==3353864== by 0x591F73: rocksdb::DBTestBase::Reopen(rocksdb::Options const&) (db_test_util.cc:662) ``` This is likely about `lowest_unnecessary_level_` even though it would be initialized in `CalculateBaseBytes()` before being used in `ComputeCompactionScore()`. Initialize it also in VersionStorageInfo constructor to prevent valgrind from complaining. Pull Request resolved: https://github.com/facebook/rocksdb/pull/11359 Test Plan: - ran a test with valgrind which gave the error message above before this PR: `valgrind --track-origins=yes ./db_compaction_test --gtest_filter="*DrainUnnecessaryLevelsAfterDBBecomesSmall*"` Reviewed By: hx235 Differential Revision: D44799112 Pulled By: cbi42 fbshipit-source-id: 557208a66f04a2163b418b2a651bdb7e777c4511 |
||
---|---|---|
.. | ||
blob | ||
compaction | ||
db_impl | ||
wide | ||
arena_wrapped_db_iter.cc | ||
arena_wrapped_db_iter.h | ||
builder.cc | ||
builder.h | ||
c.cc | ||
c_test.c | ||
column_family.cc | ||
column_family.h | ||
column_family_test.cc | ||
compact_files_test.cc | ||
comparator_db_test.cc | ||
convenience.cc | ||
corruption_test.cc | ||
cuckoo_table_db_test.cc | ||
db_basic_test.cc | ||
db_block_cache_test.cc | ||
db_bloom_filter_test.cc | ||
db_compaction_filter_test.cc | ||
db_compaction_test.cc | ||
db_dynamic_level_test.cc | ||
db_encryption_test.cc | ||
db_filesnapshot.cc | ||
db_flush_test.cc | ||
db_info_dumper.cc | ||
db_info_dumper.h | ||
db_inplace_update_test.cc | ||
db_io_failure_test.cc | ||
db_iter.cc | ||
db_iter.h | ||
db_iter_stress_test.cc | ||
db_iter_test.cc | ||
db_iterator_test.cc | ||
db_kv_checksum_test.cc | ||
db_log_iter_test.cc | ||
db_logical_block_size_cache_test.cc | ||
db_memtable_test.cc | ||
db_merge_operand_test.cc | ||
db_merge_operator_test.cc | ||
db_options_test.cc | ||
db_properties_test.cc | ||
db_range_del_test.cc | ||
db_rate_limiter_test.cc | ||
db_readonly_with_timestamp_test.cc | ||
db_secondary_test.cc | ||
db_sst_test.cc | ||
db_statistics_test.cc | ||
db_table_properties_test.cc | ||
db_tailing_iter_test.cc | ||
db_test.cc | ||
db_test2.cc | ||
db_test_util.cc | ||
db_test_util.h | ||
db_universal_compaction_test.cc | ||
db_wal_test.cc | ||
db_with_timestamp_basic_test.cc | ||
db_with_timestamp_compaction_test.cc | ||
db_with_timestamp_test_util.cc | ||
db_with_timestamp_test_util.h | ||
db_write_buffer_manager_test.cc | ||
db_write_test.cc | ||
dbformat.cc | ||
dbformat.h | ||
dbformat_test.cc | ||
deletefile_test.cc | ||
error_handler.cc | ||
error_handler.h | ||
error_handler_fs_test.cc | ||
event_helpers.cc | ||
event_helpers.h | ||
experimental.cc | ||
external_sst_file_basic_test.cc | ||
external_sst_file_ingestion_job.cc | ||
external_sst_file_ingestion_job.h | ||
external_sst_file_test.cc | ||
fault_injection_test.cc | ||
file_indexer.cc | ||
file_indexer.h | ||
file_indexer_test.cc | ||
filename_test.cc | ||
flush_job.cc | ||
flush_job.h | ||
flush_job_test.cc | ||
flush_scheduler.cc | ||
flush_scheduler.h | ||
forward_iterator.cc | ||
forward_iterator.h | ||
forward_iterator_bench.cc | ||
history_trimming_iterator.h | ||
import_column_family_job.cc | ||
import_column_family_job.h | ||
import_column_family_test.cc | ||
internal_stats.cc | ||
internal_stats.h | ||
job_context.h | ||
kv_checksum.h | ||
listener_test.cc | ||
log_format.h | ||
log_reader.cc | ||
log_reader.h | ||
log_test.cc | ||
log_writer.cc | ||
log_writer.h | ||
logs_with_prep_tracker.cc | ||
logs_with_prep_tracker.h | ||
lookup_key.h | ||
malloc_stats.cc | ||
malloc_stats.h | ||
manual_compaction_test.cc | ||
memtable.cc | ||
memtable.h | ||
memtable_list.cc | ||
memtable_list.h | ||
memtable_list_test.cc | ||
merge_context.h | ||
merge_helper.cc | ||
merge_helper.h | ||
merge_helper_test.cc | ||
merge_operator.cc | ||
merge_test.cc | ||
obsolete_files_test.cc | ||
options_file_test.cc | ||
output_validator.cc | ||
output_validator.h | ||
perf_context_test.cc | ||
periodic_task_scheduler.cc | ||
periodic_task_scheduler.h | ||
periodic_task_scheduler_test.cc | ||
pinned_iterators_manager.h | ||
plain_table_db_test.cc | ||
post_memtable_callback.h | ||
pre_release_callback.h | ||
prefix_test.cc | ||
range_del_aggregator.cc | ||
range_del_aggregator.h | ||
range_del_aggregator_bench.cc | ||
range_del_aggregator_test.cc | ||
range_tombstone_fragmenter.cc | ||
range_tombstone_fragmenter.h | ||
range_tombstone_fragmenter_test.cc | ||
read_callback.h | ||
repair.cc | ||
repair_test.cc | ||
seqno_time_test.cc | ||
seqno_to_time_mapping.cc | ||
seqno_to_time_mapping.h | ||
snapshot_checker.h | ||
snapshot_impl.cc | ||
snapshot_impl.h | ||
table_cache.cc | ||
table_cache.h | ||
table_cache_sync_and_async.h | ||
table_properties_collector.cc | ||
table_properties_collector.h | ||
table_properties_collector_test.cc | ||
transaction_log_impl.cc | ||
transaction_log_impl.h | ||
trim_history_scheduler.cc | ||
trim_history_scheduler.h | ||
version_builder.cc | ||
version_builder.h | ||
version_builder_test.cc | ||
version_edit.cc | ||
version_edit.h | ||
version_edit_handler.cc | ||
version_edit_handler.h | ||
version_edit_test.cc | ||
version_set.cc | ||
version_set.h | ||
version_set_sync_and_async.h | ||
version_set_test.cc | ||
version_util.h | ||
wal_edit.cc | ||
wal_edit.h | ||
wal_edit_test.cc | ||
wal_manager.cc | ||
wal_manager.h | ||
wal_manager_test.cc | ||
write_batch.cc | ||
write_batch_base.cc | ||
write_batch_internal.h | ||
write_batch_test.cc | ||
write_callback.h | ||
write_callback_test.cc | ||
write_controller.cc | ||
write_controller.h | ||
write_controller_test.cc | ||
write_stall_stats.cc | ||
write_stall_stats.h | ||
write_thread.cc | ||
write_thread.h |