Merge 10.6 into 10.7
This commit is contained in:
commit
05e29e177d
@ -113,7 +113,11 @@ IF(NOT VERSION)
|
||||
SET(DEFAULT_MACHINE "x86")
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
||||
|
||||
IF(NOT DEFAULT_MACHINE MATCHES "64" AND 64BIT)
|
||||
SET(DEFAULT_MACHINE "${DEFAULT_MACHINE}-64bit")
|
||||
ENDIF()
|
||||
|
||||
IF(NOT PLATFORM)
|
||||
SET(PLATFORM ${DEFAULT_PLATFORM})
|
||||
ENDIF()
|
||||
|
@ -7,8 +7,9 @@ connection node_1;
|
||||
connection node_2;
|
||||
Killing server ...
|
||||
connection node_1;
|
||||
SET SESSION lock_wait_timeout= 3;
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
ERROR 40001: Deadlock found when trying to get lock; try restarting transaction
|
||||
ERROR HY000: Lock wait timeout exceeded; try restarting transaction
|
||||
connection node_2;
|
||||
connect node_2a, 127.0.0.1, root, , test, $NODE_MYPORT_2;
|
||||
disconnect node_2;
|
||||
|
@ -22,7 +22,8 @@ call mtr.add_suppression("WSREP: TO isolation failed for: ");
|
||||
--source include/kill_galera.inc
|
||||
|
||||
--connection node_1
|
||||
--error ER_LOCK_DEADLOCK
|
||||
SET SESSION lock_wait_timeout= 3;
|
||||
--error ER_LOCK_WAIT_TIMEOUT
|
||||
CREATE TABLE t1 (f1 INTEGER) ENGINE=InnoDB;
|
||||
|
||||
# Reset the master and restart the slave so that post-test checks can run
|
||||
|
@ -10,3 +10,5 @@
|
||||
#
|
||||
##############################################################################
|
||||
|
||||
rtree_concurrent_srch : MDEV-15284 COUNT(*) mismatch
|
||||
rtree_recovery : MDEV-15284 COUNT(*) mismatch
|
||||
|
@ -42,14 +42,10 @@ IF(HAVE_PAM_APPL_H AND HAVE_GETGROUPLIST)
|
||||
IF (TARGET auth_pam)
|
||||
MYSQL_ADD_EXECUTABLE(auth_pam_tool auth_pam_tool.c DESTINATION ${INSTALL_PLUGINDIR}/auth_pam_tool_dir COMPONENT Server)
|
||||
TARGET_LINK_LIBRARIES(auth_pam_tool pam)
|
||||
INSTALL(CODE "EXECUTE_PROCESS(
|
||||
COMMAND chmod u=rwx,g=,o= auth_pam_tool_dir
|
||||
WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_PLUGINDIR}/)"
|
||||
COMPONENT Server)
|
||||
INSTALL(CODE "EXECUTE_PROCESS(
|
||||
COMMAND chmod u=rwxs,g=rx,o=rx auth_pam_tool_dir/auth_pam_tool
|
||||
WORKING_DIRECTORY \$ENV{DESTDIR}\${CMAKE_INSTALL_PREFIX}/${INSTALL_PLUGINDIR}/)"
|
||||
COMPONENT Server)
|
||||
SET(CPACK_RPM_server_USER_FILELIST ${CPACK_RPM_server_USER_FILELIST}
|
||||
"%attr(700, -, -) ${INSTALL_PLUGINDIRABS}/auth_pam_tool_dir"
|
||||
"%attr(4755, -, -) ${INSTALL_PLUGINDIRABS}/auth_pam_tool_dir/auth_pam_tool")
|
||||
SET(CPACK_RPM_server_USER_FILELIST ${CPACK_RPM_server_USER_FILELIST} PARENT_SCOPE)
|
||||
ENDIF()
|
||||
IF(TARGET auth_pam OR TARGET auth_pam_v1)
|
||||
ADD_SUBDIRECTORY(testing)
|
||||
@ -59,7 +55,7 @@ IF(HAVE_PAM_APPL_H AND HAVE_GETGROUPLIST)
|
||||
IF(INSTALL_PAMDIR)
|
||||
INSTALL(TARGETS pam_user_map DESTINATION ${INSTALL_PAMDIR} COMPONENT Server)
|
||||
INSTALL(FILES mapper/user_map.conf DESTINATION ${INSTALL_PAMDATADIR} COMPONENT Server)
|
||||
SET(CPACK_RPM_server_USER_FILELIST ${CPACK_RPM_server_USER_FILELIST} "%config(noreplace) ${INSTALL_PAMDATADIR}/*" PARENT_SCOPE)
|
||||
SET(CPACK_RPM_server_USER_FILELIST ${CPACK_RPM_server_USER_FILELIST} "%config(noreplace) ${INSTALL_PAMDATADIRABS}/*" PARENT_SCOPE)
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
ENDIF()
|
||||
|
@ -2187,7 +2187,7 @@ int ha_rollback_trans(THD *thd, bool all)
|
||||
if (thd->is_error())
|
||||
{
|
||||
WSREP_DEBUG("ha_rollback_trans(%lld, %s) rolled back: %s: %s; is_real %d",
|
||||
thd->thread_id, all?"TRUE":"FALSE", WSREP_QUERY(thd),
|
||||
thd->thread_id, all?"TRUE":"FALSE", wsrep_thd_query(thd),
|
||||
thd->get_stmt_da()->message(), is_real_trans);
|
||||
}
|
||||
(void) wsrep_after_rollback(thd, all);
|
||||
|
@ -5059,7 +5059,7 @@ bool select_create::send_eof()
|
||||
{
|
||||
WSREP_DEBUG("select_create commit failed, thd: %llu err: %s %s",
|
||||
thd->thread_id,
|
||||
wsrep_thd_transaction_state_str(thd), WSREP_QUERY(thd));
|
||||
wsrep_thd_transaction_state_str(thd), wsrep_thd_query(thd));
|
||||
mysql_mutex_unlock(&thd->LOCK_thd_data);
|
||||
abort_result_set();
|
||||
DBUG_RETURN(true);
|
||||
|
@ -7890,7 +7890,7 @@ static bool wsrep_mysql_parse(THD *thd, char *rawbuf, uint length,
|
||||
DBUG_ASSERT(!debug_sync_set_action(thd, STRING_WITH_LEN(act)));
|
||||
});
|
||||
WSREP_DEBUG("wsrep retrying AC query: %lu %s",
|
||||
thd->wsrep_retry_counter, WSREP_QUERY(thd));
|
||||
thd->wsrep_retry_counter, wsrep_thd_query(thd));
|
||||
wsrep_prepare_for_autocommit_retry(thd, rawbuf, length, parser_state);
|
||||
if (thd->lex->explain)
|
||||
delete_explain_query(thd->lex);
|
||||
@ -7904,7 +7904,7 @@ static bool wsrep_mysql_parse(THD *thd, char *rawbuf, uint length,
|
||||
is_autocommit,
|
||||
thd->wsrep_retry_counter,
|
||||
thd->variables.wsrep_retry_autocommit,
|
||||
WSREP_QUERY(thd));
|
||||
wsrep_thd_query(thd));
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0));
|
||||
thd->reset_kill_query();
|
||||
thd->wsrep_retry_counter= 0; // reset
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2018 Codership Oy <info@codership.com>
|
||||
/* Copyright 2018-2021 Codership Oy <info@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
|
||||
@ -108,14 +108,14 @@ int Wsrep_client_service::prepare_data_for_replication()
|
||||
"affected rows: %llu, "
|
||||
"changed tables: %d, "
|
||||
"sql_log_bin: %d",
|
||||
WSREP_QUERY(m_thd),
|
||||
wsrep_thd_query(m_thd),
|
||||
m_thd->get_stmt_da()->affected_rows(),
|
||||
stmt_has_updated_trans_table(m_thd),
|
||||
m_thd->variables.sql_log_bin);
|
||||
}
|
||||
else
|
||||
{
|
||||
WSREP_DEBUG("empty rbr buffer, query: %s", WSREP_QUERY(m_thd));
|
||||
WSREP_DEBUG("empty rbr buffer, query: %s", wsrep_thd_query(m_thd));
|
||||
}
|
||||
}
|
||||
DBUG_RETURN(0);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2018 Codership Oy <info@codership.com>
|
||||
/* Copyright 2018-2021 Codership Oy <info@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
|
||||
@ -403,6 +403,16 @@ int Wsrep_high_priority_service::apply_toi(const wsrep::ws_meta& ws_meta,
|
||||
WSREP_DEBUG("Wsrep_high_priority_service::apply_toi: %lld",
|
||||
client_state.toi_meta().seqno().get());
|
||||
|
||||
DBUG_EXECUTE_IF("sync.wsrep_apply_toi",
|
||||
{
|
||||
const char act[]=
|
||||
"now "
|
||||
"SIGNAL sync.wsrep_apply_toi_reached "
|
||||
"WAIT_FOR signal.wsrep_apply_toi";
|
||||
DBUG_ASSERT(!debug_sync_set_action(thd,
|
||||
STRING_WITH_LEN(act)));
|
||||
};);
|
||||
|
||||
int ret= apply_events(thd, m_rli, data, err);
|
||||
wsrep_thd_set_ignored_error(thd, false);
|
||||
trans_commit(thd);
|
||||
@ -447,6 +457,15 @@ int Wsrep_high_priority_service::log_dummy_write_set(const wsrep::ws_handle& ws_
|
||||
DBUG_PRINT("info",
|
||||
("Wsrep_high_priority_service::log_dummy_write_set: seqno=%lld",
|
||||
ws_meta.seqno().get()));
|
||||
DBUG_EXECUTE_IF("sync.wsrep_log_dummy_write_set",
|
||||
{
|
||||
const char act[]=
|
||||
"now "
|
||||
"SIGNAL sync.wsrep_log_dummy_write_set_reached ";
|
||||
DBUG_ASSERT(!debug_sync_set_action(m_thd,
|
||||
STRING_WITH_LEN(act)));
|
||||
};);
|
||||
|
||||
if (ws_meta.ordered())
|
||||
{
|
||||
wsrep::client_state& cs(m_thd->wsrep_cs());
|
||||
@ -680,7 +699,7 @@ Wsrep_replayer_service::~Wsrep_replayer_service()
|
||||
DBUG_ASSERT(0);
|
||||
WSREP_ERROR("trx_replay failed for: %d, schema: %s, query: %s",
|
||||
m_replay_status,
|
||||
orig_thd->db.str, WSREP_QUERY(orig_thd));
|
||||
orig_thd->db.str, wsrep_thd_query(orig_thd));
|
||||
unireg_abort(1);
|
||||
}
|
||||
}
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2008-2015 Codership Oy <http://www.codership.com>
|
||||
/* Copyright 2008-2021 Codership Oy <http://www.codership.com>
|
||||
Copyright (c) 2020, 2021, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@ -2576,12 +2576,29 @@ static int wsrep_TOI_begin(THD *thd, const char *db, const char *table,
|
||||
wsrep_thd_query(thd));
|
||||
my_error(ER_ERROR_DURING_COMMIT, MYF(0), WSREP_SIZE_EXCEEDED);
|
||||
break;
|
||||
default:
|
||||
case wsrep::e_deadlock_error:
|
||||
WSREP_WARN("TO isolation failed for: %d, schema: %s, sql: %s. "
|
||||
"Check wsrep connection state and retry the query.",
|
||||
"Deadlock error.",
|
||||
ret,
|
||||
(thd->db.str ? thd->db.str : "(null)"),
|
||||
wsrep_thd_query(thd));
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0));
|
||||
break;
|
||||
case wsrep::e_timeout_error:
|
||||
WSREP_WARN("TO isolation failed for: %d, schema: %s, sql: %s. "
|
||||
"Operation timed out.",
|
||||
ret,
|
||||
(thd->db.str ? thd->db.str : "(null)"),
|
||||
wsrep_thd_query(thd));
|
||||
my_error(ER_LOCK_WAIT_TIMEOUT, MYF(0));
|
||||
break;
|
||||
default:
|
||||
WSREP_WARN("TO isolation failed for: %d, schema: %s, sql: %s. "
|
||||
"Check your wsrep connection state and retry the query.",
|
||||
ret,
|
||||
(thd->db.str ? thd->db.str : "(null)"),
|
||||
wsrep_thd_query(thd));
|
||||
|
||||
if (!thd->is_error())
|
||||
{
|
||||
my_error(ER_LOCK_DEADLOCK, MYF(0), "WSREP replication failed. Check "
|
||||
@ -2776,13 +2793,6 @@ int wsrep_to_isolation_begin(THD *thd, const char *db_, const char *table_,
|
||||
thd->variables.auto_increment_increment= 1;
|
||||
}
|
||||
|
||||
/*
|
||||
TOI operations will ignore provided lock_wait_timeout and restore it
|
||||
after operation is done.
|
||||
*/
|
||||
thd->variables.saved_lock_wait_timeout= thd->variables.lock_wait_timeout;
|
||||
thd->variables.lock_wait_timeout= LONG_TIMEOUT;
|
||||
|
||||
if (thd->variables.wsrep_on && wsrep_thd_is_local(thd))
|
||||
{
|
||||
switch (wsrep_OSU_method_get(thd)) {
|
||||
@ -2799,8 +2809,19 @@ int wsrep_to_isolation_begin(THD *thd, const char *db_, const char *table_,
|
||||
ret= -1;
|
||||
break;
|
||||
}
|
||||
|
||||
switch (ret) {
|
||||
case 0: /* wsrep_TOI_begin should set toi mode */ break;
|
||||
case 0: /* wsrep_TOI_begin should set toi mode */
|
||||
if (thd->variables.wsrep_OSU_method == WSREP_OSU_TOI)
|
||||
{
|
||||
/*
|
||||
TOI operations ignore the provided lock_wait_timeout once replicated,
|
||||
and restore it after operation is done.
|
||||
*/
|
||||
thd->variables.saved_lock_wait_timeout= thd->variables.lock_wait_timeout;
|
||||
thd->variables.lock_wait_timeout= LONG_TIMEOUT;
|
||||
}
|
||||
break;
|
||||
case 1:
|
||||
/* TOI replication skipped, treat as success */
|
||||
ret= 0;
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright 2008-2017 Codership Oy <http://www.codership.com>
|
||||
/* Copyright 2008-2021 Codership Oy <http://www.codership.com>
|
||||
Copyright (c) 2020, 2021, MariaDB
|
||||
|
||||
This program is free software; you can redistribute it and/or modify
|
||||
@ -307,8 +307,6 @@ static inline bool wsrep_cluster_address_exists()
|
||||
return wsrep_cluster_address && wsrep_cluster_address[0];
|
||||
}
|
||||
|
||||
#define WSREP_QUERY(thd) (thd->query())
|
||||
|
||||
extern my_bool wsrep_ready_get();
|
||||
extern void wsrep_ready_wait();
|
||||
|
||||
|
@ -340,11 +340,20 @@ int wsrep_abort_thd(THD *bf_thd_ptr, THD *victim_thd_ptr, my_bool signal)
|
||||
DBUG_RETURN(1);
|
||||
}
|
||||
|
||||
bool wsrep_bf_abort(const THD* bf_thd, THD* victim_thd)
|
||||
bool wsrep_bf_abort(THD* bf_thd, THD* victim_thd)
|
||||
{
|
||||
WSREP_LOG_THD(bf_thd, "BF aborter before");
|
||||
WSREP_LOG_THD(victim_thd, "victim before");
|
||||
wsrep::seqno bf_seqno(bf_thd->wsrep_trx().ws_meta().seqno());
|
||||
|
||||
DBUG_EXECUTE_IF("sync.wsrep_bf_abort",
|
||||
{
|
||||
const char act[]=
|
||||
"now "
|
||||
"SIGNAL sync.wsrep_bf_abort_reached "
|
||||
"WAIT_FOR signal.wsrep_bf_abort";
|
||||
DBUG_ASSERT(!debug_sync_set_action(bf_thd,
|
||||
STRING_WITH_LEN(act)));
|
||||
};);
|
||||
|
||||
if (WSREP(victim_thd) && !victim_thd->wsrep_trx().active())
|
||||
{
|
||||
@ -368,6 +377,8 @@ bool wsrep_bf_abort(const THD* bf_thd, THD* victim_thd)
|
||||
}
|
||||
|
||||
bool ret;
|
||||
wsrep::seqno bf_seqno(bf_thd->wsrep_trx().ws_meta().seqno());
|
||||
|
||||
if (wsrep_thd_is_toi(bf_thd))
|
||||
{
|
||||
ret= victim_thd->wsrep_cs().total_order_bf_abort(bf_seqno);
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2013 Codership Oy <info@codership.com>
|
||||
/* Copyright (C) 2013-2021 Codership Oy <info@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
|
||||
@ -87,7 +87,7 @@ int wsrep_show_bf_aborts (THD *thd, SHOW_VAR *var, char *buff,
|
||||
bool wsrep_create_appliers(long threads, bool mutex_protected=false);
|
||||
void wsrep_create_rollbacker();
|
||||
|
||||
bool wsrep_bf_abort(const THD*, THD*);
|
||||
bool wsrep_bf_abort(THD* bf_thd, THD* victim_thd);
|
||||
int wsrep_abort_thd(THD *bf_thd_ptr, THD *victim_thd_ptr, my_bool signal);
|
||||
|
||||
extern void wsrep_thd_set_PA_safe(void *thd_ptr, my_bool safe);
|
||||
@ -292,7 +292,7 @@ static inline void wsrep_log_thd(const THD *thd,
|
||||
(thd->get_stmt_da()->is_error() ? thd->get_stmt_da()->message() : "")
|
||||
#ifdef WSREP_THD_LOG_QUERIES
|
||||
, thd->lex->sql_command,
|
||||
WSREP_QUERY(thd)
|
||||
wsrep_thd_query(thd)
|
||||
#endif /* WSREP_OBSERVER_LOG_QUERIES */
|
||||
);
|
||||
}
|
||||
|
@ -831,7 +831,7 @@ bool wsrep_desync_check (sys_var *self, THD* thd, set_var* var)
|
||||
ret= Wsrep_server_state::instance().provider().desync();
|
||||
if (ret) {
|
||||
WSREP_WARN ("SET desync failed %d for schema: %s, query: %s", ret,
|
||||
thd->db.str, WSREP_QUERY(thd));
|
||||
thd->db.str, wsrep_thd_query(thd));
|
||||
my_error (ER_CANNOT_USER, MYF(0), "'desync'", thd->query());
|
||||
return true;
|
||||
}
|
||||
|
@ -854,14 +854,16 @@ static void trx_purge_rseg_get_next_history_log(
|
||||
|
||||
trx_no = mach_read_from_8(log_hdr + TRX_UNDO_TRX_NO);
|
||||
ut_ad(mach_read_from_2(log_hdr + TRX_UNDO_NEEDS_PURGE) <= 1);
|
||||
const byte needs_purge = log_hdr[TRX_UNDO_NEEDS_PURGE + 1];
|
||||
|
||||
mtr_commit(&mtr);
|
||||
mtr.commit();
|
||||
|
||||
purge_sys.rseg->latch.wr_lock();
|
||||
|
||||
purge_sys.rseg->last_page_no = prev_log_addr.page;
|
||||
purge_sys.rseg->set_last_commit(prev_log_addr.boffset, trx_no);
|
||||
if (log_hdr[TRX_UNDO_NEEDS_PURGE + 1]) {
|
||||
|
||||
if (needs_purge) {
|
||||
purge_sys.rseg->set_needs_purge();
|
||||
} else {
|
||||
purge_sys.rseg->clear_needs_purge();
|
||||
|
@ -133,7 +133,6 @@ static int run_test(const char *filename)
|
||||
int key_length=8;
|
||||
int null_fields=0;
|
||||
int nrecords=sizeof(rt_data)/(sizeof(double)*4);/* 40 */
|
||||
int rec_length=0;
|
||||
int uniques=0;
|
||||
int i, max_i;
|
||||
int error;
|
||||
@ -154,7 +153,6 @@ static int run_test(const char *filename)
|
||||
|
||||
recinfo[0].type=FIELD_NORMAL;
|
||||
recinfo[0].length=1; /* For NULL bits */
|
||||
rec_length=1;
|
||||
|
||||
/* Define 2*ndims columns for coordinates*/
|
||||
|
||||
@ -162,7 +160,6 @@ static int run_test(const char *filename)
|
||||
{
|
||||
recinfo[i].type=FIELD_NORMAL;
|
||||
recinfo[i].length=key_length;
|
||||
rec_length+=key_length;
|
||||
}
|
||||
|
||||
/* Define a key with 2*ndims segments */
|
||||
|
@ -1,4 +1,4 @@
|
||||
/* Copyright (C) 2018 MariaDB corporation
|
||||
/* Copyright (C) 2018, 2021, MariaDB corporation.
|
||||
|
||||
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
|
||||
@ -178,7 +178,6 @@ static int create_test_table(const char *table_name, int type_of_table)
|
||||
int key_field=FIELD_SKIP_PRESPACE,extra_field=FIELD_SKIP_ENDSPACE;
|
||||
int key_type=HA_KEYTYPE_NUM;
|
||||
int create_flag=0;
|
||||
uint offset_to_key;
|
||||
uint pack_seg=0, pack_keys= 0;
|
||||
uint key_length;
|
||||
uchar record[MAX_REC_LENGTH];
|
||||
@ -303,10 +302,6 @@ static int create_test_table(const char *table_name, int type_of_table)
|
||||
else
|
||||
uniques=0;
|
||||
|
||||
offset_to_key= MY_TEST(null_fields);
|
||||
if (key_field == FIELD_BLOB || key_field == FIELD_VARCHAR)
|
||||
offset_to_key+= 2;
|
||||
|
||||
if (!silent)
|
||||
printf("- Creating Aria file\n");
|
||||
create_info.max_rows= 0;
|
||||
|
@ -104,7 +104,6 @@ static int run_test(const char *filename)
|
||||
int key_length=8;
|
||||
int null_fields=0;
|
||||
int nrecords=sizeof(rt_data)/(sizeof(double)*4);/* 3000;*/
|
||||
int rec_length=0;
|
||||
int uniques=0;
|
||||
int i, max_i;
|
||||
int error;
|
||||
@ -125,14 +124,12 @@ static int run_test(const char *filename)
|
||||
|
||||
recinfo[0].type=FIELD_NORMAL;
|
||||
recinfo[0].length=1; /* For NULL bits */
|
||||
rec_length=1;
|
||||
|
||||
/* Define 2*ndims columns for coordinates*/
|
||||
|
||||
for (i=1; i<=2*ndims ;i++){
|
||||
recinfo[i].type=FIELD_NORMAL;
|
||||
recinfo[i].length=key_length;
|
||||
rec_length+=key_length;
|
||||
}
|
||||
|
||||
/* Define a key with 2*ndims segments */
|
||||
|
Loading…
x
Reference in New Issue
Block a user