rocksdb/db/compaction
Jay Huh 0ca691654f Fix Unit Test failing from uninit values in CompactionServiceInput (#13080)
Summary:
# Summary

There was a [test failure](https://github.com/facebook/rocksdb/actions/runs/11381731053/job/31663774089?fbclid=IwZXh0bgNhZW0CMTEAAR0YJVdnkKUhN15RJQrLsvicxqzReS6y4A14VFQbWu-81XJsSsyNepXAr2c_aem_JyQqNdtpeKFSA6CjlD-pDg) from uninit value in the CompactionServiceInput

```
[ RUN      ] CompactionJobTest.InputSerialization
==79945== Use of uninitialised value of size 8
==79945==    at 0x58EA69B: _itoa_word (_itoa.c:179)
==79945==    by 0x5906574: __vfprintf_internal (vfprintf-internal.c:1687)
==79945==    by 0x591AF99: __vsnprintf_internal (vsnprintf.c:114)
==79945==    by 0x1654AE: std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > __gnu_cxx::__to_xstring<std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >, char>(int (*)(char*, unsigned long, char const*, __va_list_tag*), unsigned long, char const*, ...) (string_conversions.h:111)
==79945==    by 0x5126C65: to_string (basic_string.h:6568)
==79945==    by 0x5126C65: rocksdb::SerializeSingleOptionHelper(void const*, rocksdb::OptionType, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) (options_helper.cc:541)
==79945==    by 0x512718B: rocksdb::OptionTypeInfo::Serialize(rocksdb::ConfigOptions const&, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> > const&, void const*, std::__cxx11::basic_string<char, std::char_traits<char>, std::allocator<char> >*) const (options_helper.cc:1084)
```

This was due to `options_file_number` value not set in the unit test. However, this value is guaranteed to be set in the normal path. It was just missing in the test path. Setting the 0 as the default value for uninitialized fields in the `CompactionServiceInput` and `CompactionServiceResult` for now.

Pull Request resolved: https://github.com/facebook/rocksdb/pull/13080

Test Plan: Existing tests should be sufficient

Reviewed By: cbi42

Differential Revision: D64573567

Pulled By: jaykorean

fbshipit-source-id: 7843a951770c74445620623d069a52ba93ad94d5
2024-10-18 07:31:54 -07:00
..
clipping_iterator.h
clipping_iterator_test.cc
compaction.cc Refactor table_factory into MutableCFOptions (#13077) 2024-10-17 14:13:20 -07:00
compaction.h Fix a bug in ReFitLevel() where FileMetaData::being_compacted is not cleared (#13009) 2024-09-12 15:19:14 -07:00
compaction_iteration_stats.h
compaction_iterator.cc Add CompactForTieringCollector to support automatically trigger compaction for tiering use case (#12760) 2024-06-18 10:51:29 -07:00
compaction_iterator.h Add CompactForTieringCollector to support automatically trigger compaction for tiering use case (#12760) 2024-06-18 10:51:29 -07:00
compaction_iterator_test.cc Add CompactForTieringCollector to support automatically trigger compaction for tiering use case (#12760) 2024-06-18 10:51:29 -07:00
compaction_job.cc Refactor table_factory into MutableCFOptions (#13077) 2024-10-17 14:13:20 -07:00
compaction_job.h Fix Unit Test failing from uninit values in CompactionServiceInput (#13080) 2024-10-18 07:31:54 -07:00
compaction_job_stats_test.cc Replace ScopedArenaIterator with ScopedArenaPtr<InternalIterator> (#12470) 2024-03-22 13:40:42 -07:00
compaction_job_test.cc Refactor table_factory into MutableCFOptions (#13077) 2024-10-17 14:13:20 -07:00
compaction_outputs.cc Preserve TimedPut on penultimate level until it actually expires (#12543) 2024-04-30 11:16:02 -07:00
compaction_outputs.h Fix Compaction Stats (#13071) 2024-10-16 19:20:37 -07:00
compaction_picker.cc Fix a bug in ReFitLevel() where FileMetaData::being_compacted is not cleared (#13009) 2024-09-12 15:19:14 -07:00
compaction_picker.h Fix a bug in ReFitLevel() where FileMetaData::being_compacted is not cleared (#13009) 2024-09-12 15:19:14 -07:00
compaction_picker_fifo.cc Compact one file at a time for FIFO temperature change compactions (#13018) 2024-09-19 15:50:41 -07:00
compaction_picker_fifo.h Compact one file at a time for FIFO temperature change compactions (#13018) 2024-09-19 15:50:41 -07:00
compaction_picker_level.cc Use compensated file size for intra-L0 compaction (#12878) 2024-08-01 17:49:34 -07:00
compaction_picker_level.h
compaction_picker_test.cc Compact one file at a time for FIFO temperature change compactions (#13018) 2024-09-19 15:50:41 -07:00
compaction_picker_universal.cc Improve universal compaction sorted-run trigger (#12477) 2024-05-24 10:10:31 -07:00
compaction_picker_universal.h
compaction_service_job.cc Fix Compaction Stats (#13071) 2024-10-16 19:20:37 -07:00
compaction_service_test.cc Fix Compaction Stats (#13071) 2024-10-16 19:20:37 -07:00
compaction_state.cc Fix Compaction Stats (#13071) 2024-10-16 19:20:37 -07:00
compaction_state.h
file_pri.h
sst_partitioner.cc
subcompaction_state.cc Fix Compaction Stats (#13071) 2024-10-16 19:20:37 -07:00
subcompaction_state.h Fix Compaction Stats (#13071) 2024-10-16 19:20:37 -07:00
tiered_compaction_test.cc Fix a bug for surfacing write unix time (#13057) 2024-10-08 11:31:51 -07:00