Commit 80c90887 authored by Varun Gupta's avatar Varun Gupta

MDEV-13585: RocksDB plugin fails to build on macOS because of unknown type `timer_t` etc.

Rdb_io_watchdog can not be built on  OS X. Disable it.
parent 4ae200a9
...@@ -146,7 +146,10 @@ ADD_CONVENIENCE_LIBRARY(rocksdb_aux_lib ...@@ -146,7 +146,10 @@ ADD_CONVENIENCE_LIBRARY(rocksdb_aux_lib
ADD_DEPENDENCIES(rocksdb_aux_lib GenError) ADD_DEPENDENCIES(rocksdb_aux_lib GenError)
# MARIAROCKS-TODO: how to properly depend on -lrt ? # MARIAROCKS-TODO: how to properly depend on -lrt ?
TARGET_LINK_LIBRARIES(rocksdb_aux_lib rocksdblib ${ZLIB_LIBRARY} -lrt) TARGET_LINK_LIBRARIES(rocksdb_aux_lib rocksdblib ${ZLIB_LIBRARY})
if (UNIX AND NOT APPLE)
TARGET_LINK_LIBRARIES(rocksdb_aux_lib -lrt)
endif()
TARGET_LINK_LIBRARIES(rocksdb rocksdb_aux_lib) TARGET_LINK_LIBRARIES(rocksdb rocksdb_aux_lib)
...@@ -182,7 +185,9 @@ ENDIF() ...@@ -182,7 +185,9 @@ ENDIF()
# ADD_SUBDIRECTORY(unittest) # ADD_SUBDIRECTORY(unittest)
#ENDIF() #ENDIF()
SET(rocksdb_static_libs ${rocksdb_static_libs} "-lrt") if (UNIX AND NOT APPLE)
SET(rocksdb_static_libs ${rocksdb_static_libs} "-lrt")
endif()
ADD_LIBRARY(rocksdb_tools STATIC ADD_LIBRARY(rocksdb_tools STATIC
rocksdb/tools/ldb_tool.cc rocksdb/tools/ldb_tool.cc
......
...@@ -173,7 +173,7 @@ Rdb_ddl_manager ddl_manager; ...@@ -173,7 +173,7 @@ Rdb_ddl_manager ddl_manager;
const char *m_mysql_gtid; const char *m_mysql_gtid;
Rdb_binlog_manager binlog_manager; Rdb_binlog_manager binlog_manager;
#ifndef _WIN32 #if !defined(_WIN32) && !defined(__APPLE__)
Rdb_io_watchdog *io_watchdog = nullptr; Rdb_io_watchdog *io_watchdog = nullptr;
#endif #endif
/** /**
...@@ -554,7 +554,7 @@ static void rocksdb_set_io_write_timeout( ...@@ -554,7 +554,7 @@ static void rocksdb_set_io_write_timeout(
void *const var_ptr MY_ATTRIBUTE((__unused__)), const void *const save) { void *const var_ptr MY_ATTRIBUTE((__unused__)), const void *const save) {
DBUG_ASSERT(save != nullptr); DBUG_ASSERT(save != nullptr);
DBUG_ASSERT(rdb != nullptr); DBUG_ASSERT(rdb != nullptr);
#ifndef _WIN32 #if !defined(_WIN32) && !defined(__APPLE__)
DBUG_ASSERT(io_watchdog != nullptr); DBUG_ASSERT(io_watchdog != nullptr);
#endif #endif
...@@ -563,7 +563,7 @@ static void rocksdb_set_io_write_timeout( ...@@ -563,7 +563,7 @@ static void rocksdb_set_io_write_timeout(
const uint32_t new_val = *static_cast<const uint32_t *>(save); const uint32_t new_val = *static_cast<const uint32_t *>(save);
rocksdb_io_write_timeout_secs = new_val; rocksdb_io_write_timeout_secs = new_val;
#ifndef _WIN32 #if !defined(_WIN32) && !defined(__APPLE__)
io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs); io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs);
#endif #endif
RDB_MUTEX_UNLOCK_CHECK(rdb_sysvars_mutex); RDB_MUTEX_UNLOCK_CHECK(rdb_sysvars_mutex);
...@@ -3984,7 +3984,7 @@ static int rocksdb_init_func(void *const p) { ...@@ -3984,7 +3984,7 @@ static int rocksdb_init_func(void *const p) {
directories.push_back(myrocks::rocksdb_wal_dir); directories.push_back(myrocks::rocksdb_wal_dir);
} }
#ifndef _WIN32 #if !defined(_WIN32) && !defined(__APPLE__)
io_watchdog = new Rdb_io_watchdog(directories); io_watchdog = new Rdb_io_watchdog(directories);
io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs); io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs);
#endif #endif
...@@ -4076,7 +4076,7 @@ static int rocksdb_done_func(void *const p) { ...@@ -4076,7 +4076,7 @@ static int rocksdb_done_func(void *const p) {
delete commit_latency_stats; delete commit_latency_stats;
commit_latency_stats = nullptr; commit_latency_stats = nullptr;
#ifndef _WIN32 #if !defined(_WIN32) && !defined(__APPLE__)
delete io_watchdog; delete io_watchdog;
io_watchdog = nullptr; io_watchdog = nullptr;
#endif #endif
......
...@@ -22,7 +22,7 @@ ...@@ -22,7 +22,7 @@
#include <vector> #include <vector>
/* Rdb_io_watchdog doesn't work on Windows [yet] */ /* Rdb_io_watchdog doesn't work on Windows [yet] */
#ifndef _WIN32 #if !defined(_WIN32) && !defined(__APPLE__)
namespace myrocks { namespace myrocks {
......
...@@ -35,7 +35,7 @@ ...@@ -35,7 +35,7 @@
namespace myrocks { namespace myrocks {
// Rdb_io_watchdog does not support Windows ATM. // Rdb_io_watchdog does not support Windows ATM.
#ifndef _WIN32 #if !defined(_WIN32) && !defined(__APPLE__)
class Rdb_io_watchdog { class Rdb_io_watchdog {
const int RDB_IO_WRITE_BUFFER_SIZE = 4096; const int RDB_IO_WRITE_BUFFER_SIZE = 4096;
......
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