Commit 82b3f1a8 authored by Vladislav Vaintroub's avatar Vladislav Vaintroub

MDEV-21930 RocksDB does not compile anymore, with Visual Studio

Update submodule, change the source file list
rename CACHE_LINE_SIZE in ut0counter, so it does not conflics with
rocksdb sources, which also defines this constant now.
parent ad6e421b
...@@ -60,10 +60,10 @@ if(BZIP2_FOUND AND (NOT WITH_ROCKSDB_BZIP2 STREQUAL "OFF")) ...@@ -60,10 +60,10 @@ if(BZIP2_FOUND AND (NOT WITH_ROCKSDB_BZIP2 STREQUAL "OFF"))
list(APPEND THIRDPARTY_LIBS ${BZIP2_LIBRARIES}) list(APPEND THIRDPARTY_LIBS ${BZIP2_LIBRARIES})
endif() endif()
if(SNAPPY_FOUND AND (NOT WITH_ROCKSDB_SNAPPY STREQUAL "OFF")) if(snappy_FOUND AND (NOT WITH_ROCKSDB_SNAPPY STREQUAL "OFF"))
add_definitions(-DSNAPPY) add_definitions(-DSNAPPY)
include_directories(${SNAPPY_INCLUDE_DIR}) include_directories(${snappy_INCLUDE_DIR})
list(APPEND THIRDPARTY_LIBS ${SNAPPY_LIBRARIES}) list(APPEND THIRDPARTY_LIBS ${snappy_LIBRARIES})
endif() endif()
include(CheckFunctionExists) include(CheckFunctionExists)
...@@ -189,31 +189,32 @@ set(ROCKSDB_SOURCES ...@@ -189,31 +189,32 @@ set(ROCKSDB_SOURCES
cache/clock_cache.cc cache/clock_cache.cc
cache/lru_cache.cc cache/lru_cache.cc
cache/sharded_cache.cc cache/sharded_cache.cc
db/arena_wrapped_db_iter.cc
db/builder.cc db/builder.cc
db/c.cc db/c.cc
db/column_family.cc db/column_family.cc
db/compacted_db_impl.cc db/compacted_db_impl.cc
db/compaction/compaction.cc db/compaction/compaction.cc
db/compaction/compaction_iterator.cc db/compaction/compaction_iterator.cc
db/compaction/compaction_job.cc
db/compaction/compaction_picker.cc db/compaction/compaction_picker.cc
db/compaction/compaction_job.cc
db/compaction/compaction_picker_fifo.cc db/compaction/compaction_picker_fifo.cc
db/compaction/compaction_picker_level.cc db/compaction/compaction_picker_level.cc
db/compaction/compaction_picker_universal.cc db/compaction/compaction_picker_universal.cc
db/convenience.cc db/convenience.cc
db/db_filesnapshot.cc db/db_filesnapshot.cc
db/dbformat.cc
db/db_impl/db_impl.cc db/db_impl/db_impl.cc
db/db_impl/db_impl_write.cc
db/db_impl/db_impl_compaction_flush.cc db/db_impl/db_impl_compaction_flush.cc
db/db_impl/db_impl_debug.cc
db/db_impl/db_impl_experimental.cc
db/db_impl/db_impl_files.cc db/db_impl/db_impl_files.cc
db/db_impl/db_impl_open.cc db/db_impl/db_impl_open.cc
db/db_impl/db_impl_debug.cc
db/db_impl/db_impl_experimental.cc
db/db_impl/db_impl_readonly.cc db/db_impl/db_impl_readonly.cc
db/db_impl/db_impl_secondary.cc db/db_impl/db_impl_secondary.cc
db/db_impl/db_impl_write.cc
db/db_info_dumper.cc db/db_info_dumper.cc
db/db_iter.cc db/db_iter.cc
db/dbformat.cc
db/error_handler.cc db/error_handler.cc
db/event_helpers.cc db/event_helpers.cc
db/experimental.cc db/experimental.cc
...@@ -222,9 +223,10 @@ set(ROCKSDB_SOURCES ...@@ -222,9 +223,10 @@ set(ROCKSDB_SOURCES
db/flush_job.cc db/flush_job.cc
db/flush_scheduler.cc db/flush_scheduler.cc
db/forward_iterator.cc db/forward_iterator.cc
db/import_column_family_job.cc
db/internal_stats.cc db/internal_stats.cc
db/log_reader.cc
db/logs_with_prep_tracker.cc db/logs_with_prep_tracker.cc
db/log_reader.cc
db/log_writer.cc db/log_writer.cc
db/malloc_stats.cc db/malloc_stats.cc
db/memtable.cc db/memtable.cc
...@@ -238,22 +240,31 @@ set(ROCKSDB_SOURCES ...@@ -238,22 +240,31 @@ set(ROCKSDB_SOURCES
db/table_cache.cc db/table_cache.cc
db/table_properties_collector.cc db/table_properties_collector.cc
db/transaction_log_impl.cc db/transaction_log_impl.cc
db/trim_history_scheduler.cc
db/version_builder.cc db/version_builder.cc
db/version_edit.cc db/version_edit.cc
db/version_set.cc db/version_set.cc
db/wal_manager.cc db/wal_manager.cc
db/write_batch_base.cc
db/write_batch.cc db/write_batch.cc
db/write_batch_base.cc
db/write_controller.cc db/write_controller.cc
db/write_thread.cc db/write_thread.cc
env/env.cc env/env.cc
env/env_chroot.cc env/env_chroot.cc
env/env_encryption.cc
env/env_hdfs.cc env/env_hdfs.cc
env/file_system.cc
env/mock_env.cc env/mock_env.cc
file/delete_scheduler.cc file/delete_scheduler.cc
file/filename.cc file/file_prefetch_buffer.cc
file/file_util.cc file/file_util.cc
file/filename.cc
file/random_access_file_reader.cc
file/read_write_util.cc
file/readahead_raf.cc
file/sequence_file_reader.cc
file/sst_file_manager_impl.cc file/sst_file_manager_impl.cc
file/writable_file_writer.cc
logging/auto_roll_logger.cc logging/auto_roll_logger.cc
logging/event_logger.cc logging/event_logger.cc
logging/log_buffer.cc logging/log_buffer.cc
...@@ -268,8 +279,8 @@ set(ROCKSDB_SOURCES ...@@ -268,8 +279,8 @@ set(ROCKSDB_SOURCES
memtable/write_buffer_manager.cc memtable/write_buffer_manager.cc
monitoring/histogram.cc monitoring/histogram.cc
monitoring/histogram_windowing.cc monitoring/histogram_windowing.cc
monitoring/instrumented_mutex.cc
monitoring/in_memory_stats_history.cc monitoring/in_memory_stats_history.cc
monitoring/instrumented_mutex.cc
monitoring/iostats_context.cc monitoring/iostats_context.cc
monitoring/perf_context.cc monitoring/perf_context.cc
monitoring/perf_level.cc monitoring/perf_level.cc
...@@ -277,7 +288,6 @@ set(ROCKSDB_SOURCES ...@@ -277,7 +288,6 @@ set(ROCKSDB_SOURCES
monitoring/statistics.cc monitoring/statistics.cc
monitoring/thread_status_impl.cc monitoring/thread_status_impl.cc
monitoring/thread_status_updater.cc monitoring/thread_status_updater.cc
monitoring/thread_status_updater_debug.cc
monitoring/thread_status_util.cc monitoring/thread_status_util.cc
monitoring/thread_status_util_debug.cc monitoring/thread_status_util_debug.cc
options/cf_options.cc options/cf_options.cc
...@@ -288,21 +298,24 @@ set(ROCKSDB_SOURCES ...@@ -288,21 +298,24 @@ set(ROCKSDB_SOURCES
options/options_sanity_check.cc options/options_sanity_check.cc
port/stack_trace.cc port/stack_trace.cc
table/adaptive/adaptive_table_factory.cc table/adaptive/adaptive_table_factory.cc
table/block_based/block.cc
table/block_based/block_based_filter_block.cc table/block_based/block_based_filter_block.cc
table/block_based/block_based_table_builder.cc table/block_based/block_based_table_builder.cc
table/block_based/block_based_table_factory.cc table/block_based/block_based_table_factory.cc
table/block_based/block_based_table_reader.cc table/block_based/block_based_table_reader.cc
table/block_based/block_builder.cc table/block_based/block_builder.cc
table/block_based/block.cc
table/block_based/block_prefix_index.cc table/block_based/block_prefix_index.cc
table/block_based/data_block_footer.cc
table/block_based/data_block_hash_index.cc table/block_based/data_block_hash_index.cc
table/block_based/data_block_footer.cc
table/block_based/filter_block_reader_common.cc
table/block_based/filter_policy.cc
table/block_based/flush_block_policy.cc table/block_based/flush_block_policy.cc
table/block_based/full_filter_block.cc table/block_based/full_filter_block.cc
table/block_based/index_builder.cc table/block_based/index_builder.cc
table/block_based/parsed_full_filter_block.cc
table/block_based/partitioned_filter_block.cc table/block_based/partitioned_filter_block.cc
table/block_based/uncompression_dict_reader.cc
table/block_fetcher.cc table/block_fetcher.cc
table/bloom_block.cc
table/cuckoo/cuckoo_table_builder.cc table/cuckoo/cuckoo_table_builder.cc
table/cuckoo/cuckoo_table_factory.cc table/cuckoo/cuckoo_table_factory.cc
table/cuckoo/cuckoo_table_reader.cc table/cuckoo/cuckoo_table_reader.cc
...@@ -312,6 +325,7 @@ set(ROCKSDB_SOURCES ...@@ -312,6 +325,7 @@ set(ROCKSDB_SOURCES
table/merging_iterator.cc table/merging_iterator.cc
table/meta_blocks.cc table/meta_blocks.cc
table/persistent_cache_helper.cc table/persistent_cache_helper.cc
table/plain/plain_table_bloom.cc
table/plain/plain_table_builder.cc table/plain/plain_table_builder.cc
table/plain/plain_table_factory.cc table/plain/plain_table_factory.cc
table/plain/plain_table_index.cc table/plain/plain_table_index.cc
...@@ -323,23 +337,34 @@ set(ROCKSDB_SOURCES ...@@ -323,23 +337,34 @@ set(ROCKSDB_SOURCES
table/two_level_iterator.cc table/two_level_iterator.cc
test_util/sync_point.cc test_util/sync_point.cc
test_util/sync_point_impl.cc test_util/sync_point_impl.cc
test_util/testutil.cc
test_util/transaction_test_util.cc
tools/block_cache_analyzer/block_cache_trace_analyzer.cc
tools/dump/db_dump_tool.cc
tools/ldb_cmd.cc tools/ldb_cmd.cc
tools/ldb_tool.cc tools/ldb_tool.cc
tools/sst_dump_tool.cc tools/sst_dump_tool.cc
trace_replay/block_cache_tracer.cc tools/trace_analyzer_tool.cc
trace_replay/trace_replay.cc trace_replay/trace_replay.cc
util/bloom.cc trace_replay/block_cache_tracer.cc
util/coding.cc util/coding.cc
util/compaction_job_stats_impl.cc util/compaction_job_stats_impl.cc
util/comparator.cc util/comparator.cc
util/compression_context_cache.cc util/compression_context_cache.cc
util/concurrent_task_limiter_impl.cc util/concurrent_task_limiter_impl.cc
util/crc32c_arm64.cc
util/crc32c.cc util/crc32c.cc
util/dynamic_bloom.cc util/dynamic_bloom.cc
util/file_reader_writer.cc
util/filter_policy.cc
util/hash.cc util/hash.cc
util/murmurhash.cc
util/random.cc
util/rate_limiter.cc
util/slice.cc
util/file_checksum_helper.cc
util/status.cc
util/string_util.cc
util/thread_local.cc
util/threadpool_imp.cc
util/xxhash.cc
utilities/backupable/backupable_db.cc utilities/backupable/backupable_db.cc
utilities/blob_db/blob_compaction_filter.cc utilities/blob_db/blob_compaction_filter.cc
utilities/blob_db/blob_db.cc utilities/blob_db/blob_db.cc
...@@ -347,12 +372,11 @@ set(ROCKSDB_SOURCES ...@@ -347,12 +372,11 @@ set(ROCKSDB_SOURCES
utilities/blob_db/blob_db_impl_filesnapshot.cc utilities/blob_db/blob_db_impl_filesnapshot.cc
utilities/blob_db/blob_dump_tool.cc utilities/blob_db/blob_dump_tool.cc
utilities/blob_db/blob_file.cc utilities/blob_db/blob_file.cc
utilities/blob_db/blob_log_format.cc
utilities/blob_db/blob_log_reader.cc utilities/blob_db/blob_log_reader.cc
utilities/blob_db/blob_log_writer.cc utilities/blob_db/blob_log_writer.cc
utilities/blob_db/blob_log_format.cc
utilities/checkpoint/checkpoint_impl.cc utilities/checkpoint/checkpoint_impl.cc
utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc utilities/compaction_filters/remove_emptyvalue_compactionfilter.cc
utilities/convenience/info_log_finder.cc
utilities/debug.cc utilities/debug.cc
utilities/env_mirror.cc utilities/env_mirror.cc
utilities/env_timed.cc utilities/env_timed.cc
...@@ -361,9 +385,11 @@ set(ROCKSDB_SOURCES ...@@ -361,9 +385,11 @@ set(ROCKSDB_SOURCES
utilities/merge_operators/bytesxor.cc utilities/merge_operators/bytesxor.cc
utilities/merge_operators/max.cc utilities/merge_operators/max.cc
utilities/merge_operators/put.cc utilities/merge_operators/put.cc
utilities/merge_operators/string_append/stringappend2.cc utilities/merge_operators/sortlist.cc
utilities/merge_operators/string_append/stringappend.cc utilities/merge_operators/string_append/stringappend.cc
utilities/merge_operators/string_append/stringappend2.cc
utilities/merge_operators/uint64add.cc utilities/merge_operators/uint64add.cc
utilities/object_registry.cc
utilities/option_change_migration/option_change_migration.cc utilities/option_change_migration/option_change_migration.cc
utilities/options/options_util.cc utilities/options/options_util.cc
utilities/persistent_cache/block_cache_tier.cc utilities/persistent_cache/block_cache_tier.cc
...@@ -371,11 +397,12 @@ set(ROCKSDB_SOURCES ...@@ -371,11 +397,12 @@ set(ROCKSDB_SOURCES
utilities/persistent_cache/block_cache_tier_metadata.cc utilities/persistent_cache/block_cache_tier_metadata.cc
utilities/persistent_cache/persistent_cache_tier.cc utilities/persistent_cache/persistent_cache_tier.cc
utilities/persistent_cache/volatile_tier_impl.cc utilities/persistent_cache/volatile_tier_impl.cc
utilities/simulator_cache/cache_simulator.cc
utilities/simulator_cache/sim_cache.cc utilities/simulator_cache/sim_cache.cc
utilities/table_properties_collectors/compact_on_deletion_collector.cc utilities/table_properties_collectors/compact_on_deletion_collector.cc
utilities/trace/file_trace_reader_writer.cc utilities/trace/file_trace_reader_writer.cc
utilities/transactions/optimistic_transaction.cc
utilities/transactions/optimistic_transaction_db_impl.cc utilities/transactions/optimistic_transaction_db_impl.cc
utilities/transactions/optimistic_transaction.cc
utilities/transactions/pessimistic_transaction.cc utilities/transactions/pessimistic_transaction.cc
utilities/transactions/pessimistic_transaction_db.cc utilities/transactions/pessimistic_transaction_db.cc
utilities/transactions/snapshot_checker.cc utilities/transactions/snapshot_checker.cc
...@@ -390,15 +417,6 @@ set(ROCKSDB_SOURCES ...@@ -390,15 +417,6 @@ set(ROCKSDB_SOURCES
utilities/ttl/db_ttl_impl.cc utilities/ttl/db_ttl_impl.cc
utilities/write_batch_with_index/write_batch_with_index.cc utilities/write_batch_with_index/write_batch_with_index.cc
utilities/write_batch_with_index/write_batch_with_index_internal.cc utilities/write_batch_with_index/write_batch_with_index_internal.cc
util/murmurhash.cc
util/random.cc
util/rate_limiter.cc
util/slice.cc
util/status.cc
util/string_util.cc
util/thread_local.cc
util/threadpool_imp.cc
util/xxhash.cc
) )
...@@ -415,7 +433,8 @@ else() ...@@ -415,7 +433,8 @@ else()
list(APPEND ROCKSDB_SOURCES list(APPEND ROCKSDB_SOURCES
port/port_posix.cc port/port_posix.cc
env/env_posix.cc env/env_posix.cc
env/io_posix.cc) env/io_posix.cc
env/fs_posix.cc)
# ppc64 or ppc64le # ppc64 or ppc64le
if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64") if(CMAKE_SYSTEM_PROCESSOR MATCHES "ppc64")
enable_language(ASM) enable_language(ASM)
......
...@@ -507,7 +507,7 @@ void Rdb_sst_info::set_error_msg(const std::string &sst_file_name, ...@@ -507,7 +507,7 @@ void Rdb_sst_info::set_error_msg(const std::string &sst_file_name,
void Rdb_sst_info::report_error_msg(const rocksdb::Status &s, void Rdb_sst_info::report_error_msg(const rocksdb::Status &s,
const char *sst_file_name) { const char *sst_file_name) {
if (s.IsInvalidArgument() && if (s.IsInvalidArgument() &&
strcmp(s.getState(), "Keys must be added in order") == 0) { strcmp(s.getState(), "Keys must be added in strict ascending order.") == 0) {
my_printf_error(ER_KEYS_OUT_OF_ORDER, my_printf_error(ER_KEYS_OUT_OF_ORDER,
"Rows must be inserted in primary key order " "Rows must be inserted in primary key order "
"during bulk load operation", "during bulk load operation",
......
Subproject commit e731f4402258554812c46334dc0d9483e6cc769b Subproject commit bba5e7bc21093d7cfa765e1280a7c4fdcd284288
...@@ -23,7 +23,7 @@ Created 2012/04/12 by Sunny Bains ...@@ -23,7 +23,7 @@ Created 2012/04/12 by Sunny Bains
#include <string.h> #include <string.h>
/** CPU cache line size */ /** CPU cache line size */
#define CACHE_LINE_SIZE 64 #define UT_CACHE_LINE_SIZE 64
/** Default number of slots to use in ib_counter_t */ /** Default number of slots to use in ib_counter_t */
#define IB_N_SLOTS 64 #define IB_N_SLOTS 64
...@@ -43,7 +43,7 @@ struct generic_indexer_t { ...@@ -43,7 +43,7 @@ struct generic_indexer_t {
/** @return offset within m_counter */ /** @return offset within m_counter */
size_t offset(size_t index) const { size_t offset(size_t index) const {
return(((index % N) + 1) * (CACHE_LINE_SIZE / sizeof(Type))); return(((index % N) + 1) * (UT_CACHE_LINE_SIZE / sizeof(Type)));
} }
}; };
...@@ -90,7 +90,7 @@ struct single_indexer_t { ...@@ -90,7 +90,7 @@ struct single_indexer_t {
/** @return offset within m_counter */ /** @return offset within m_counter */
size_t offset(size_t index) const { size_t offset(size_t index) const {
DBUG_ASSERT(N == 1); DBUG_ASSERT(N == 1);
return((CACHE_LINE_SIZE / sizeof(Type))); return((UT_CACHE_LINE_SIZE / sizeof(Type)));
} }
/* @return 1 */ /* @return 1 */
...@@ -103,7 +103,7 @@ struct single_indexer_t { ...@@ -103,7 +103,7 @@ struct single_indexer_t {
/** Class for using fuzzy counters. The counter is not protected by any /** Class for using fuzzy counters. The counter is not protected by any
mutex and the results are not guaranteed to be 100% accurate but close mutex and the results are not guaranteed to be 100% accurate but close
enough. Creates an array of counters and separates each element by the enough. Creates an array of counters and separates each element by the
CACHE_LINE_SIZE bytes */ UT_CACHE_LINE_SIZE bytes */
template < template <
typename Type, typename Type,
int N = IB_N_SLOTS, int N = IB_N_SLOTS,
...@@ -119,7 +119,7 @@ class ib_counter_t { ...@@ -119,7 +119,7 @@ class ib_counter_t {
bool validate() { bool validate() {
#ifdef UNIV_DEBUG #ifdef UNIV_DEBUG
size_t n = (CACHE_LINE_SIZE / sizeof(Type)); size_t n = (UT_CACHE_LINE_SIZE / sizeof(Type));
/* Check that we aren't writing outside our defined bounds. */ /* Check that we aren't writing outside our defined bounds. */
for (size_t i = 0; i < UT_ARRAY_SIZE(m_counter); i += n) { for (size_t i = 0; i < UT_ARRAY_SIZE(m_counter); i += n) {
...@@ -197,7 +197,7 @@ class ib_counter_t { ...@@ -197,7 +197,7 @@ class ib_counter_t {
Indexer<Type, N>m_policy; Indexer<Type, N>m_policy;
/** Slot 0 is unused. */ /** Slot 0 is unused. */
Type m_counter[(N + 1) * (CACHE_LINE_SIZE / sizeof(Type))]; Type m_counter[(N + 1) * (UT_CACHE_LINE_SIZE / sizeof(Type))];
}; };
#endif /* UT0COUNTER_H */ #endif /* UT0COUNTER_H */
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment