[Commits] Rev 4273: MDEV-6120: When slave stops with error, error message should indicate the failing GTID in http://bazaar.launchpad.net/~maria-captains/maria/10.0

knielsen at knielsen-hq.org knielsen at knielsen-hq.org
Mon Jul 7 12:17:06 EEST 2014


At http://bazaar.launchpad.net/~maria-captains/maria/10.0

------------------------------------------------------------
revno: 4273
revision-id: knielsen at knielsen-hq.org-20140707091705-nf0xh4cgrlggyiti
parent: jplindst at mariadb.org-20140704050927-7h2erk6q5kgmjvoc
committer: Kristian Nielsen <knielsen at knielsen-hq.org>
branch nick: tmp
timestamp: Mon 2014-07-07 11:17:05 +0200
message:
  MDEV-6120: When slave stops with error, error message should indicate the failing GTID
  
  Follow-up patch. The original patch added an extra argument to the
  rli->report() function, however it was forgotten to adjust the calls
  accordingly in a few places.
  
  This patch updates the remaining calls as needed. In files log_event_old.cc
  and rpl_record_old.cc, it just adds NULL, since this is only for old event
  formats from ancient master servers, which would not have any GTID information
  to add to the error messages in any case.
=== modified file 'sql/log_event_old.cc'
--- a/sql/log_event_old.cc	2014-06-25 13:17:03 +0000
+++ b/sql/log_event_old.cc	2014-07-07 09:17:05 +0000
@@ -108,7 +108,7 @@ Old_rows_log_event::do_apply_event(Old_r
           Error reporting borrowed from Query_log_event with many excessive
           simplifications (we don't honour --slave-skip-errors)
         */
-        rli->report(ERROR_LEVEL, actual_error,
+        rli->report(ERROR_LEVEL, actual_error, NULL,
                     "Error '%s' on opening tables",
                     (actual_error ? ev_thd->get_stmt_da()->message() :
                      "unexpected success or fatal error"));
@@ -233,7 +233,7 @@ Old_rows_log_event::do_apply_event(Old_r
   break;
 
       default:
-  rli->report(ERROR_LEVEL, ev_thd->get_stmt_da()->sql_errno(),
+  rli->report(ERROR_LEVEL, ev_thd->get_stmt_da()->sql_errno(), NULL,
                     "Error in %s event: row application failed. %s",
                     ev->get_type_str(),
                     ev_thd->is_error() ? ev_thd->get_stmt_da()->message() : "");
@@ -250,7 +250,7 @@ Old_rows_log_event::do_apply_event(Old_r
 
   if (error)
   {                     /* error has occured during the transaction */
-    rli->report(ERROR_LEVEL, ev_thd->get_stmt_da()->sql_errno(),
+    rli->report(ERROR_LEVEL, ev_thd->get_stmt_da()->sql_errno(), NULL,
                 "Error in %s event: error during transaction execution "
                 "on table %s.%s. %s",
                 ev->get_type_str(), table->s->db.str,
@@ -1498,7 +1498,7 @@ int Old_rows_log_event::do_apply_event(r
           simplifications (we don't honour --slave-skip-errors)
         */
         uint actual_error= thd->net.last_errno;
-        rli->report(ERROR_LEVEL, actual_error,
+        rli->report(ERROR_LEVEL, actual_error, NULL,
                     "Error '%s' in %s event: when locking tables",
                     (actual_error ? thd->net.last_error :
                      "unexpected success or fatal error"),
@@ -1507,7 +1507,7 @@ int Old_rows_log_event::do_apply_event(r
       }
       else
       {
-        rli->report(ERROR_LEVEL, error,
+        rli->report(ERROR_LEVEL, error, NULL,
                     "Error in %s event: when locking tables",
                     get_type_str());
       }
@@ -1653,7 +1653,7 @@ int Old_rows_log_event::do_apply_event(r
         break;
 
       default:
-        rli->report(ERROR_LEVEL, thd->net.last_errno,
+        rli->report(ERROR_LEVEL, thd->net.last_errno, NULL,
                     "Error in %s event: row application failed. %s",
                     get_type_str(),
                     thd->net.last_error ? thd->net.last_error : "");
@@ -1691,7 +1691,7 @@ int Old_rows_log_event::do_apply_event(r
 
   if (error)
   {                     /* error has occured during the transaction */
-    rli->report(ERROR_LEVEL, thd->net.last_errno,
+    rli->report(ERROR_LEVEL, thd->net.last_errno, NULL,
                 "Error in %s event: error during transaction execution "
                 "on table %s.%s. %s",
                 get_type_str(), table->s->db.str,
@@ -1774,7 +1774,7 @@ int Old_rows_log_event::do_apply_event(r
     */
     DBUG_ASSERT(! thd->transaction_rollback_request);
     if ((error= (binlog_error ? trans_rollback_stmt(thd) : trans_commit_stmt(thd))))
-      rli->report(ERROR_LEVEL, error,
+      rli->report(ERROR_LEVEL, error, NULL,
                   "Error in %s event: commit of row events failed, "
                   "table `%s`.`%s`",
                   get_type_str(), m_table->s->db.str,

=== modified file 'sql/rpl_record.cc'
--- a/sql/rpl_record.cc	2014-02-26 14:28:07 +0000
+++ b/sql/rpl_record.cc	2014-07-07 09:17:05 +0000
@@ -317,6 +317,7 @@ unpack_row(rpl_group_info *rgi,
         if (!pack_ptr)
         {
           rgi->rli->report(ERROR_LEVEL, ER_SLAVE_CORRUPT_EVENT,
+                      rgi->gtid_info(),
                       "Could not read field '%s' of table '%s.%s'",
                       f->field_name, table->s->db.str,
                       table->s->table_name.str);

=== modified file 'sql/rpl_record_old.cc'
--- a/sql/rpl_record_old.cc	2013-09-16 12:33:49 +0000
+++ b/sql/rpl_record_old.cc	2014-07-07 09:17:05 +0000
@@ -141,7 +141,7 @@ unpack_row_old(rpl_group_info *rgi,
       f->move_field_offset(-offset);
       if (!ptr)
       {
-        rgi->rli->report(ERROR_LEVEL, ER_SLAVE_CORRUPT_EVENT,
+        rgi->rli->report(ERROR_LEVEL, ER_SLAVE_CORRUPT_EVENT, NULL,
                     "Could not read field `%s` of table `%s`.`%s`",
                     f->field_name, table->s->db.str,
                     table->s->table_name.str);
@@ -183,7 +183,7 @@ unpack_row_old(rpl_group_info *rgi,
     if (event_type == WRITE_ROWS_EVENT &&
         ((*field_ptr)->flags & mask) == mask)
     {
-      rgi->rli->report(ERROR_LEVEL, ER_NO_DEFAULT_FOR_FIELD,
+      rgi->rli->report(ERROR_LEVEL, ER_NO_DEFAULT_FOR_FIELD, NULL,
                   "Field `%s` of table `%s`.`%s` "
                   "has no default value and cannot be NULL",
                   (*field_ptr)->field_name, table->s->db.str,



More information about the commits mailing list