List:Commits« Previous MessageNext Message »
From:Andrei Elkin Date:September 8 2006 7:35pm
Subject:bk commit into 4.1 tree (aelkin:1.2481) BUG#19402
View as plain text  
Below is the list of changes that have just been committed into a local
4.1 repository of elkin. When elkin does a push these changes will
be propagated to the main repository and, within 24 hours after the
push, to the public repository.
For information on how to access the public repository
see http://dev.mysql.com/doc/mysql/en/installing-source-tree.html

ChangeSet@stripped, 2006-09-08 22:35:29+03:00, aelkin@stripped +3 -0
  BUG#19402 SQL close to the size of the max_allowed_packet fails on the slave
  
  A communication packet can also be a binlog event sent from the master to the slave.
  To be sent by master dump and accepted by slave io thread both have to have
  the value of max_allowed_packet bigger than one that client connection had.
  
  In the patch there is the MAX possible replicatio header size estimation for events
  in binlog that embedded user query. Only these events of query_log_event type, i.e
  just plain queries, require attention. 

  sql/log_event.h@stripped, 2006-09-08 22:35:22+03:00, aelkin@stripped +6 -0
    MAX value of the header of the replication packet, i.e the value of exceeding
    the query string part.

  sql/slave.cc@stripped, 2006-09-08 22:35:22+03:00, aelkin@stripped +2 -0
    Private value of max allowed packed slave io can accept from master. The value is
    increased by the MAX possible overhead due to replication headers.

  sql/sql_repl.cc@stripped, 2006-09-08 22:35:23+03:00, aelkin@stripped +2 -0
    Simmetrical wrt to slave part. Increasing the private max allowed.

# This is a BitKeeper patch.  What follows are the unified diffs for the
# set of deltas contained in the patch.  The rest of the patch, the part
# that BitKeeper cares about, is below these diffs.
# User:	aelkin
# Host:	dsl-hkigw8-fe00f800-98.dhcp.inet.fi
# Root:	/net/koti/usr_rh9/home/elkin.rh9/MySQL/TEAM/FIXES/4.1/bug19402-max_allowed

--- 1.99/sql/log_event.h	2006-09-08 22:35:42 +03:00
+++ 1.100/sql/log_event.h	2006-09-08 22:35:42 +03:00
@@ -147,6 +147,12 @@ struct sql_ex_info
 #define EXEC_LOAD_HEADER_LEN   4
 #define DELETE_FILE_HEADER_LEN 4
 
+/* amount of byte is contribution of replicaton protocol to a query
+   received from user when the query goes to binlog */
+#define MAX_LOG_EVENT_HEADER   (LOG_EVENT_HEADER_LEN + /* write_header */ \
+				QUERY_HEADER_LEN     + /* write_data */   \
+				NAME_LEN + 1)
+
 /* 
    Event header offsets; 
    these point to places inside the fixed header.

--- 1.279/sql/slave.cc	2006-09-08 22:35:42 +03:00
+++ 1.280/sql/slave.cc	2006-09-08 22:35:42 +03:00
@@ -2622,6 +2622,8 @@ static int init_slave_thread(THD* thd, S
   thd->master_access= ~(ulong)0;
   thd->priv_user = 0;
   thd->slave_thread = 1;
+  /* io thread accounts the whole header size of query_log_event */
+  thd->variables.max_allowed_packet+= MAX_LOG_EVENT_HEADER;
   /* 
      It's nonsense to constrain the slave threads with max_join_size; if a
      query succeeded on master, we HAVE to execute it. So set

--- 1.137/sql/sql_repl.cc	2006-09-08 22:35:42 +03:00
+++ 1.138/sql/sql_repl.cc	2006-09-08 22:35:42 +03:00
@@ -420,6 +420,8 @@ impossible position";
     goto err;
   }
   packet->set("\0", 1, &my_charset_bin);
+  /* dump thread  the whole header size of query_log_event */
+  thd->variables.max_allowed_packet+= MAX_LOG_EVENT_HEADER;
 
   while (!net->error && net->vio != 0 && !thd->killed)
   {
Thread
bk commit into 4.1 tree (aelkin:1.2481) BUG#19402Andrei Elkin8 Sep