Skip to content

Commit ca95cc6

Browse files
committed
Merge branch 'merge-tokudb-5.6' into 10.0-tokudb-merge
5.6.28-76.1
2 parents 77b5484 + 9a957a5 commit ca95cc6

File tree

217 files changed

+16688
-6169
lines changed

Some content is hidden

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

217 files changed

+16688
-6169
lines changed

storage/tokudb/CMakeLists.txt

Lines changed: 22 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SET(TOKUDB_VERSION 5.6.26-74.0)
1+
SET(TOKUDB_VERSION 5.6.28-76.1)
22
# PerconaFT only supports x86-64 and cmake-2.8.9+
33
IF(CMAKE_VERSION VERSION_LESS "2.8.9")
44
MESSAGE(STATUS "CMake 2.8.9 or higher is required by TokuDB")
@@ -45,10 +45,25 @@ MARK_AS_ADVANCED(gcc_ar)
4545
MARK_AS_ADVANCED(gcc_ranlib)
4646
############################################
4747

48+
## adds a compiler flag if the compiler supports it
49+
include(CheckCCompilerFlag)
50+
include(CheckCXXCompilerFlag)
51+
52+
# pick language dialect
53+
check_cxx_compiler_flag(-std=c++11 HAVE_STDCXX11)
54+
if (HAVE_STDCXX11)
55+
set(CMAKE_CXX_FLAGS "-std=c++11 ${CMAKE_CXX_FLAGS}")
56+
else ()
57+
message(FATAL_ERROR "${CMAKE_CXX_COMPILER} doesn't support -std=c++11, you need one that does.")
58+
endif ()
59+
4860
SET(BUILD_TESTING OFF CACHE BOOL "")
4961
SET(USE_VALGRIND OFF CACHE BOOL "")
5062
SET(TOKU_DEBUG_PARANOID OFF CACHE BOOL "")
5163

64+
# Enable TokuDB's TOKUDB_DEBUG in debug builds
65+
SET(CMAKE_CXX_FLAGS_DEBUG "${CMAKE_CXX_FLAGS_DEBUG} -DTOKUDB_DEBUG")
66+
5267
IF(NOT DEFINED TOKUDB_VERSION)
5368
IF(DEFINED ENV{TOKUDB_VERSION})
5469
SET(TOKUDB_VERSION $ENV{TOKUDB_VERSION})
@@ -71,10 +86,6 @@ IF(DEFINED TOKUDB_CHECK_JEMALLOC)
7186
ADD_DEFINITIONS("-DTOKUDB_CHECK_JEMALLOC=${TOKUDB_CHECK_JEMALLOC}")
7287
ENDIF()
7388

74-
## adds a compiler flag if the compiler supports it
75-
include(CheckCCompilerFlag)
76-
include(CheckCXXCompilerFlag)
77-
7889
macro(set_cflags_if_supported)
7990
foreach(flag ${ARGN})
8091
string(REGEX REPLACE "-" "_" temp_flag ${flag})
@@ -128,7 +139,12 @@ INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/${TOKU_FT_DIR_NAME}/buildheader)
128139
INCLUDE_DIRECTORIES(${CMAKE_CURRENT_BINARY_DIR}/${TOKU_FT_DIR_NAME}/portability)
129140

130141
SET(TOKUDB_PLUGIN_DYNAMIC "ha_tokudb")
131-
SET(TOKUDB_SOURCES ha_tokudb.cc)
142+
SET(TOKUDB_SOURCES
143+
ha_tokudb.cc
144+
tokudb_background.cc
145+
tokudb_information_schema.cc
146+
tokudb_sysvars.cc
147+
tokudb_thread.cc)
132148
MYSQL_ADD_PLUGIN(tokudb ${TOKUDB_SOURCES} STORAGE_ENGINE MODULE_ONLY
133149
LINK_LIBRARIES tokufractaltree_static tokuportability_static ${ZLIB_LIBRARY} stdc++)
134150
SET(CMAKE_MODULE_LINKER_FLAGS_RELEASE "${CMAKE_MODULE_LINKER_FLAGS_RELEASE} -flto -fuse-linker-plugin")

storage/tokudb/PerconaFT/CMakeLists.txt

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
if (CMAKE_PROJECT_NAME STREQUAL TokuDB)
2+
cmake_minimum_required(VERSION 2.8.8 FATAL_ERROR)
3+
endif()
14
set(CMAKE_MODULE_PATH "${CMAKE_CURRENT_SOURCE_DIR}/cmake_modules")
25

36
project(TokuDB)

storage/tokudb/PerconaFT/README.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -113,11 +113,11 @@ All source code and test contributions must be provided under a [BSD 2-Clause][b
113113
License
114114
-------
115115

116-
PerconaFT is available under the GPL version 2, and AGPL version 3, with slight modifications.
116+
PerconaFT is available under the GPL version 2, and AGPL version 3.
117117
See [COPYING.AGPLv3][agpllicense],
118118
[COPYING.GPLv2][gpllicense], and
119119
[PATENTS][patents].
120120

121-
[agpllicense]: http://github.com/Perona/PerconaFT/blob/master/COPYING.AGPLv3
122-
[gpllicense]: http://github.com/Perona/PerconaFT/blob/master/COPYING.GPLv2
123-
[patents]: http://github.com/Perona/PerconaFT/blob/master/PATENTS
121+
[agpllicense]: http://github.com/Percona/PerconaFT/blob/master/COPYING.AGPLv3
122+
[gpllicense]: http://github.com/Percona/PerconaFT/blob/master/COPYING.GPLv2
123+
[patents]: http://github.com/Percona/PerconaFT/blob/master/PATENTS

storage/tokudb/PerconaFT/buildheader/make_tdb.cc

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -510,8 +510,9 @@ static void print_db_struct (void) {
510510
"int (*update_broadcast)(DB *, DB_TXN*, const DBT *extra, uint32_t flags)",
511511
"int (*get_fractal_tree_info64)(DB*,uint64_t*,uint64_t*,uint64_t*,uint64_t*)",
512512
"int (*iterate_fractal_tree_block_map)(DB*,int(*)(uint64_t,int64_t,int64_t,int64_t,int64_t,void*),void*)",
513-
"const char *(*get_dname)(DB *db)",
514-
"int (*get_last_key)(DB *db, YDB_CALLBACK_FUNCTION func, void* extra)",
513+
"const char *(*get_dname)(DB *db)",
514+
"int (*get_last_key)(DB *db, YDB_CALLBACK_FUNCTION func, void* extra)",
515+
"int (*recount_rows)(DB* db, int (*progress_callback)(uint64_t count, uint64_t deleted, void* progress_extra), void* progress_extra)",
515516
NULL};
516517
sort_and_dump_fields("db", true, extra);
517518
}

storage/tokudb/PerconaFT/cmake_modules/TokuMergeLibs.cmake

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ MACRO(TOKU_MERGE_STATIC_LIBS TARGET OUTPUT_NAME LIBS_TO_MERGE)
4848
ENDIF()
4949
ENDFOREACH()
5050
IF(OSLIBS)
51-
#LIST(REMOVE_DUPLICATES OSLIBS)
51+
# REMOVE_DUPLICATES destroys the order of the libs so disabled
52+
# LIST(REMOVE_DUPLICATES OSLIBS)
5253
TARGET_LINK_LIBRARIES(${TARGET} LINK_PUBLIC ${OSLIBS})
5354
ENDIF()
5455

storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -24,12 +24,12 @@ endif ()
2424

2525
## add TOKU_PTHREAD_DEBUG for debug builds
2626
if (CMAKE_VERSION VERSION_LESS 3.0)
27-
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG TOKU_PTHREAD_DEBUG=1)
28-
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD TOKU_PTHREAD_DEBUG=1)
27+
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DEBUG TOKU_PTHREAD_DEBUG=1 TOKU_DEBUG_TXN_SYNC=1)
28+
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD TOKU_PTHREAD_DEBUG=1 TOKU_DEBUG_TXN_SYNC=1)
2929
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS_DRD _FORTIFY_SOURCE=2)
3030
else ()
3131
set_property(DIRECTORY APPEND PROPERTY COMPILE_DEFINITIONS
32-
$<$<OR:$<CONFIG:DEBUG>,$<CONFIG:DRD>>:TOKU_PTHREAD_DEBUG=1>
32+
$<$<OR:$<CONFIG:DEBUG>,$<CONFIG:DRD>>:TOKU_PTHREAD_DEBUG=1 TOKU_DEBUG_TXN_SYNC=1>
3333
$<$<CONFIG:DRD>:_FORTIFY_SOURCE=2>
3434
)
3535
endif ()

storage/tokudb/PerconaFT/ft/CMakeLists.txt

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ set(FT_SOURCES
3636
ft-flusher
3737
ft-hot-flusher
3838
ft-ops
39+
ft-recount-rows
3940
ft-status
4041
ft-test-helpers
4142
ft-verify

storage/tokudb/PerconaFT/ft/ft-flusher.cc

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1572,6 +1572,7 @@ void toku_bnc_flush_to_child(FT ft, NONLEAF_CHILDINFO bnc, FTNODE child, TXNID p
15721572
txn_gc_info *gc_info;
15731573

15741574
STAT64INFO_S stats_delta;
1575+
int64_t logical_rows_delta = 0;
15751576
size_t remaining_memsize = bnc->msg_buffer.buffer_size_in_use();
15761577

15771578
flush_msg_fn(FT t, FTNODE n, NONLEAF_CHILDINFO nl, txn_gc_info *g) :
@@ -1599,8 +1600,8 @@ void toku_bnc_flush_to_child(FT ft, NONLEAF_CHILDINFO bnc, FTNODE child, TXNID p
15991600
is_fresh,
16001601
gc_info,
16011602
flow_deltas,
1602-
&stats_delta
1603-
);
1603+
&stats_delta,
1604+
&logical_rows_delta);
16041605
remaining_memsize -= memsize_in_buffer;
16051606
return 0;
16061607
}
@@ -1613,6 +1614,7 @@ void toku_bnc_flush_to_child(FT ft, NONLEAF_CHILDINFO bnc, FTNODE child, TXNID p
16131614
if (flush_fn.stats_delta.numbytes || flush_fn.stats_delta.numrows) {
16141615
toku_ft_update_stats(&ft->in_memory_stats, flush_fn.stats_delta);
16151616
}
1617+
toku_ft_adjust_logical_row_count(ft, flush_fn.logical_rows_delta);
16161618
if (do_garbage_collection) {
16171619
size_t buffsize = bnc->msg_buffer.buffer_size_in_use();
16181620
// may be misleading if there's a broadcast message in there

storage/tokudb/PerconaFT/ft/ft-internal.h

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ struct ft_header {
143143
MSN msn_at_start_of_last_completed_optimize;
144144

145145
STAT64INFO_S on_disk_stats;
146+
147+
// This represents the balance of inserts - deletes and should be
148+
// closer to a logical representation of the number of records in an index
149+
uint64_t on_disk_logical_rows;
146150
};
147151
typedef struct ft_header *FT_HEADER;
148152

@@ -176,6 +180,7 @@ struct ft {
176180

177181
// protected by atomic builtins
178182
STAT64INFO_S in_memory_stats;
183+
uint64_t in_memory_logical_rows;
179184

180185
// transient, not serialized to disk. updated when we do write to
181186
// disk. tells us whether we can do partial eviction (we can't if

0 commit comments

Comments
 (0)