summaryrefslogtreecommitdiff
path: root/sql/rpl_rli.cc
diff options
context:
space:
mode:
authorLuis Soares <luis.soares@oracle.com>2011-11-11 17:26:56 +0000
committerLuis Soares <luis.soares@oracle.com>2011-11-11 17:26:56 +0000
commit595a007d4e570f935ffc396aeb62480c2f414741 (patch)
tree0ac14b7cf5867002b4c6db32ddd297c5ea169bc9 /sql/rpl_rli.cc
parent4714b9d1c6a440cef0a7bd4027b37f0c35bbca81 (diff)
downloadmariadb-git-595a007d4e570f935ffc396aeb62480c2f414741.tar.gz
BUG#11760927: 53375: RBR + NO PK => HIGH LOAD ON SLAVE (TABLE
SCAN/CPU) => SLAVE FAILURE When a statement containing a large amount of ROWs to be applied on the slave, and the slave's table does not contain a PK, it can take a considerable amount of time to find and change all the rows that are to be changed. The proper slave enhancement will be implemented in WL 5597. However, in this bug we are making it clear to the user what the problem is, by printing a message to the error log if the execution time, for a given statement in RBR, takes more than LONG_FIND_ROW_THRESHOLD (set to 60 seconds). This shall help the DBA to diagnose what's happening when facing a slave server that is quiet for no apparent reason... The note is only printed to the error log if log_warnings is set to be greater than 1.
Diffstat (limited to 'sql/rpl_rli.cc')
-rw-r--r--sql/rpl_rli.cc9
1 files changed, 9 insertions, 0 deletions
diff --git a/sql/rpl_rli.cc b/sql/rpl_rli.cc
index e1c764a4248..0000ba9abb7 100644
--- a/sql/rpl_rli.cc
+++ b/sql/rpl_rli.cc
@@ -1245,6 +1245,15 @@ void Relay_log_info::cleanup_context(THD *thd, bool error)
*/
thd->variables.option_bits&= ~OPTION_NO_FOREIGN_KEY_CHECKS;
thd->variables.option_bits&= ~OPTION_RELAXED_UNIQUE_CHECKS;
+
+ /*
+ Reset state related to long_find_row notes in the error log:
+ - timestamp
+ - flag that decides whether the slave prints or not
+ */
+ reset_row_stmt_start_timestamp();
+ unset_long_find_row_note_printed();
+
DBUG_VOID_RETURN;
}