Skip to content

Commit

Permalink
Merge 10.2 into 10.3
Browse files Browse the repository at this point in the history
  • Loading branch information
dr-m committed Aug 26, 2020
2 parents 65f3005 + 21a9658 commit 6a04228
Show file tree
Hide file tree
Showing 15 changed files with 129 additions and 133 deletions.
20 changes: 10 additions & 10 deletions mysql-test/suite/galera/t/mdev-22543.test
Original file line number Diff line number Diff line change
Expand Up @@ -5,15 +5,15 @@
--source include/galera_cluster.inc
--source include/have_debug.inc
--source include/have_debug_sync.inc

--let $node_1 = node_1
--let $node_2 = node_2
--source include/auto_increment_offset_save.inc

--let $galera_connection_name = node_1_ctrl
--let $galera_server_number = 1
--source include/galera_connect.inc

#
# Run UPDATE on node_1 and make it block before table locks are taken.
# This should block FTWRL.
Expand All @@ -23,10 +23,10 @@ CREATE TABLE t1 (f1 INT PRIMARY KEY, f2 INT);
INSERT INTO t1 VALUES (1, 1);
SET DEBUG_SYNC = "before_lock_tables_takes_lock SIGNAL sync_point_reached WAIT_FOR sync_point_continue";
--send UPDATE t1 SET f2 = 2 WHERE f1 = 1

--connection node_1_ctrl
SET DEBUG_SYNC = "now WAIT_FOR sync_point_reached";

#
# Restart node_2, force SST.
#
Expand All @@ -40,19 +40,19 @@ SET DEBUG_SYNC = "now WAIT_FOR sync_point_reached";
# If the bug is present, FTWRL times out on node_1 in couple of
# seconds and node_2 fails to join.
--sleep 10

--connection node_1_ctrl
SET DEBUG_SYNC = "now SIGNAL sync_point_continue";

--connection node_1
--reap
SET DEBUG_SYNC = "RESET";

--connection node_2
--enable_reconnect
--source include/wait_until_connected_again.inc

--connection node_1
DROP TABLE t1;

--source include/auto_increment_offset_restore.inc
19 changes: 19 additions & 0 deletions mysql-test/suite/galera_3nodes/disabled.def
Original file line number Diff line number Diff line change
@@ -1,2 +1,21 @@
##############################################################################
#
# List the test cases that are to be disabled temporarily.
#
# Separate the test case name and the comment with ':'.
#
# <testcasename> : MDEV-<xxxx> <comment>
#
# Do not use any TAB characters for whitespace.
#
##############################################################################

galera_ipv6_mariabackup : MDEV-23573 Could not open '../galera/include/have_mariabackup.inc'
galera_ipv6_mariabackup_section : MDEV-23574 Could not open '../galera/include/have_mariabackup.inc'
galera_ipv6_mysqldump : MDEV-23576 WSREP_SST: [ERROR] rsync daemon port '16008' has been taken
galera_ipv6_rsyn : MDEV-23581 WSREP_SST: [ERROR] rsync daemon port '16008' has been taken
galera_ipv6_rsync_section : MDEV-23580 WSREP_SST: [ERROR] rsync daemon port '16008' has been taken
galera_ipv6_xtrabackup-v2 : MDEV-23575 WSREP_SST: [ERROR] innobackupex not in path
galera_ist_gcache_rollover : MDEV-23578 WSREP: exception caused by message: {v=0,t=1,ut=255,o=4,s=0,sr=0,as=1,f=6,src=50524cfe,srcvid=view_id(REG,50524cfe,4),insvid=view_id(UNKNOWN,00000000,0),ru=00000000,r=[-1,-1],fs=75,nl=(}
galera_slave_options_do :MDEV-8798
galera_slave_options_ignore : MDEV-8798
1 change: 0 additions & 1 deletion mysql-test/suite/innodb/r/foreign_key.result
Original file line number Diff line number Diff line change
Expand Up @@ -167,7 +167,6 @@ PRIMARY KEY (store_id),
UNIQUE KEY idx_unique_manager (manager_staff_id),
CONSTRAINT fk_store_staff FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB;
SET FOREIGN_KEY_CHECKS=DEFAULT;
LOCK TABLE staff WRITE;
UNLOCK TABLES;
DROP TABLES staff, store;
Expand Down
1 change: 0 additions & 1 deletion mysql-test/suite/innodb/t/foreign_key.test
Original file line number Diff line number Diff line change
Expand Up @@ -136,7 +136,6 @@ CREATE TABLE store (
UNIQUE KEY idx_unique_manager (manager_staff_id),
CONSTRAINT fk_store_staff FOREIGN KEY (manager_staff_id) REFERENCES staff (staff_id) ON DELETE RESTRICT ON UPDATE CASCADE
) ENGINE=InnoDB;
SET FOREIGN_KEY_CHECKS=DEFAULT;

LOCK TABLE staff WRITE;
UNLOCK TABLES;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SET @@session.foreign_key_checks = 1;
SET @@session.foreign_key_checks = DEFAULT;
SELECT @@session.foreign_key_checks;
@@session.foreign_key_checks
0
1
'#---------------------FN_DYNVARS_032_02-------------------------#'
SET foreign_key_checks = 1;
SELECT @@foreign_key_checks;
Expand Down
2 changes: 1 addition & 1 deletion mysql-test/suite/sys_vars/r/unique_checks_basic.result
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ SET @@session.unique_checks= 1;
SET @@session.unique_checks= DEFAULT;
SELECT @@session.unique_checks;
@@session.unique_checks
0
1
'#--------------------FN_DYNVARS_005_04-------------------------#'
SET @@session.unique_checks =1;
SELECT @@session.unique_checks;
Expand Down
25 changes: 8 additions & 17 deletions sql/mdl.cc
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,6 @@
#include <mysql/psi/mysql_stage.h>
#include "wsrep_mysqld.h"
#include "wsrep_thd.h"
#include "wsrep_sst.h"

#ifdef HAVE_PSI_INTERFACE
static PSI_mutex_key key_MDL_wait_LOCK_wait_status;
Expand Down Expand Up @@ -2148,26 +2147,18 @@ MDL_context::acquire_lock(MDL_request *mdl_request, double lock_wait_timeout)
wait_status= m_wait.timed_wait(m_owner, &abs_shortwait, FALSE,
mdl_request->key.get_wait_state_name());

THD* thd= m_owner->get_thd();

if (wait_status != MDL_wait::EMPTY)
break;
/* Check if the client is gone while we were waiting. */
if (! thd_is_connected(thd))
if (! thd_is_connected(m_owner->get_thd()))
{
#if defined(WITH_WSREP) && !defined(EMBEDDED_LIBRARY)
// During SST client might not be connected
if (!wsrep_is_sst_progress())
#endif
{
/*
* The client is disconnected. Don't wait forever:
* assume it's the same as a wait timeout, this
* ensures all error handling is correct.
*/
wait_status= MDL_wait::TIMEOUT;
break;
}
/*
* The client is disconnected. Don't wait forever:
* assume it's the same as a wait timeout, this
* ensures all error handling is correct.
*/
wait_status= MDL_wait::TIMEOUT;
break;
}

mysql_prlock_wrlock(&lock->m_rwlock);
Expand Down
7 changes: 5 additions & 2 deletions sql/sys_vars.ic
Original file line number Diff line number Diff line change
Expand Up @@ -1817,13 +1817,16 @@ public:
return false;
}
void session_save_default(THD *thd, set_var *var)
{ var->save_result.ulonglong_value= global_var(ulonglong) & bitmask; }
{
var->save_result.ulonglong_value=
(reverse_semantics == !(global_var(ulonglong) & bitmask));
}
void global_save_default(THD *thd, set_var *var)
{ var->save_result.ulonglong_value= option.def_value; }

uchar *valptr(THD *thd, ulonglong val)
{
thd->sys_var_tmp.my_bool_value= reverse_semantics ^ ((val & bitmask) != 0);
thd->sys_var_tmp.my_bool_value= (reverse_semantics == !(val & bitmask));
return (uchar*) &thd->sys_var_tmp.my_bool_value;
}
uchar *session_value_ptr(THD *thd, const LEX_CSTRING *base)
Expand Down
18 changes: 5 additions & 13 deletions sql/wsrep_sst.cc
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
/* Copyright 2008-2015 Codership Oy <http://www.codership.com>
/* Copyright 2008-2020 Codership Oy <http://www.codership.com>
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
Expand Down Expand Up @@ -186,7 +186,6 @@ bool wsrep_before_SE()

static bool sst_complete = false;
static bool sst_needed = false;
static bool sst_in_progress = false;

#define WSREP_EXTEND_TIMEOUT_INTERVAL 30
#define WSREP_TIMEDWAIT_SECONDS 10
Expand Down Expand Up @@ -1548,11 +1547,11 @@ static void* sst_donor_thread (void* a)
wsrep_uuid_t ret_uuid= WSREP_UUID_UNDEFINED;
// seqno of complete SST
wsrep_seqno_t ret_seqno= WSREP_SEQNO_UNDEFINED;
// SST is now in progress
sst_in_progress= true;

wsp::thd thd(FALSE); // we turn off wsrep_on for this THD so that it can
// operate with wsrep_ready == OFF
// We turn off wsrep_on for this THD so that it can
// operate with wsrep_ready == OFF
// We also set this SST thread THD as system thread
wsp::thd thd(FALSE, true);
wsp::process proc(arg->cmd, "r", arg->env);

err= proc.error();
Expand Down Expand Up @@ -1651,8 +1650,6 @@ static void* sst_donor_thread (void* a)
wsrep->sst_sent (wsrep, &state_id, -err);
proc.wait();

sst_in_progress= false;

return NULL;
}

Expand Down Expand Up @@ -1827,8 +1824,3 @@ void wsrep_SE_initialized()
{
SE_initialized = true;
}

bool wsrep_is_sst_progress()
{
return (sst_in_progress);
}
2 changes: 0 additions & 2 deletions sql/wsrep_sst.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,14 +77,12 @@ extern void wsrep_SE_init_grab(); /*! grab init critical section */
extern void wsrep_SE_init_wait(); /*! wait for SE init to complete */
extern void wsrep_SE_init_done(); /*! signal that SE init is complte */
extern void wsrep_SE_initialized(); /*! mark SE initialization complete */
extern bool wsrep_is_sst_progress();

#else
#define wsrep_SE_initialized() do { } while(0)
#define wsrep_SE_init_grab() do { } while(0)
#define wsrep_SE_init_done() do { } while(0)
#define wsrep_sst_continue() (0)
#define wsrep_is_sst_progress() (0)

#endif /* WITH_WSREP */
#endif /* WSREP_SST_H */
4 changes: 3 additions & 1 deletion sql/wsrep_utils.cc
Original file line number Diff line number Diff line change
Expand Up @@ -414,14 +414,16 @@ process::wait ()
return err_;
}

thd::thd (my_bool won) : init(), ptr(new THD(0))
thd::thd (my_bool won, bool system_thread) : init(), ptr(new THD(0))
{
if (ptr)
{
ptr->thread_stack= (char*) &ptr;
ptr->store_globals();
ptr->variables.option_bits&= ~OPTION_BIN_LOG; // disable binlog
ptr->variables.wsrep_on = won;
if (system_thread)
ptr->system_thread= SYSTEM_THREAD_GENERIC;
ptr->security_ctx->master_access= ~(ulong)0;
lex_start(ptr);
}
Expand Down
2 changes: 1 addition & 1 deletion sql/wsrep_utils.h
Original file line number Diff line number Diff line change
Expand Up @@ -298,7 +298,7 @@ class thd

public:

thd(my_bool wsrep_on);
thd(my_bool wsrep_on, bool system_thread=false);
~thd();
THD* const ptr;
};
Expand Down
30 changes: 12 additions & 18 deletions storage/innobase/include/row0upd.h
Original file line number Diff line number Diff line change
Expand Up @@ -249,24 +249,18 @@ row_upd_index_replace_new_col_vals_index_pos(
const upd_t* update,
mem_heap_t* heap)
MY_ATTRIBUTE((nonnull));
/***********************************************************//**
Replaces the new column values stored in the update vector to the index entry
given. */
void
row_upd_index_replace_new_col_vals(
/*===============================*/
dtuple_t* entry, /*!< in/out: index entry where replaced;
the clustered index record must be
covered by a lock or a page latch to
prevent deletion (rollback or purge) */
dict_index_t* index, /*!< in: index; NOTE that this may also be a
non-clustered index */
const upd_t* update, /*!< in: an update vector built for the
CLUSTERED index so that the field number in
an upd_field is the clustered index position */
mem_heap_t* heap) /*!< in: memory heap for allocating and
copying the new values */
MY_ATTRIBUTE((nonnull));
/** Replace the new column values stored in the update vector,
during trx_undo_prev_version_build().
@param entry clustered index tuple where the values are replaced
(the clustered index leaf page latch must be held)
@param index clustered index
@param update update vector for the clustered index
@param heap memory heap for allocating and copying values
@return whether the previous version was built successfully */
bool
row_upd_index_replace_new_col_vals(dtuple_t *entry, const dict_index_t &index,
const upd_t *update, mem_heap_t *heap)
MY_ATTRIBUTE((nonnull, warn_unused_result));
/***********************************************************//**
Replaces the new column values stored in the update vector. */
void
Expand Down
Loading

0 comments on commit 6a04228

Please sign in to comment.