diff --git a/db/compaction_picker.cc b/db/compaction_picker.cc index 284942117..9582b6a29 100644 --- a/db/compaction_picker.cc +++ b/db/compaction_picker.cc @@ -8,6 +8,8 @@ // found in the LICENSE file. See the AUTHORS file for names of contributors. #include "db/compaction_picker.h" + +#include #include "util/statistics.h" namespace rocksdb { diff --git a/db/db_bench.cc b/db/db_bench.cc index e41a31cf3..18258fbb6 100644 --- a/db/db_bench.cc +++ b/db/db_bench.cc @@ -21,6 +21,8 @@ #include "rocksdb/env.h" #include "rocksdb/memtablerep.h" #include "rocksdb/write_batch.h" +#include "rocksdb/slice.h" +#include "rocksdb/slice_transform.h" #include "rocksdb/statistics.h" #include "port/port.h" #include "util/bit_set.h" diff --git a/db/db_test.cc b/db/db_test.cc index 4fa5452c2..df1d0a5c2 100644 --- a/db/db_test.cc +++ b/db/db_test.cc @@ -21,6 +21,8 @@ #include "rocksdb/cache.h" #include "rocksdb/compaction_filter.h" #include "rocksdb/env.h" +#include "rocksdb/slice.h" +#include "rocksdb/slice_transform.h" #include "rocksdb/table.h" #include "util/hash.h" #include "util/logging.h" diff --git a/db/prefix_filter_iterator.h b/db/prefix_filter_iterator.h index f4488379c..e868c7a54 100644 --- a/db/prefix_filter_iterator.h +++ b/db/prefix_filter_iterator.h @@ -12,6 +12,8 @@ #pragma once #include "rocksdb/iterator.h" +#include "rocksdb/slice.h" +#include "rocksdb/slice_transform.h" namespace rocksdb { diff --git a/db/skiplist.h b/db/skiplist.h index 06a35d911..2c9c4a6de 100644 --- a/db/skiplist.h +++ b/db/skiplist.h @@ -35,6 +35,7 @@ #include #include "port/port.h" #include "util/random.h" +#include "rocksdb/arena.h" namespace rocksdb { diff --git a/db/tailing_iter.cc b/db/tailing_iter.cc index f448ac15d..5644b1211 100644 --- a/db/tailing_iter.cc +++ b/db/tailing_iter.cc @@ -8,6 +8,8 @@ #include #include #include "db/db_impl.h" +#include "rocksdb/slice.h" +#include "rocksdb/slice_transform.h" namespace rocksdb { diff --git a/db/version_set.cc b/db/version_set.cc index b8f87dc11..61fca24f2 100644 --- a/db/version_set.cc +++ b/db/version_set.cc @@ -1925,8 +1925,11 @@ Status VersionSet::ReduceNumberOfLevels(const std::string& dbname, } std::vector* old_files_list = current_version->files_; + // we need to allocate an array with the old number of levels size to + // avoid SIGSEGV in WriteSnapshot() + // however, all levels bigger or equal to new_levels will be empty std::vector* new_files_list = - new std::vector[new_levels]; + new std::vector[current_levels]; for (int i = 0; i < new_levels - 1; i++) { new_files_list[i] = old_files_list[i]; } diff --git a/include/rocksdb/memtablerep.h b/include/rocksdb/memtablerep.h index 2fca8d161..9e24942ac 100644 --- a/include/rocksdb/memtablerep.h +++ b/include/rocksdb/memtablerep.h @@ -37,12 +37,13 @@ #define STORAGE_ROCKSDB_DB_MEMTABLEREP_H_ #include -#include "rocksdb/arena.h" -#include "rocksdb/slice.h" -#include "rocksdb/slice_transform.h" namespace rocksdb { +class Arena; +class Slice; +class SliceTransform; + class MemTableRep { public: // KeyComparator provides a means to compare keys, which are internal keys diff --git a/include/rocksdb/options.h b/include/rocksdb/options.h index 76fdcc81e..00acafb0a 100644 --- a/include/rocksdb/options.h +++ b/include/rocksdb/options.h @@ -15,11 +15,6 @@ #include #include -#include "rocksdb/memtablerep.h" -#include "rocksdb/slice.h" -#include "rocksdb/slice_transform.h" -#include "rocksdb/statistics.h" -#include "rocksdb/table_properties.h" #include "rocksdb/universal_compaction.h" namespace rocksdb { @@ -34,6 +29,11 @@ class Logger; class MergeOperator; class Snapshot; class TableFactory; +class MemTableRepFactory; +class TablePropertiesCollector; +class Slice; +class SliceTransform; +class Statistics; using std::shared_ptr; diff --git a/include/rocksdb/universal_compaction.h b/include/rocksdb/universal_compaction.h index ec862b95f..eaf47e5c7 100644 --- a/include/rocksdb/universal_compaction.h +++ b/include/rocksdb/universal_compaction.h @@ -6,14 +6,8 @@ #ifndef STORAGE_ROCKSDB_UNIVERSAL_COMPACTION_OPTIONS_H #define STORAGE_ROCKSDB_UNIVERSAL_COMPACTION_OPTIONS_H -#include -#include -#include -#include #include #include -#include "rocksdb/slice.h" -#include "rocksdb/statistics.h" namespace rocksdb { diff --git a/tools/db_stress.cc b/tools/db_stress.cc index 8321c7eaf..bad2cf0d6 100644 --- a/tools/db_stress.cc +++ b/tools/db_stress.cc @@ -31,6 +31,8 @@ #include "utilities/utility_db.h" #include "rocksdb/env.h" #include "rocksdb/write_batch.h" +#include "rocksdb/slice.h" +#include "rocksdb/slice_transform.h" #include "rocksdb/statistics.h" #include "port/port.h" #include "util/coding.h" diff --git a/util/coding.cc b/util/coding.cc index ce67fa486..6cf67efad 100644 --- a/util/coding.cc +++ b/util/coding.cc @@ -9,6 +9,10 @@ #include "util/coding.h" +#include "rocksdb/slice.h" +#include "rocksdb/slice_transform.h" + + #include namespace rocksdb { diff --git a/util/coding.h b/util/coding.h index 4477dc799..c6a6b203d 100644 --- a/util/coding.h +++ b/util/coding.h @@ -16,6 +16,8 @@ #include #include #include + +#include "rocksdb/write_batch.h" #include "port/port.h" namespace rocksdb { diff --git a/util/options.cc b/util/options.cc index 96f86f5c6..e4a14c1da 100644 --- a/util/options.cc +++ b/util/options.cc @@ -17,6 +17,10 @@ #include "rocksdb/env.h" #include "rocksdb/filter_policy.h" #include "rocksdb/merge_operator.h" +#include "rocksdb/memtablerep.h" +#include "rocksdb/slice.h" +#include "rocksdb/slice_transform.h" +#include "rocksdb/table_properties.h" #include "table/block_based_table_factory.h" namespace rocksdb { diff --git a/utilities/backupable/backupable_db.cc b/utilities/backupable/backupable_db.cc index 26bdd254b..8e5ef5220 100644 --- a/utilities/backupable/backupable_db.cc +++ b/utilities/backupable/backupable_db.cc @@ -21,6 +21,7 @@ #include #include #include +#include namespace rocksdb {