List:Commits« Previous MessageNext Message »
From:He Zhenxing Date:July 16 2009 9:00am
Subject:bzr commit into mysql-5.4 branch (zhenxing.he:2827) Bug#45819
View as plain text  
#At file:///media/sdb2/hezx/work/mysql/bzrwork/b45819/azalea-bugfixing/ based on revid:alik@stripped

 2827 He Zhenxing	2009-07-16
      BUG#45819 Semisynchronous replication: unstable operation with row-based binlog
      
      The master semi-sync wait timeout values was in milliseconds, and
      the defualt was 10ms, which caused a lot timeouts, and there were
      no log information about the semi-sync status changes because of
      timeout.
      
      This patch change the default timeout to 10000ms (10 seconds),
      and also add log information when semi-sync on master switches
      on or off.

    M  plugin/semisync/semisync_master.cc
    M  plugin/semisync/semisync_master_plugin.cc
=== modified file 'plugin/semisync/semisync_master.cc'
--- a/plugin/semisync/semisync_master.cc	2009-07-07 02:44:17 +0000
+++ b/plugin/semisync/semisync_master.cc	2009-07-16 08:59:59 +0000
@@ -448,7 +448,7 @@ int ReplSemiSyncMaster::enableMaster()
     }
     else
     {
-      sql_print_information("Semi-sync replication not able to allocate memory.");
+      sql_print_error("Cannot allocate memory to enable semi-sync on the master.");
       result = -1;
     }
   }
@@ -774,17 +774,11 @@ int ReplSemiSyncMaster::commitTrx(const 
 
         if (wait_result != 0)
 	{
-          if (trace_level_ & kTraceGeneral)
-	  {
-            /* This is a real wait timeout. */
-            sql_print_warning("Replication semi-sync not sent binlog to "
-                            "slave within the timeout %lu ms - OFF.",
-                            wait_timeout_);
-            sql_print_warning("          semi-sync up to file %s, position %lu",
+          /* This is a real wait timeout. */
+          sql_print_warning("Timeout waiting for reply of binlog (file: %s, pos: %lu), "
+                            "semi-sync up to file %s, position %lu.",
+                            trx_wait_binlog_name, (unsigned long)trx_wait_binlog_pos,
                             reply_file_name_, (unsigned long)reply_file_pos_);
-            sql_print_warning("          transaction needs file %s, position %lu",
-                            trx_wait_binlog_name, (unsigned long)trx_wait_binlog_pos);
-          }
           total_wait_timeouts_++;
 
           /* switch semi-sync off */
@@ -877,7 +871,7 @@ int ReplSemiSyncMaster::switch_off()
   switched_off_times_++;
   wait_file_name_inited_   = false;
   reply_file_name_inited_  = false;
-  commit_file_name_inited_ = false;
+  sql_print_information("Semi-sync replication switched OFF.");
   cond_broadcast();                            /* wake up all waiting threads */
 
   return function_exit(kWho, result);
@@ -914,11 +908,10 @@ int ReplSemiSyncMaster::try_switch_on(in
     /* Switch semi-sync replication on. */
     state_ = true;
 
-    if (trace_level_ & kTraceGeneral)
-      sql_print_information("%s switch semi-sync ON with server(%d) "
-                            "at (%s, %lu), repl(%d)",
-                            kWho, server_id, log_file_name,
-                            (unsigned long)log_file_pos, (int)is_on());
+    sql_print_information("Semi-sync replication switched ON with slave (server_id: %d) "
+                          "at (%s, %lu)",
+                          server_id, log_file_name,
+                          (unsigned long)log_file_pos);
   }
 
   return function_exit(kWho, 0);
@@ -940,6 +933,9 @@ int ReplSemiSyncMaster::reserveSyncHeade
     /* No enough space for the extra header, disable semi-sync master */
     if (sizeof(kSyncHeader) > size)
     {
+      sql_print_warning("No enough space in the packet "
+                        "for semi-sync extra header, "
+                        "semi-sync replication disabled");
       disableMaster();
       return 0;
     }

=== modified file 'plugin/semisync/semisync_master_plugin.cc'
--- a/plugin/semisync/semisync_master_plugin.cc	2009-06-17 10:37:04 +0000
+++ b/plugin/semisync/semisync_master_plugin.cc	2009-07-16 08:59:59 +0000
@@ -159,7 +159,7 @@ static MYSQL_SYSVAR_ULONG(timeout, rpl_s
  "The timeout value (in ms) for semi-synchronous replication in the master",
   NULL, 			// check
   fix_rpl_semi_sync_master_timeout,	// update
-  10, 0, ~0L, 1);
+  10000, 0, ~0L, 1);
 
 static MYSQL_SYSVAR_ULONG(trace_level, rpl_semi_sync_master_trace_level,
   PLUGIN_VAR_OPCMDARG,


Attachment: [text/bzr-bundle] bzr/zhenxing.he@sun.com-20090716085959-qtdbjusms4zo136c.bundle
Thread
bzr commit into mysql-5.4 branch (zhenxing.he:2827) Bug#45819He Zhenxing16 Jul