List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:July 14 2010 9:01am
Subject:bzr commit into mysql-5.1-rep+2 branch (aelkin:3208) Bug#55247
View as plain text  
#At file:///home/andrei/MySQL/BZR/2a-23May/FIXES/rep2-bug-master-slave-frag/ based on revid:alfranio.correia@stripped

 3208 Andrei Elkin	2010-07-14
      Bug #55247  	fragmentation layer for transferring over max_allowed_packet rows-event
      
      the slave still can't handle the large events exceeding 1 GB because of client-server protocol
      limitation but Rows-events larger than 1 GB can be really created.
      
      This patch represents a sceleton implementation of master-slave fragmentation layer.
      The layer is basically a duo of wrappers for my_net_write() (master) and read_event() (slave). 
      It is supposed to apply to Rows-log events exclusively.
      
      CAVEAT: not compiled, no tests just for reviewing.

    modified:
      sql/slave.cc
      sql/sql_repl.cc
=== modified file 'sql/slave.cc'
--- a/sql/slave.cc	2010-07-12 02:53:36 +0000
+++ b/sql/slave.cc	2010-07-14 09:01:23 +0000
@@ -2308,6 +2308,11 @@ static ulong read_event(MYSQL* mysql, Ma
                      mysql_error(mysql));
      DBUG_RETURN(packet_error);
   }
+  if (is_row_based_event(mysql->net.read_pos[EVENT_TYPE_OFFSET]) &&
+      mysql->net.read_pos[RW_FLAGS_OFFSET] & ROWS_LOG_EVENT_FRAG_MASK)
+  {
+    // TODO: continue reading other fragments
+  }
 
   DBUG_PRINT("exit", ("len: %lu  net->read_pos[4]: %d",
                       len, mysql->net.read_pos[4]));

=== modified file 'sql/sql_repl.cc'
--- a/sql/sql_repl.cc	2010-06-22 01:41:53 +0000
+++ b/sql/sql_repl.cc	2010-07-14 09:01:23 +0000
@@ -417,6 +417,21 @@ static int send_heartbeat_event(NET* net
   DBUG_RETURN(0);
 }
 
+my_bool net_frag_write(NET *net, uchar *packet, size_t len)
+{
+  DBUG_ASSERT(len <= max(max_allowed_packet,
+                         opt_binlog_rows_event_max_size + MAX_LOG_EVENT_HEADER));
+  if (is_row_based_event(packet[EVENT_TYPE_OFFSET]) &&
+      current_thd->variables.max_allowed_packet < len)
+  {
+    // TODO:
+    // fragmented sending to include
+    // adding the number of fragements to Rows_log_event
+  }
+  else
+    return my_net_write(net, packet, len);
+}
+
 /*
   TODO: Clean up loop to only have one call to send_file()
 */
@@ -696,7 +711,7 @@ impossible position";
         goto err;
       }
 
-      if (my_net_write(net, (uchar*) packet->ptr(), packet->length()))
+      if (net_frag_write(net, (uchar*) packet->ptr(), packet->length()))
       {
 	errmsg = "Failed on my_net_write()";
 	my_errno= ER_UNKNOWN_ERROR;
@@ -873,7 +888,7 @@ impossible position";
             goto err;
           }
 	  
-	  if (my_net_write(net, (uchar*) packet->ptr(), packet->length()) )
+	  if (net_frag_write(net, (uchar*) packet->ptr(), packet->length()) )
 	  {
 	    errmsg = "Failed on my_net_write()";
 	    my_errno= ER_UNKNOWN_ERROR;


Attachment: [text/bzr-bundle] bzr/aelkin@mysql.com-20100714090123-gvfs5ld1xwukrvmd.bundle
Thread
bzr commit into mysql-5.1-rep+2 branch (aelkin:3208) Bug#55247Andrei Elkin14 Jul