Skip to content

Commit 0460d42

Browse files
committed
Merge mariadb-10.2.33
2 parents debd36c + fbcae42 commit 0460d42

Some content is hidden

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

47 files changed

+126
-107
lines changed

mysql-test/suite/rpl/r/rpl_parallel2.result

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,8 +2,10 @@ include/rpl_init.inc [topology=1->2]
22
*** MDEV-5509: Incorrect value for Seconds_Behind_Master if parallel replication ***
33
connection server_2;
44
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
5+
set @old_parallel_mode= @@GLOBAL.slave_parallel_mode;
56
include/stop_slave.inc
67
SET GLOBAL slave_parallel_threads=5;
8+
set global slave_parallel_mode= optimistic;
79
include/start_slave.inc
810
connection server_1;
911
CREATE TABLE t1 (a INT PRIMARY KEY, b INT);
@@ -157,6 +159,7 @@ UNLOCK TABLES;
157159
connection server_2;
158160
include/stop_slave.inc
159161
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
162+
set global slave_parallel_mode= @old_parallel_mode;
160163
include/start_slave.inc
161164
connection server_1;
162165
DROP TABLE t1, t2;

mysql-test/suite/rpl/t/rpl_parallel2.test

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,10 @@
88

99
--connection server_2
1010
SET @old_parallel_threads=@@GLOBAL.slave_parallel_threads;
11+
set @old_parallel_mode= @@GLOBAL.slave_parallel_mode;
1112
--source include/stop_slave.inc
1213
SET GLOBAL slave_parallel_threads=5;
14+
set global slave_parallel_mode= optimistic;
1315
--source include/start_slave.inc
1416

1517
--connection server_1
@@ -219,6 +221,7 @@ UNLOCK TABLES;
219221
--connection server_2
220222
--source include/stop_slave.inc
221223
SET GLOBAL slave_parallel_threads=@old_parallel_threads;
224+
set global slave_parallel_mode= @old_parallel_mode;
222225
--source include/start_slave.inc
223226

224227
--connection server_1

mysys/stacktrace.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@
3737
#ifdef __linux__
3838
#define PTR_SANE(p) ((p) && (char*)(p) >= heap_start && (char*)(p) <= heap_end)
3939
static char *heap_start;
40-
extern char *__bss_start;
40+
char *__bss_start;
4141
#else
4242
#define PTR_SANE(p) (p)
4343
#endif /* __linux */

sql/rpl_parallel.cc

Lines changed: 23 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -378,13 +378,14 @@ do_gco_wait(rpl_group_info *rgi, group_commit_orderer *gco,
378378
}
379379

380380

381-
static void
381+
static bool
382382
do_ftwrl_wait(rpl_group_info *rgi,
383383
bool *did_enter_cond, PSI_stage_info *old_stage)
384384
{
385385
THD *thd= rgi->thd;
386386
rpl_parallel_entry *entry= rgi->parallel_entry;
387387
uint64 sub_id= rgi->gtid_sub_id;
388+
bool aborted= false;
388389
DBUG_ENTER("do_ftwrl_wait");
389390

390391
mysql_mutex_assert_owner(&entry->LOCK_parallel_entry);
@@ -407,7 +408,10 @@ do_ftwrl_wait(rpl_group_info *rgi,
407408
do
408409
{
409410
if (entry->force_abort || rgi->worker_error)
411+
{
412+
aborted= true;
410413
break;
414+
}
411415
if (thd->check_killed())
412416
{
413417
thd->send_kill_message();
@@ -427,7 +431,7 @@ do_ftwrl_wait(rpl_group_info *rgi,
427431
if (sub_id > entry->largest_started_sub_id)
428432
entry->largest_started_sub_id= sub_id;
429433

430-
DBUG_VOID_RETURN;
434+
DBUG_RETURN(aborted);
431435
}
432436

433437

@@ -513,7 +517,22 @@ rpl_unpause_after_ftwrl(THD *thd)
513517
mysql_mutex_lock(&e->LOCK_parallel_entry);
514518
rpt->pause_for_ftwrl = false;
515519
mysql_mutex_unlock(&rpt->LOCK_rpl_thread);
516-
e->pause_sub_id= (uint64)ULONGLONG_MAX;
520+
/*
521+
Do not change pause_sub_id if force_abort is set.
522+
force_abort is set in case of STOP SLAVE.
523+
524+
Reason: If pause_sub_id is not changed and force_abort_is set,
525+
any parallel slave thread waiting in do_ftwrl_wait() will
526+
on wakeup return from do_ftwrl_wait() with 1. This will set
527+
skip_event_group to 1 in handle_rpl_parallel_thread() and the
528+
parallel thread will abort at once.
529+
530+
If pause_sub_id is changed, the code in handle_rpl_parallel_thread()
531+
would continue to execute the transaction in the queue, which would
532+
cause some transactions to be lost.
533+
*/
534+
if (!e->force_abort)
535+
e->pause_sub_id= (uint64)ULONGLONG_MAX;
517536
mysql_cond_broadcast(&e->COND_parallel_entry);
518537
mysql_mutex_unlock(&e->LOCK_parallel_entry);
519538
}
@@ -1197,7 +1216,7 @@ handle_rpl_parallel_thread(void *arg)
11971216
rgi->worker_error= 1;
11981217
}
11991218
if (likely(!skip_event_group))
1200-
do_ftwrl_wait(rgi, &did_enter_cond, &old_stage);
1219+
skip_event_group= do_ftwrl_wait(rgi, &did_enter_cond, &old_stage);
12011220

12021221
/*
12031222
Register ourself to wait for the previous commit, if we need to do

sql/sql_admin.cc

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -776,7 +776,7 @@ static bool mysql_admin_table(THD* thd, TABLE_LIST* tables,
776776
*/
777777
collect_eis=
778778
(table->table->s->table_category == TABLE_CATEGORY_USER &&
779-
!(lex->alter_info.flags &= Alter_info::ALTER_ADMIN_PARTITION) &&
779+
!(lex->alter_info.flags & Alter_info::ALTER_ADMIN_PARTITION) &&
780780
(get_use_stat_tables_mode(thd) > NEVER ||
781781
lex->with_persistent_for_clause));
782782
}

storage/tokudb/CMakeLists.txt

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
SET(TOKUDB_VERSION 5.6.41-84.1)
1+
SET(TOKUDB_VERSION 5.6.49-89.0)
22
# PerconaFT only supports x86-64 and cmake-2.8.9+
33
IF(WIN32)
44
# tokudb never worked there
@@ -136,6 +136,7 @@ IF(DEFINED TOKUDB_NOPATCH_CONFIG)
136136
ADD_DEFINITIONS("-DTOKUDB_NOPATCH_CONFIG=${TOKUDB_NOPATCH_CONFIG}")
137137
ENDIF()
138138

139+
MY_CHECK_AND_SET_COMPILER_FLAG(-Wno-missing-format-attribute)
139140
MY_CHECK_AND_SET_COMPILER_FLAG(-Wno-missing-field-initializers)
140141

141142
IF (EXISTS "${CMAKE_CURRENT_SOURCE_DIR}/PerconaFT/")

storage/tokudb/PerconaFT/cmake_modules/TokuSetupCompiler.cmake

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -47,20 +47,18 @@ include(CheckCCompilerFlag)
4747
include(CheckCXXCompilerFlag)
4848

4949
## adds a compiler flag if the compiler supports it
50-
macro(set_cflags_if_supported)
50+
macro(prepend_cflags_if_supported)
5151
foreach(flag ${ARGN})
5252
MY_CHECK_AND_SET_COMPILER_FLAG(${flag})
5353
endforeach(flag)
54-
endmacro(set_cflags_if_supported)
54+
endmacro(prepend_cflags_if_supported)
5555

5656
if (NOT DEFINED MYSQL_PROJECT_NAME_DOCSTRING)
5757
set (OPTIONAL_CFLAGS "${OPTIONAL_CFLAGS} -Wmissing-format-attribute")
5858
endif()
5959

6060
## disable some warnings
61-
## missing-format-attribute causes warnings in some MySQL include files
62-
## if the library is built as a part of TokuDB MySQL storage engine
63-
set_cflags_if_supported(
61+
prepend_cflags_if_supported(
6462
-Wno-missing-field-initializers
6563
-Wstrict-null-sentinel
6664
-Winit-self
@@ -77,7 +75,6 @@ set_cflags_if_supported(
7775
-fno-exceptions
7876
-Wno-error=nonnull-compare
7977
)
80-
## set_cflags_if_supported_named("-Weffc++" -Weffcpp)
8178

8279
if (CMAKE_CXX_FLAGS MATCHES -fno-implicit-templates)
8380
# must append this because mysql sets -fno-implicit-templates and we need to override it
@@ -89,24 +86,18 @@ endif()
8986

9087
## Clang has stricter POD checks. So, only enable this warning on our other builds (Linux + GCC)
9188
if (NOT CMAKE_CXX_COMPILER_ID MATCHES Clang)
92-
set_cflags_if_supported(
89+
prepend_cflags_if_supported(
9390
-Wpacked
9491
)
9592
endif ()
9693

9794
option (PROFILING "Allow profiling and debug" ON)
9895
if (PROFILING)
99-
set_cflags_if_supported(
96+
prepend_cflags_if_supported(
10097
-fno-omit-frame-pointer
10198
)
10299
endif ()
103100

104-
## this hits with optimized builds somewhere in ftleaf_split, we don't
105-
## know why but we don't think it's a big deal
106-
set_cflags_if_supported(
107-
-Wno-error=strict-overflow
108-
)
109-
110101
# new flag sets in MySQL 8.0 seem to explicitly disable this
111102
set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -fexceptions")
112103

@@ -144,7 +135,7 @@ else ()
144135
endif ()
145136

146137
## set warnings
147-
set_cflags_if_supported(
138+
prepend_cflags_if_supported(
148139
-Wextra
149140
-Wbad-function-cast
150141
-Wno-missing-noreturn
@@ -167,7 +158,7 @@ set_cflags_if_supported(
167158

168159
if (NOT CMAKE_CXX_COMPILER_ID STREQUAL Clang)
169160
# Disabling -Wcast-align with clang. TODO: fix casting and re-enable it, someday.
170-
set_cflags_if_supported(-Wcast-align)
161+
prepend_cflags_if_supported(-Wcast-align)
171162
endif ()
172163

173164
## never want these

storage/tokudb/PerconaFT/ft/logger/logger.cc

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -51,6 +51,9 @@ Copyright (c) 2006, 2015, Percona and/or its affiliates. All rights reserved.
5151
#include "util/status.h"
5252

5353
int writing_rollback = 0;
54+
extern "C" {
55+
uint force_recovery = 0;
56+
}
5457

5558
static const int log_format_version = TOKU_LOG_VERSION;
5659

storage/tokudb/PerconaFT/ft/serialize/rbtree_mhs.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -193,6 +193,7 @@ namespace MhsRbTree {
193193
BlockPair(OUUInt64 o, OUUInt64 s) : _offset(o), _size(s) {}
194194
BlockPair(const BlockPair &o)
195195
: _offset(o._offset), _size(o._size) {}
196+
BlockPair& operator=(const BlockPair&) = default;
196197

197198
int operator<(const BlockPair &rhs) const {
198199
return _offset < rhs._offset;

storage/tokudb/PerconaFT/ft/tests/cachetable-simple-close.cc

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -195,13 +195,13 @@ static void test_multiple_cachefiles(bool use_same_hash) {
195195

196196
char fname1[strlen(TOKU_TEST_FILENAME) + sizeof("_1")];
197197
strcpy(fname1, TOKU_TEST_FILENAME);
198-
strncat(fname1, "_1", sizeof("_1"));
198+
strcat(fname1, "_1");
199199
char fname2[strlen(TOKU_TEST_FILENAME) + sizeof("_2")];
200200
strcpy(fname2, TOKU_TEST_FILENAME);
201-
strncat(fname2, "_2", sizeof("_2"));
201+
strcat(fname2, "_2");
202202
char fname3[strlen(TOKU_TEST_FILENAME) + sizeof("_3")];
203203
strcpy(fname3, TOKU_TEST_FILENAME);
204-
strncat(fname3, "_3", sizeof("_3"));
204+
strcat(fname3, "_3");
205205

206206
unlink(fname1);
207207
unlink(fname2);
@@ -280,10 +280,10 @@ static void test_evictor(void) {
280280

281281
char fname1[strlen(TOKU_TEST_FILENAME) + sizeof("_1")];
282282
strcpy(fname1, TOKU_TEST_FILENAME);
283-
strncat(fname1, "_1", sizeof("_1"));
283+
strcat(fname1, "_1");
284284
char fname2[strlen(TOKU_TEST_FILENAME) + sizeof("_2")];
285285
strcpy(fname2, TOKU_TEST_FILENAME);
286-
strncat(fname2, "_2", sizeof("_2"));
286+
strcat(fname2, "_2");
287287

288288
unlink(fname1);
289289
unlink(fname2);

0 commit comments

Comments
 (0)