Skip to content

Commit 43d5edf

Browse files
committed
Copy of
commit 394d0712d3d46a87a8063e14e998e9c22336e3a6 Author: Anca Agape <anca@fb.com> Date: Thu Jul 27 15:43:07 2017 -0700 Fix rpl.rpl_4threads_deadlock test broken by D5005670 Summary: In D5005670 in fill_fields_processlist() function we introduced a point where we were trying to take the LOCK_thd_data before the synchronization point used by test processlist_after_LOCK_thd_count_before_LOCK_thd_data. This was happening in get_attached_srv_session() function called. Replaced this with get_attached_srv_session_safe() and moved it after lock is aquired. Reviewed By: tianx Differential Revision: D5505992 fbshipit-source-id: bc53924
1 parent 65d01da commit 43d5edf

File tree

302 files changed

+13809
-2683
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

302 files changed

+13809
-2683
lines changed

storage/rocksdb/CMakeLists.txt

Lines changed: 35 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@ ENDIF()
66

77
CHECK_FUNCTION_EXISTS(sched_getcpu HAVE_SCHED_GETCPU)
88
IF(HAVE_SCHED_GETCPU)
9-
ADD_DEFINITIONS(-DHAVE_SCHED_GETCPU=1)
9+
ADD_DEFINITIONS(-DHAVE_SCHED_GETCPU=1 -DROCKSDB_SCHED_GETCPU_PRESENT)
1010
ENDIF()
1111

1212
# get a list of rocksdb library source files
@@ -25,14 +25,34 @@ INCLUDE_DIRECTORIES(
2525
${CMAKE_SOURCE_DIR}/rocksdb/third-party/gtest-1.7.0/fused-src
2626
)
2727

28-
ADD_DEFINITIONS(-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX -DOS_LINUX
29-
-DZLIB)
28+
# This is a strong requirement coming from RocksDB. No conditional checks here.
29+
ADD_DEFINITIONS(-DROCKSDB_PLATFORM_POSIX -DROCKSDB_LIB_IO_POSIX)
3030

31-
CHECK_FUNCTION_EXISTS(fallocate HAVE_FALLOCATE)
32-
IF(HAVE_FALLOCATE)
33-
ADD_DEFINITIONS(-DROCKSDB_FALLOCATE_PRESENT)
31+
IF(UNIX)
32+
IF(CMAKE_SYSTEM_NAME STREQUAL "Linux")
33+
ADD_DEFINITIONS(-DOS_LINUX)
34+
35+
CHECK_INCLUDE_FILES(linux/falloc.h HAVE_LINUX_FALLOC_H)
36+
CHECK_FUNCTION_EXISTS(fallocate HAVE_FALLOCATE)
37+
38+
IF(HAVE_FALLOCATE AND HAVE_LINUX_FALLOC_H)
39+
ADD_DEFINITIONS(-DROCKSDB_FALLOCATE_PRESENT)
40+
ENDIF()
41+
ENDIF()
3442
ENDIF()
3543

44+
CHECK_CXX_SOURCE_COMPILES("
45+
#if defined(_MSC_VER) && !defined(__thread)
46+
#define __thread __declspec(thread)
47+
#endif
48+
int main() {
49+
static __thread int tls;
50+
}
51+
" HAVE_THREAD_LOCAL)
52+
if(HAVE_THREAD_LOCAL)
53+
ADD_DEFINITIONS(-DROCKSDB_SUPPORT_THREAD_LOCAL)
54+
endif()
55+
3656
SET(ROCKSDB_SOURCES
3757
ha_rocksdb.cc ha_rocksdb.h ha_rocksdb_proto.h
3858
logger.h
@@ -44,6 +64,7 @@ SET(ROCKSDB_SOURCES
4464
event_listener.cc event_listener.h
4565
rdb_i_s.cc rdb_i_s.h
4666
rdb_index_merge.cc rdb_index_merge.h
67+
rdb_io_watchdog.cc rdb_io_watchdog.h
4768
rdb_perf_context.cc rdb_perf_context.h
4869
rdb_mutex_wrapper.cc rdb_mutex_wrapper.h
4970
rdb_psi.h rdb_psi.cc
@@ -85,7 +106,14 @@ IF (NOT "$ENV{WITH_ZSTD}" STREQUAL "")
85106
ADD_DEFINITIONS(-DZSTD)
86107
ENDIF()
87108

88-
SET(rocksdb_static_libs ${rocksdb_static_libs} ${ZLIB_LIBRARY} "-lrt")
109+
CHECK_INCLUDE_FILES(zlib.h HAVE_ZLIB_H)
110+
111+
IF (HAVE_ZLIB_H)
112+
ADD_DEFINITIONS(-DZLIB)
113+
SET(rocksdb_static_libs ${rocksdb_static_libs} ${ZLIB_LIBRARY})
114+
ENDIF()
115+
116+
SET(rocksdb_static_libs ${rocksdb_static_libs} "-lrt")
89117

90118
MYSQL_ADD_PLUGIN(rocksdb_se ${ROCKSDB_SOURCES} STORAGE_ENGINE DEFAULT STATIC_ONLY
91119
LINK_LIBRARIES ${rocksdb_static_libs}

storage/rocksdb/README

Lines changed: 18 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,20 @@
11
== Summary ==
2-
This directory contains RocksDB-based Storage Engine (RDBSE) for MySQL = "MyRocks".
2+
This directory contains RocksDB-based Storage Engine (RDBSE) for MySQL,
3+
also known as "MyRocks".
34

45
== Resources ==
5-
See https://github.com/facebook/mysql-5.6/wiki/Getting-Started-with-MyRocks
6-
Facebook group: https://www.facebook.com/groups/mysqlonrocksdb/
6+
https://github.com/facebook/mysql-5.6/wiki/Getting-Started-with-MyRocks
7+
https://www.facebook.com/groups/MyRocks/
78

89
== Coding Conventions ==
9-
The baseline for MyRocks coding conventions is the MySQL set, available at
10+
The baseline for MyRocks coding conventions for the code in storage/rocksdb/
11+
is based on the default clang format with a few minor changes. The file
12+
storage/rocksdb/.clang-format describes conventions and can be integrated
13+
with Vim or Emacs as described here:
14+
http://releases.llvm.org/3.6.0/tools/clang/docs/ClangFormat.html#vim-integration
15+
16+
All code outside of storage/rocksdb/ should conform to the MySQL coding
17+
conventions:
1018
http://dev.mysql.com/doc/internals/en/coding-guidelines.html.
1119

1220
Several refinements:
@@ -34,5 +42,9 @@ Several refinements:
3442
"_vect" for a std::vector etc.
3543

3644
== Running Tests ==
37-
To run tests from rocksdb, rocksd_rpl or rocksdb_sys_vars packages, use the following parameters:
38-
--mysqld=--default-storage-engine=rocksdb --mysqld=--skip-innodb --mysqld=--default-tmp-storage-engine=MyISAM --mysqld=--rocksdb
45+
To run tests from rocksdb, rocksdb_rpl or other rocksdb_* packages, use the
46+
following parameters:
47+
--default-storage-engine=rocksdb
48+
--skip-innodb
49+
--default-tmp-storage-engine=MyISAM
50+
--rocksdb

0 commit comments

Comments
 (0)