[Commits] Rev 4494: MDEV-7080: rpl.rpl_gtid_crash fails sporadically in buildbot in http://bazaar.launchpad.net/~maria-captains/maria/10.0

knielsen at knielsen-hq.org knielsen at knielsen-hq.org
Mon Nov 17 09:53:43 EET 2014


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

------------------------------------------------------------
revno: 4494
revision-id: knielsen at knielsen-hq.org-20141117075342-ngk26kc59cg7p27y
parent: jplindst at mariadb.org-20141114071313-fcdbmb02ei72d16y
committer: Kristian Nielsen <knielsen at knielsen-hq.org>
branch nick: work-10.0
timestamp: Mon 2014-11-17 08:53:42 +0100
message:
  MDEV-7080: rpl.rpl_gtid_crash fails sporadically in buildbot
  
  The real problem here was inconsistent handling of entry->commit_errno in
  MYSQL_BIN_LOG::write_transaction_or_stmt(). Some return paths were setting it
  to the value of errno, some where not. And the setting was redundant anyway,
  as it is set consistently by the caller.
  
  Fix by consistently setting it in the caller, and not in each return path in
  the function.
  
  The test failure happened because a DBUG_EXECUTE_IF() used in the test case
  set an entry->commit_errno that was immediately overwritten in the caller with
  whatever happened to be the value of errno. This could lead to different error
  message in the .result file.
=== modified file 'mysql-test/suite/rpl/r/rpl_gtid_crash.result'
--- a/mysql-test/suite/rpl/r/rpl_gtid_crash.result	2014-09-02 12:07:01 +0000
+++ b/mysql-test/suite/rpl/r/rpl_gtid_crash.result	2014-11-17 07:53:42 +0000
@@ -124,7 +124,7 @@ SET GLOBAL debug_dbug="+d,inject_error_w
 BEGIN;
 INSERT INTO t1 VALUES (11);
 COMMIT;
-ERROR HY000: Error writing file 'master-bin' (errno: 11 "Resource temporarily unavailable")
+ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
 SET GLOBAL debug_dbug="+d,crash_dispatch_command_before";
 COMMIT;
 Got one of the listed errors
@@ -141,7 +141,7 @@ SET GLOBAL debug_dbug="+d,inject_error_w
 BEGIN;
 INSERT INTO t1 VALUES (12);
 COMMIT;
-ERROR HY000: Error writing file 'master-bin' (errno: 11 "Resource temporarily unavailable")
+ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
 SET GLOBAL debug_dbug="+d,crash_dispatch_command_before";
 COMMIT;
 Got one of the listed errors
@@ -164,7 +164,7 @@ SET GLOBAL debug_dbug="+d,inject_error_w
 BEGIN;
 INSERT INTO t1 VALUES (21);
 COMMIT;
-ERROR HY000: Error writing file 'master-bin' (errno: 11 "Resource temporarily unavailable")
+ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
 SET GLOBAL debug_dbug="+d,crash_dispatch_command_before";
 COMMIT;
 Got one of the listed errors
@@ -185,7 +185,7 @@ SET GLOBAL debug_dbug="+d,inject_error_w
 BEGIN;
 INSERT INTO t1 VALUES (22);
 COMMIT;
-ERROR HY000: Error writing file 'master-bin' (errno: 11 "Resource temporarily unavailable")
+ERROR HY000: Error writing file 'master-bin' (errno: 28 "No space left on device")
 SET GLOBAL debug_dbug="+d,crash_dispatch_command_before";
 COMMIT;
 Got one of the listed errors

=== modified file 'sql/log.cc'
--- a/sql/log.cc	2014-11-13 09:31:20 +0000
+++ b/sql/log.cc	2014-11-17 07:53:42 +0000
@@ -7437,7 +7437,6 @@ MYSQL_BIN_LOG::write_transaction_or_stmt
       write_cache(entry->thd, mngr->get_binlog_cache_log(FALSE)))
   {
     entry->error_cache= &mngr->stmt_cache.cache_log;
-    entry->commit_errno= errno;
     DBUG_RETURN(ER_ERROR_ON_WRITE);
   }
 
@@ -7458,7 +7457,6 @@ MYSQL_BIN_LOG::write_transaction_or_stmt
     if (write_cache(entry->thd, mngr->get_binlog_cache_log(TRUE)))
     {
       entry->error_cache= &mngr->trx_cache.cache_log;
-      entry->commit_errno= errno;
       DBUG_RETURN(ER_ERROR_ON_WRITE);
     }
   }
@@ -7466,14 +7464,13 @@ MYSQL_BIN_LOG::write_transaction_or_stmt
   DBUG_EXECUTE_IF("inject_error_writing_xid",
                   {
                     entry->error_cache= NULL;
-                    entry->commit_errno= 28;
+                    errno= 28;
                     DBUG_RETURN(ER_ERROR_ON_WRITE);
                   });
 
   if (entry->end_event->write(&log_file))
   {
     entry->error_cache= NULL;
-    entry->commit_errno= errno;
     DBUG_RETURN(ER_ERROR_ON_WRITE);
   }
   status_var_add(entry->thd->status_var.binlog_bytes_written,
@@ -7484,7 +7481,6 @@ MYSQL_BIN_LOG::write_transaction_or_stmt
     if (entry->incident_event->write(&log_file))
     {
       entry->error_cache= NULL;
-      entry->commit_errno= errno;
       DBUG_RETURN(ER_ERROR_ON_WRITE);
     }
   }
@@ -7492,13 +7488,11 @@ MYSQL_BIN_LOG::write_transaction_or_stmt
   if (mngr->get_binlog_cache_log(FALSE)->error) // Error on read
   {
     entry->error_cache= &mngr->stmt_cache.cache_log;
-    entry->commit_errno= errno;
     DBUG_RETURN(ER_ERROR_ON_WRITE);
   }
   if (mngr->get_binlog_cache_log(TRUE)->error)  // Error on read
   {
     entry->error_cache= &mngr->trx_cache.cache_log;
-    entry->commit_errno= errno;
     DBUG_RETURN(ER_ERROR_ON_WRITE);
   }
 



More information about the commits mailing list