Skip to content

Commit c4d9ae8

Browse files
committed
merge with PB-NVM
1 parent d4c5988 commit c4d9ae8

Some content is hidden

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

43 files changed

+9084
-86
lines changed

CMakeLists.txt

+6
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,12 @@
1313
# along with this program; if not, write to the Free Software
1414
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1515

16+
#tdnguyen added
17+
#SET (NVM_LIBS mytest)
18+
SET (NVM_LIB_PMEM pmem)
19+
SET (NVM_LIB_PMEMOBJ pmemobj)
20+
#end tdnguyen added
21+
1622
IF(WIN32)
1723
# CMake 2.8.12 is needed for Visual Studio 2013
1824
CMAKE_MINIMUM_REQUIRED(VERSION 2.8.12)

build_mysql.sh

+66
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,66 @@
1+
#!/bin/bash
2+
MYSQL_HOME=/home/vldb/mysql-pmem
3+
4+
#debug mode
5+
IS_DEBUG=0
6+
#IS_DEBUG=1
7+
8+
##The original InnoDB
9+
#BUILD_NAME="-DUNIV_TRACE_FLUSH_TIME"
10+
#BUILD_NAME="-DUNIV_PMEMOBJ_DBW -DUNIV_TRACE_FLUSH_TIME"
11+
#BUILD_NAME="-DUNIV_PMEMOBJ_WAL -DUNIV_TRACE_FLUSH_TIME"
12+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_RECOVERY -DUNIV_PMEMOBJ_BUF_STAT -DUNIV_TRACE_FLUSH_TIME"
13+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_RECOVERY -DUNIV_PMEMOBJ_BUF_PARTITION -DUNIV_PMEMOBJ_BUF_STAT -DUNIV_TRACE_FLUSH_TIME"
14+
#LSB
15+
BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_LSB -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_TRACE_FLUSH_TIME"
16+
#BUILD_NAME="-DUNIV_PMEMOBJ_WAL -DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_RECOVERY -DUNIV_PMEMOBJ_BUF_PARTITION -DUNIV_PMEMOBJ_BUF_STAT -DUNIV_TRACE_FLUSH_TIME"
17+
18+
#for LSB implementation
19+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_LSB -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_TRACE_FLUSH_TIME"
20+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_LSB -DUNIV_PMEMOBJ_LSB_DEBUG -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_TRACE_FLUSH_TIME"
21+
22+
#BUILD_NAME=-DUNIV_NVM_LOG
23+
#BUILD_NAME=-DUNIV_PMEMOBJ_LOG
24+
#BUILD_NAME="-DUNIV_NVM_LOG -DUNIV_PMEMOBJ_LOG"
25+
26+
## WAL is the new log optimization that integrate log buffer and log file into one place in NVM
27+
#BUILD_NAME="-DUNIV_PMEMOBJ_DBW -DUNIV_TRACE_FLUSH_TIME"
28+
#BUILD_NAME="-DUNIV_PMEMOBJ_WAL -DUNIV_TRACE_FLUSH_TIME"
29+
30+
##the stable version: use free pool, no flusher
31+
#BUILD_NAME=-DUNIV_PMEMOBJ_BUF
32+
33+
##UNIV_PMEMOBJ_BUF_STAT collect statistics information, can be used as additional with other PMEMOBJ_BUF_***
34+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_STAT"
35+
36+
##The UNIV_PMEMOBJ_BUF_V2 reused the UNIV_PMEMOBJ_BUF, just overwrite the pm_buf_write and pm_buf_handle_finished that does not use the free_pool
37+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_V2"
38+
39+
##PMEMOBJ_BUF_FLUSHER use pmem_n_flush_threads to handle aio_batch sothat the cleaner thread can return immediately
40+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER"
41+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_APPEND"
42+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_PARTITION"
43+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_PARTITION -DUNIV_PMEMOBJ_BUF_PARTITION_STAT"
44+
45+
## For EVEN
46+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_RECOVERY"
47+
##Use this for statistic information, n_writes, n_overwrites, n_reads, n_reads_hit, n_reads_flushing, ...
48+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_RECOVERY -DUNIV_PMEMOBJ_BUF_STAT -DUNIV_TRACE_FLUSH_TIME"
49+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_RECOVERY -DUNIV_PMEMOBJ_BUF_STAT -DUNIV_TRACE_FLUSH_TIME -DUNIV_PMEMOBJ_BUF_RECOVERY_DEBUG"
50+
51+
## For SINGLE and LESS
52+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_RECOVERY -DUNIV_PMEMOBJ_BUF_PARTITION -DUNIV_PMEMOBJ_BUF_STAT -DUNIV_TRACE_FLUSH_TIME"
53+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_RECOVERY -DUNIV_PMEMOBJ_BUF_PARTITION -DUNIV_TRACE_FLUSH_TIME"
54+
#BUILD_NAME="-DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_RECOVERY -DUNIV_PMEMOBJ_BUF_PARTITION -DUNIV_PMEMOBJ_BUF_STAT -DUNIV_TRACE_FLUSH_TIME -DUNIV_PMEMOBJ_BUF_RECOVERY_DEBUG"
55+
56+
##combine all
57+
#BUILD_NAME="-DUNIV_NVM_LOG -DUNIV_PMEMOBJ_LOG -DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER"
58+
#BUILD_NAME="-DUNIV_PMEMOBJ_WAL -DUNIV_PMEMOBJ_BUF -DUNIV_PMEMOBJ_BUF_FLUSHER -DUNIV_PMEMOBJ_BUF_RECOVERY -DUNIV_PMEMOBJ_BUF_PARTITION -DUNIV_PMEMOBJ_BUF_STAT -DUNIV_TRACE_FLUSH_TIME"
59+
60+
61+
62+
63+
echo "BUILD MODE: $BUILD_NAME with debug=$IS_DEBUG"
64+
cd $MYSQL_HOME/bld
65+
cmake .. -DWITH_DEBUG=$IS_DEBUG -DCMAKE_C_FLAGS="$BUILD_NAME -DUNIV_AIO_IMPROVE" -DCMAKE_CXX_FLAGS="$BUILD_NAME -DUNIV_AIO_IMPROVE" -DDOWNLOAD_BOOST=1 -DWITH_BOOST=/root/boost
66+
make install -j48

client/dump/CMakeLists.txt

+1
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,7 @@ SET(MYSQLPUMP_LIB_SOURCES
141141
../../sql-common/my_user.c)
142142
ADD_CONVENIENCE_LIBRARY(mysqlpump_lib ${MYSQLPUMP_LIB_SOURCES})
143143
TARGET_LINK_LIBRARIES(mysqlpump_lib
144+
# client_base ${LZ4_LIBRARY} ${NVM_LIB_PMEM} ${NVM_LIB_PMEMOBJ})
144145
client_base ${LZ4_LIBRARY})
145146

146147
ADD_COMPILE_FLAGS(

libmysqld/examples/CMakeLists.txt

+14-3
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,12 @@ ADD_DEFINITIONS(-DEMBEDDED_LIBRARY -UMYSQL_CLIENT)
2626

2727
MYSQL_ADD_EXECUTABLE(mysql_embedded ../../client/completion_hash.cc
2828
../../client/mysql.cc ../../client/readline.cc)
29-
TARGET_LINK_LIBRARIES(mysql_embedded mysqlserver)
29+
#tdnguyen added
30+
#TARGET_LINK_LIBRARIES(mysql_embedded mysqlserver)
31+
TARGET_LINK_LIBRARIES(mysql_embedded mysqlserver ${NVM_LIB_PMEMOBJ} ${NVM_LIB_PMEM} )
32+
#TARGET_LINK_LIBRARIES(mysql_embedded mysqlserver ${NVM_LIB_PMEM})
33+
#end tdnguyen added
34+
3035
IF(UNIX)
3136
TARGET_LINK_LIBRARIES(mysql_embedded ${EDITLINE_LIBRARY})
3237
SET_TARGET_PROPERTIES(mysql_embedded PROPERTIES ENABLE_EXPORTS TRUE)
@@ -44,7 +49,10 @@ ENDIF()
4449

4550

4651
MYSQL_ADD_EXECUTABLE(mysqltest_embedded ../../client/mysqltest.cc)
47-
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver)
52+
#tdnguyen added
53+
#TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver)
54+
TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver ${NVM_LIB_PMEMOBJ} ${NVM_LIB_PMEM} )
55+
#TARGET_LINK_LIBRARIES(mysqltest_embedded mysqlserver ${NVM_LIB_PMEM})
4856

4957

5058
IF(CMAKE_GENERATOR MATCHES "Xcode")
@@ -70,7 +78,10 @@ ELSE()
7078
ENDIF()
7179
ENDIF()
7280
IF(NOT INSTALL_LAYOUT MATCHES "SVR4")
73-
TARGET_LINK_LIBRARIES(mysql_client_test_embedded mysqlserver)
81+
#tdnguyen added
82+
#TARGET_LINK_LIBRARIES(mysql_client_test_embedded mysqlserver)
83+
TARGET_LINK_LIBRARIES(mysql_client_test_embedded mysqlserver ${NVM_LIB_PMEMOBJ} ${NVM_LIB_PMEM} )
84+
#TARGET_LINK_LIBRARIES(mysql_client_test_embedded mysqlserver ${NVM_LIB_PMEM})
7485
ENDIF()
7586

7687
IF(UNIX)

rapid/plugin/x/CMakeLists.txt

+3-1
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ ELSE()
145145
MODULE_ONLY MODULE_OUTPUT_NAME "mysqlx")
146146

147147
IF(WITH_PROTOBUF STREQUAL "system")
148-
TARGET_LINK_LIBRARIES(mysqlx "${PROTOBUF_LIBRARY}")
148+
TARGET_LINK_LIBRARIES(mysqlx "${PROTOBUF_LIBRARY}")
149+
# TARGET_LINK_LIBRARIES(mysqlx "${PROTOBUF_LIBRARY}" ${NVM_LIB_PMEM} ${NVM_LIB_PMEMOBJ})
149150
ENDIF()
150151

151152
ADD_DEPENDENCIES(mysqlx GenError)
@@ -216,6 +217,7 @@ ELSE()
216217

217218
TARGET_LINK_LIBRARIES(mysqlxtest mysys strings mysqlclient)
218219
TARGET_LINK_LIBRARIES(mysqlxtest ${PROTOBUF_LIBRARY})
220+
# TARGET_LINK_LIBRARIES(mysqlxtest ${PROTOBUF_LIBRARY} ${NVM_LIB_PMEM} ${NVM_LIB_PMEMOBJ})
219221

220222
IF( WIN32 )
221223
ADD_DEFINITIONS(-DMYSQLXTEST_EXPORTS)

sql/CMakeLists.txt

+10-1
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@
1414
# Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301 USA
1515

1616

17+
1718
INCLUDE_DIRECTORIES(
1819
${CMAKE_SOURCE_DIR}/include
1920
${CMAKE_SOURCE_DIR}/sql/conn_handler
@@ -381,10 +382,18 @@ ADD_DEPENDENCIES(sql GenDigestServerSource)
381382
ADD_DEPENDENCIES(sql GenBootstrapPriv)
382383
ADD_DEPENDENCIES(sql GenSysSchema)
383384
DTRACE_INSTRUMENT(sql)
385+
386+
#TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
387+
# mysys mysys_ssl dbug strings vio regex binlogevents_static
388+
# ${LIBWRAP} ${LIBCRYPT} ${LIBDL}
389+
# ${SSL_LIBRARIES})
390+
391+
#tdnguyen
384392
TARGET_LINK_LIBRARIES(sql ${MYSQLD_STATIC_PLUGIN_LIBS}
385393
mysys mysys_ssl dbug strings vio regex binlogevents_static
386394
${LIBWRAP} ${LIBCRYPT} ${LIBDL}
387-
${SSL_LIBRARIES})
395+
#${SSL_LIBRARIES} ${NVM_LIB_PMEM})
396+
${SSL_LIBRARIES} ${NVM_LIB_PMEMOBJ} ${NVM_LIB_PMEM} )
388397

389398
#
390399
# On Windows platform we compile in the clinet-side Windows Native Authentication

storage/innobase/CMakeLists.txt

+5
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,13 @@
1616
# This is the CMakeLists for InnoDB
1717

1818
INCLUDE(innodb.cmake)
19+
#tdnguyen add pmem dir and files
1920

2021
SET(INNOBASE_SOURCES
22+
pmem/pmem0wrapper.cc
23+
pmem/pmem0buf.cc
24+
pmem/pmem0logbuf.cc
25+
pmem/pmem0dbw.cc
2126
api/api0api.cc
2227
api/api0misc.cc
2328
btr/btr0btr.cc

storage/innobase/btr/btr0cur.cc

+3
Original file line numberDiff line numberDiff line change
@@ -348,8 +348,11 @@ btr_cur_latch_leaves(
348348
#ifdef UNIV_BTR_DEBUG
349349
ut_a(page_is_comp(get_block->frame)
350350
== page_is_comp(page));
351+
#if defined (UNIV_PMEMOBJ_BUF)
352+
#else
351353
ut_a(btr_page_get_prev(get_block->frame, mtr)
352354
== page_get_page_no(page));
355+
#endif //UNIV_PMEMOBJ_BUF
353356
#endif /* UNIV_BTR_DEBUG */
354357
if (spatial) {
355358
cursor->rtr_info->tree_blocks[

storage/innobase/buf/buf0buf.cc

+12-3
Original file line numberDiff line numberDiff line change
@@ -4194,9 +4194,12 @@ buf_page_get_gen(
41944194
}
41954195

41964196
if (buf_read_page(page_id, page_size)) {
4197+
#if defined(UNIV_PMEMOBJ_BUF)
4198+
//for pmem buf, we don't need to read-ahead
4199+
#else //original
41974200
buf_read_ahead_random(page_id, page_size,
41984201
ibuf_inside(mtr));
4199-
4202+
#endif /* UNIV_PMEMOBJ_BUF */
42004203
retries = 0;
42014204
} else if (retries < BUF_PAGE_READ_MAX_RETRIES) {
42024205
++retries;
@@ -5138,13 +5141,17 @@ buf_page_init_for_read(
51385141
} else {
51395142
ut_ad(mode == BUF_READ_ANY_PAGE);
51405143
}
5141-
51425144
if (page_size.is_compressed() && !unzip && !recv_recovery_is_on()) {
51435145
block = NULL;
51445146
} else {
5147+
//tdnguyen test
5148+
//printf ("\n[begin buf_LRU_get_free_block");
5149+
51455150
block = buf_LRU_get_free_block(buf_pool);
5151+
//printf (" end buf_LRU_get_free_block]");
51465152
ut_ad(block);
51475153
ut_ad(buf_pool_from_block(block) == buf_pool);
5154+
51485155
}
51495156

51505157
buf_pool_mutex_enter(buf_pool);
@@ -5166,7 +5173,6 @@ buf_page_init_for_read(
51665173
bpage = NULL;
51675174
goto func_exit;
51685175
}
5169-
51705176
if (block) {
51715177
bpage = &block->page;
51725178

@@ -5709,6 +5715,9 @@ buf_page_io_complete(
57095715
"the page, read in are "
57105716
<< page_id_t(read_space_id, read_page_no)
57115717
<< ", should be " << bpage->id;
5718+
#if defined (UNIV_PMEMOBJ_BUF)
5719+
return 0;
5720+
#endif
57125721
}
57135722

57145723
compressed_page = Compression::is_compressed_page(frame);

0 commit comments

Comments
 (0)