Skip to content

Commit

Permalink
MDEV-13585: RocksDB plugin fails to build on macOS because of unknown…
Browse files Browse the repository at this point in the history
… type `timer_t` etc.

Rdb_io_watchdog can not be built on  OS X. Disable it.
  • Loading branch information
varunraiko committed Sep 5, 2017
1 parent 4ae200a commit 80c9088
Show file tree
Hide file tree
Showing 4 changed files with 14 additions and 9 deletions.
9 changes: 7 additions & 2 deletions storage/rocksdb/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -146,7 +146,10 @@ ADD_CONVENIENCE_LIBRARY(rocksdb_aux_lib
ADD_DEPENDENCIES(rocksdb_aux_lib GenError)

# 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)

Expand Down Expand Up @@ -182,7 +185,9 @@ ENDIF()
# ADD_SUBDIRECTORY(unittest)
#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
rocksdb/tools/ldb_tool.cc
Expand Down
10 changes: 5 additions & 5 deletions storage/rocksdb/ha_rocksdb.cc
Original file line number Diff line number Diff line change
Expand Up @@ -173,7 +173,7 @@ Rdb_ddl_manager ddl_manager;
const char *m_mysql_gtid;
Rdb_binlog_manager binlog_manager;

#ifndef _WIN32
#if !defined(_WIN32) && !defined(__APPLE__)
Rdb_io_watchdog *io_watchdog = nullptr;
#endif
/**
Expand Down Expand Up @@ -554,7 +554,7 @@ static void rocksdb_set_io_write_timeout(
void *const var_ptr MY_ATTRIBUTE((__unused__)), const void *const save) {
DBUG_ASSERT(save != nullptr);
DBUG_ASSERT(rdb != nullptr);
#ifndef _WIN32
#if !defined(_WIN32) && !defined(__APPLE__)
DBUG_ASSERT(io_watchdog != nullptr);
#endif

Expand All @@ -563,7 +563,7 @@ static void rocksdb_set_io_write_timeout(
const uint32_t new_val = *static_cast<const uint32_t *>(save);

rocksdb_io_write_timeout_secs = new_val;
#ifndef _WIN32
#if !defined(_WIN32) && !defined(__APPLE__)
io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs);
#endif
RDB_MUTEX_UNLOCK_CHECK(rdb_sysvars_mutex);
Expand Down Expand Up @@ -3984,7 +3984,7 @@ static int rocksdb_init_func(void *const p) {
directories.push_back(myrocks::rocksdb_wal_dir);
}

#ifndef _WIN32
#if !defined(_WIN32) && !defined(__APPLE__)
io_watchdog = new Rdb_io_watchdog(directories);
io_watchdog->reset_timeout(rocksdb_io_write_timeout_secs);
#endif
Expand Down Expand Up @@ -4076,7 +4076,7 @@ static int rocksdb_done_func(void *const p) {
delete commit_latency_stats;
commit_latency_stats = nullptr;

#ifndef _WIN32
#if !defined(_WIN32) && !defined(__APPLE__)
delete io_watchdog;
io_watchdog = nullptr;
#endif
Expand Down
2 changes: 1 addition & 1 deletion storage/rocksdb/rdb_io_watchdog.cc
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@
#include <vector>

/* Rdb_io_watchdog doesn't work on Windows [yet] */
#ifndef _WIN32
#if !defined(_WIN32) && !defined(__APPLE__)

namespace myrocks {

Expand Down
2 changes: 1 addition & 1 deletion storage/rocksdb/rdb_io_watchdog.h
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
namespace myrocks {

// Rdb_io_watchdog does not support Windows ATM.
#ifndef _WIN32
#if !defined(_WIN32) && !defined(__APPLE__)

class Rdb_io_watchdog {
const int RDB_IO_WRITE_BUFFER_SIZE = 4096;
Expand Down

0 comments on commit 80c9088

Please sign in to comment.