Commit 9d1546fe authored by Seppo Jaakola's avatar Seppo Jaakola

References: MDEV-4572 - merge with lp:codership-mysql/5.5-23 revisions 3858..3867

parent 48af4be6
......@@ -227,7 +227,7 @@ wsrep_recover_position() {
log_notice "WSREP: Running position recovery with --log_error=$wr_logfile"
$mysqld_cmd --log_error=$wr_logfile --wsrep-recover
eval_log_error $mysqld_cmd --log_error=$wr_logfile --wsrep-recover
local rp="$(grep 'WSREP: Recovered position:' $wr_logfile)"
if [ -z "$rp" ]; then
......
......@@ -91,7 +91,7 @@ wsrep_log()
# echo everything to stderr so that it gets into common error log
# deliberately made to look different from the rest of the log
local readonly tst="$(date +%Y%m%d\ %H:%M:%S.%N | cut -b -21)"
echo "WSREP_SST: $* ($tst)" >>/dev/stderr
echo "WSREP_SST: $* ($tst)" >&2
}
wsrep_log_error()
......
......@@ -38,12 +38,12 @@ local_ip()
return 1
}
if test -z "$WSREP_SST_OPT_USER"; then err "USER cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_HOST"; then err "HOST cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_PORT"; then err "PORT cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_LPORT"; then err "LPORT cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_SOCKET";then err "SOCKET cannot be nil";exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_GTID"; then err "GTID cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_USER"; then wsrep_log_error "USER cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_HOST"; then wsrep_log_error "HOST cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_PORT"; then wsrep_log_error "PORT cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_LPORT"; then wsrep_log_error "LPORT cannot be nil"; exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_SOCKET";then wsrep_log_error "SOCKET cannot be nil";exit $EINVAL; fi
if test -z "$WSREP_SST_OPT_GTID"; then wsrep_log_error "GTID cannot be nil"; exit $EINVAL; fi
if local_ip $WSREP_SST_OPT_HOST && \
[ "$WSREP_SST_OPT_PORT" = "$WSREP_SST_OPT_LPORT" ]
......@@ -57,7 +57,7 @@ fi
if ! mysql --version | grep 'Distrib 5.5' >/dev/null
then
mysql --version >&2
err "this operation requires MySQL client version 5.5.x"
wsrep_log_error "this operation requires MySQL client version 5.5.x"
exit $EINVAL
fi
......
......@@ -32,7 +32,7 @@ cleanup_joiner()
rm -rf "$RSYNC_CONF"
rm -rf "$MAGIC_FILE"
rm -rf "$RSYNC_PID"
echo " done." >&2
wsrep_log_info "Joiner cleanup done."
}
check_pid()
......
......@@ -98,16 +98,9 @@ then
if [ $WSREP_SST_OPT_BYPASS -eq 0 ]
then
TMPDIR=${TMPDIR:-""}
if [ -z "${TMPDIR}" ]; then
# try to get it from my.cnf
TMPDIR=$(grep -E '^\s*tmpdir' $WSREP_SST_OPT_CONF | \
awk -F = '{ print $2 }' | sed 's/^\s//g' | sed 's/\s.*//g' )
# if failed default to /tmp
[ -z "${TMPDIR}" ] && TMPDIR="/tmp"
fi
TMPDIR=${TMPDIR:-"/tmp"}
INNOBACKUPEX_ARGS="--galera-info --tmpdir=${TMPDIR} --stream=tar
INNOBACKUPEX_ARGS="--galera-info --stream=tar
--defaults-file=${WSREP_SST_OPT_CONF}
--socket=${WSREP_SST_OPT_SOCKET}"
......
......@@ -1073,6 +1073,8 @@ bool Optimize_table_statement::execute(THD *thd)
FALSE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL)
res= (specialflag & (SPECIAL_SAFE_MODE | SPECIAL_NO_NEW_FUNC)) ?
mysql_recreate_table(thd, first_table) :
mysql_admin_table(thd, first_table, &m_lex->check_opt,
......@@ -1104,6 +1106,7 @@ bool Repair_table_statement::execute(THD *thd)
FALSE, UINT_MAX, FALSE))
goto error; /* purecov: inspected */
thd->enable_slow_log= opt_log_slow_admin_statements;
WSREP_TO_ISOLATION_BEGIN(first_table->db, first_table->table_name, NULL)
res= mysql_admin_table(thd, first_table, &m_lex->check_opt, "repair",
TL_WRITE, 1,
test(m_lex->check_opt.sql_flags & TT_USEFRM),
......
......@@ -3658,7 +3658,8 @@ bool select_insert::send_eof()
trans_table, table->file->table_type()));
#ifdef WITH_WSREP
error= (thd->wsrep_conflict_state == MUST_ABORT) ? -1 :
error= (thd->wsrep_conflict_state == MUST_ABORT ||
thd->wsrep_conflict_state == CERT_FAILURE) ? -1 :
(thd->locked_tables_mode <= LTM_LOCK_TABLES ?
table->file->ha_end_bulk_insert() : 0);
#else
......@@ -4249,6 +4250,18 @@ bool select_create::send_eof()
{
trans_commit_stmt(thd);
trans_commit_implicit(thd);
#ifdef WITH_WSREP
mysql_mutex_lock(&thd->LOCK_wsrep_thd);
if (thd->wsrep_conflict_state != NO_CONFLICT)
{
WSREP_DEBUG("select_create commit failed, thd: %lu err: %d %s",
thd->thread_id, thd->wsrep_conflict_state, thd->query());
mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
abort_result_set();
return TRUE;
}
mysql_mutex_unlock(&thd->LOCK_wsrep_thd);
#endif /* WITH_WSREP */
}
table->file->extra(HA_EXTRA_NO_IGNORE_DUP_KEY);
......
......@@ -321,6 +321,7 @@ wsrep_run_wsrep_commit(
{
WSREP_DEBUG("empty rbr buffer, query: %s", thd->query());
}
thd->wsrep_query_state= QUERY_EXEC;
DBUG_RETURN(WSREP_TRX_OK);
}
if (WSREP_UNDEFINED_TRX_ID == thd->wsrep_trx_handle.trx_id)
......
......@@ -937,7 +937,7 @@ static int sst_donate_other (const char* method,
{
WSREP_ERROR("sst_donate_other(): pthread_create() failed: %d (%s)",
ret, strerror(ret));
return ret;
return -ret;
}
mysql_cond_wait (&arg.cond, &arg.lock);
......
......@@ -353,10 +353,8 @@ size_t guess_ip (char* buf, size_t buf_len)
// try to find the address of the first one
#if (TARGET_OS_LINUX == 1)
const char cmd[] = "/sbin/ifconfig | "
// "grep -m1 -1 -E '^[a-z]?eth[0-9]' | tail -n 1 | "
"grep -E '^[[:space:]]+inet addr:' | grep -m1 -v 'inet addr:127' | "
"sed 's/:/ /' | awk '{ print $3 }'";
const char cmd[] = "ip addr show | grep -E '^\\s*inet' | grep -m1 global |"
" awk '{ print $2 }' | sed 's/\\/.*//'";
#elif defined(__sun__)
const char cmd[] = "/sbin/ifconfig -a | "
"/usr/gnu/bin/grep -m1 -1 -E 'net[0-9]:' | tail -n 1 | awk '{ print $2 }'";
......
......@@ -4513,7 +4513,7 @@ wsrep_innobase_mysql_sort(
memcpy(tmp_str, str, str_length);
tmp_length = charset->coll->strnxfrm(charset, str, str_length,
tmp_str, tmp_length);
tmp_str, str_length);
DBUG_ASSERT(tmp_length == str_length);
break;
......
......@@ -5666,6 +5666,11 @@ lock_rec_convert_impl_to_expl(
implicit lock. Because cannot lock at this moment.*/
if (rec_get_deleted_flag(rec, rec_offs_comp(offsets))
#ifdef WITH_WSREP
&& !wsrep_thd_is_brute_force(impl_trx->mysql_thd)
/* BF-BF conflict is possible if advancing into
lock_rec_other_has_conflicting*/
#endif /* WITH_WSREP */
&& lock_rec_other_has_conflicting(
LOCK_X | LOCK_REC_NOT_GAP, block,
heap_no, impl_trx)) {
......
......@@ -5176,7 +5176,7 @@ wsrep_innobase_mysql_sort(
memcpy(tmp_str, str, str_length);
tmp_length = charset->coll->strnxfrm(charset, str, str_length,
tmp_str, tmp_length);
tmp_str, str_length);
DBUG_ASSERT(tmp_length == str_length);
break;
......
......@@ -5691,6 +5691,11 @@ lock_rec_convert_impl_to_expl(
implicit lock. Because cannot lock at this moment.*/
if (rec_get_deleted_flag(rec, rec_offs_comp(offsets))
#ifdef WITH_WSREP
&& !wsrep_thd_is_brute_force(impl_trx->mysql_thd)
/* BF-BF conflict is possible if advancing into
lock_rec_other_has_conflicting*/
#endif /* WITH_WSREP */
&& lock_rec_other_has_conflicting(
LOCK_X | LOCK_REC_NOT_GAP, block,
heap_no, impl_trx)) {
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment