List:Commits« Previous MessageNext Message »
From:Frazer Clement Date:March 16 2012 6:13pm
Subject:bzr push into mysql-trunk branch (frazer.clement:3732 to 3733) WL#6003
View as plain text  
 3733 Frazer Clement	2012-03-16
      WL#6003 Support silent slave transaction retries
      
      Support handler returning temporary error and warning resulting in 
      silent slave transaction retry.

    modified:
      sql/log_event.cc
      sql/rpl_slave.h
 3732 Marc Alff	2012-03-08
      Bug#13819132 BROKEN SYNTAX ACCEPTED FOR START TRANSACTION
      
      Before this fix, the parser accepted the following syntax
      for START TRANSACTION :
      
      START TRANSACTION ,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,,, ;
      
      The root cause was the bison grammar for rule start_transaction_opt_list,
      which produced a list of valid options or (empty string),
      separated by ",".
      
      The grammar has been fixed so that the grammar rule is:
      - either en empty string
      - or a list of valid options separated by ",".
      which is the proper syntax.
      
      Grammar rules have been renamed for code clarity.

    modified:
      mysql-test/r/parser.result
      mysql-test/t/parser.test
      sql/sql_yacc.yy
=== modified file 'sql/log_event.cc'
--- a/sql/log_event.cc	2012-03-06 14:29:42 +0000
+++ b/sql/log_event.cc	2012-03-16 17:44:44 +0000
@@ -4261,6 +4261,22 @@ int Query_log_event::do_apply_event(Rela
   return do_apply_event(rli, query, q_len);
 }
 
+#ifdef HAVE_NDB_BINLOG
+
+static bool is_silent_error(THD* thd)
+{
+  DBUG_ENTER("is_silent_error");
+  if (thd->get_stmt_da()->has_sql_condition(SLAVE_SILENT_RETRY_MSG, 
+                                            strlen(SLAVE_SILENT_RETRY_MSG)))
+  {
+    DBUG_PRINT("info", ("Silent retry"));
+    DBUG_RETURN(true);
+  }
+  DBUG_RETURN(false);
+}
+
+// #ifdef HAVE_NDB_BINLOG
+#endif
 
 /**
   @todo
@@ -4610,12 +4626,20 @@ Default database: '%s'. Query: '%s'",
     */
     else if (thd->is_slave_error || thd->is_fatal_error)
     {
-      rli->report(ERROR_LEVEL, actual_error,
-                      "Error '%s' on query. Default database: '%s'. Query: '%s'",
-                      (actual_error ? thd->get_stmt_da()->message() :
-                       "unexpected success or fatal error"),
-                      print_slave_db_safe(thd->db), query_arg);
-      thd->is_slave_error= 1;
+#ifdef HAVE_NDB_BINLOG
+      bool be_silent = false;
+      be_silent = is_silent_error(thd);
+      if (!be_silent)
+#endif
+      {
+        /* We are silent about TEMPORARY_ERRMSG */
+        rli->report(ERROR_LEVEL, actual_error,
+                        "Error '%s' on query. Default database: '%s'. Query: '%s'",
+                        (actual_error ? thd->get_stmt_da()->message() :
+                         "unexpected success or fatal error"),
+                        print_slave_db_safe(thd->db), query_arg);
+        thd->is_slave_error= 1;
+      }
     }
 
     /*

=== modified file 'sql/rpl_slave.h'
--- a/sql/rpl_slave.h	2012-03-08 09:44:21 +0000
+++ b/sql/rpl_slave.h	2012-03-16 17:44:44 +0000
@@ -252,6 +252,10 @@ extern I_List<THD> threads;
 bool mts_recovery_groups(Relay_log_info *rli, MY_BITMAP *groups);
 bool mts_checkpoint_routine(Relay_log_info *rli, ulonglong period,
                             bool force, bool locked);
+#ifdef HAVE_NDB_BINLOG
+#define SLAVE_SILENT_RETRY_MSG "Slave transaction rollback requested"
+#endif
+
 #endif /* HAVE_REPLICATION */
 
 /* masks for start/stop operations on io and sql slave threads */

No bundle (reason: useless for push emails).
Thread
bzr push into mysql-trunk branch (frazer.clement:3732 to 3733) WL#6003Frazer Clement16 Mar