diff options
Diffstat (limited to 'sql/rpl_gtid.cc')
-rw-r--r-- | sql/rpl_gtid.cc | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/sql/rpl_gtid.cc b/sql/rpl_gtid.cc index f17ece298d3..b57eb208580 100644 --- a/sql/rpl_gtid.cc +++ b/sql/rpl_gtid.cc @@ -1911,10 +1911,14 @@ gtid_waiting::wait_for_pos(THD *thd, String *gtid_str, longlong timeout_us) rpl_gtid *wait_pos; uint32 count, i; struct timespec wait_until, *wait_until_ptr; + ulonglong before; /* Wait for the empty position returns immediately. */ if (gtid_str->length() == 0) + { + status_var_increment(thd->status_var.master_gtid_wait_count); return 0; + } if (!(wait_pos= gtid_parse_string_to_list(gtid_str->ptr(), gtid_str->length(), &count))) @@ -1922,6 +1926,8 @@ gtid_waiting::wait_for_pos(THD *thd, String *gtid_str, longlong timeout_us) my_error(ER_INCORRECT_GTID_STATE, MYF(0)); return 1; } + status_var_increment(thd->status_var.master_gtid_wait_count); + before = microsecond_interval_timer(); if (timeout_us >= 0) { @@ -1936,6 +1942,13 @@ gtid_waiting::wait_for_pos(THD *thd, String *gtid_str, longlong timeout_us) if ((err= wait_for_gtid(thd, &wait_pos[i], wait_until_ptr))) break; } + switch (err) + { + case -1: + status_var_increment(thd->status_var.master_gtid_wait_timeouts); + case 0: /* deliberate fall through */ + status_var_add(thd->status_var.master_gtid_wait_time, microsecond_interval_timer() - before); + } my_free(wait_pos); return err; } |