summaryrefslogtreecommitdiff
path: root/sql
diff options
context:
space:
mode:
Diffstat (limited to 'sql')
-rw-r--r--sql/handler.cc4
-rw-r--r--sql/sql_class.h2
-rw-r--r--sql/wsrep_sst.cc39
3 files changed, 37 insertions, 8 deletions
diff --git a/sql/handler.cc b/sql/handler.cc
index 87803846010..36babb96415 100644
--- a/sql/handler.cc
+++ b/sql/handler.cc
@@ -3418,8 +3418,8 @@ void handler::print_error(int error, myf errflag)
break;
case HA_ERR_ABORTED_BY_USER:
{
- DBUG_ASSERT(table->in_use->killed);
- table->in_use->send_kill_message();
+ DBUG_ASSERT(ha_thd()->killed);
+ ha_thd()->send_kill_message();
DBUG_VOID_RETURN;
}
case HA_ERR_WRONG_MRG_TABLE_DEF:
diff --git a/sql/sql_class.h b/sql/sql_class.h
index b377d74445f..6663d9e3b34 100644
--- a/sql/sql_class.h
+++ b/sql/sql_class.h
@@ -5809,8 +5809,6 @@ inline int handler::ha_ft_read(uchar *buf)
inline int handler::ha_rnd_pos_by_record(uchar *buf)
{
int error= rnd_pos_by_record(buf);
- if (!error)
- update_rows_read();
table->status=error ? STATUS_NOT_FOUND: 0;
return error;
}
diff --git a/sql/wsrep_sst.cc b/sql/wsrep_sst.cc
index a4832ce913b..a504d2eafd3 100644
--- a/sql/wsrep_sst.cc
+++ b/sql/wsrep_sst.cc
@@ -30,6 +30,8 @@
#include <cstdio>
#include <cstdlib>
+#include <my_service_manager.h>
+
static char wsrep_defaults_file[FN_REFLEN * 2 + 10 + 30 +
sizeof(WSREP_SST_OPT_CONF) +
sizeof(WSREP_SST_OPT_CONF_SUFFIX) +
@@ -177,6 +179,9 @@ bool wsrep_before_SE()
static bool sst_complete = false;
static bool sst_needed = false;
+#define WSREP_EXTEND_TIMEOUT_INTERVAL 30
+#define WSREP_TIMEDWAIT_SECONDS 10
+
void wsrep_sst_grab ()
{
WSREP_INFO("wsrep_sst_grab()");
@@ -188,11 +193,25 @@ void wsrep_sst_grab ()
// Wait for end of SST
bool wsrep_sst_wait ()
{
- if (mysql_mutex_lock (&LOCK_wsrep_sst)) abort();
+ struct timespec wtime = {WSREP_TIMEDWAIT_SECONDS, 0};
+ uint32 total_wtime = 0;
+
+ if (mysql_mutex_lock (&LOCK_wsrep_sst))
+ abort();
+
+ WSREP_INFO("Waiting for SST to complete.");
+
while (!sst_complete)
{
- WSREP_INFO("Waiting for SST to complete.");
- mysql_cond_wait (&COND_wsrep_sst, &LOCK_wsrep_sst);
+ mysql_cond_timedwait (&COND_wsrep_sst, &LOCK_wsrep_sst, &wtime);
+
+ if (!sst_complete)
+ {
+ total_wtime += wtime.tv_sec;
+ WSREP_DEBUG("Waiting for SST to complete. waited %u secs.", total_wtime);
+ service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL,
+ "WSREP state transfer ongoing, current seqno: %ld", local_seqno);
+ }
}
if (local_seqno >= 0)
@@ -1347,10 +1366,22 @@ void wsrep_SE_init_grab()
void wsrep_SE_init_wait()
{
+ struct timespec wtime = {WSREP_TIMEDWAIT_SECONDS, 0};
+ uint32 total_wtime=0;
+
while (SE_initialized == false)
{
- mysql_cond_wait (&COND_wsrep_sst_init, &LOCK_wsrep_sst_init);
+ mysql_cond_timedwait (&COND_wsrep_sst_init, &LOCK_wsrep_sst_init, &wtime);
+
+ if (!SE_initialized)
+ {
+ total_wtime += wtime.tv_sec;
+ WSREP_DEBUG("Waiting for SST to complete. waited %u secs.", total_wtime);
+ service_manager_extend_timeout(WSREP_EXTEND_TIMEOUT_INTERVAL,
+ "WSREP SE initialization ongoing.");
+ }
}
+
mysql_mutex_unlock (&LOCK_wsrep_sst_init);
}