• unknown's avatar
    BUG#19402 SQL close to the size of the max_allowed_packet fails on the slave · 0f2fe8bd
    unknown authored
    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:
      MAX value of the header of the replication packet, i.e the value of exceeding
      the query string part.
    sql/slave.cc:
      Private value of max allowed packet slave io, sql threads can accept from master.
      The value is increased by the MAX possible size of replication event header.
      
      Note, that my_net_init is redundant for slave io because the thread uses instance of
      NET struct, embedded into MYSQL, as a client to server. We have left old code and even
      increment, redundantly as well, thd->net.max_packet_size just for the sake of
      consistency. TODO: eliminate my_net_init from execution path of slave io.
    sql/sql_repl.cc:
      Increasing the private max allowed packet that the dump thread reads from master
      binlog and sends to net. Note, that happened prior this writting to binlog is
      safe from the current artifact because it is done by steps that each chunk can not
      exceed @@global.max_allowed_packet.
    mysql-test/r/rpl_packet.result:
      BitKeeper file /home/elkin/MySQL/TEAM/FIXES/4.1/bug19402-max_allowed/mysql-test/r/rpl_packet.result
    mysql-test/t/rpl_packet-master.opt:
      BitKeeper file /net/koti/usr_rh9/home/elkin.rh9/MySQL/TEAM/FIXES/4.1/bug19402-max_allowed/mysql-test/t/rpl_packet-master.opt
    mysql-test/t/rpl_packet-slave.opt:
      BitKeeper file /net/koti/usr_rh9/home/elkin.rh9/MySQL/TEAM/FIXES/4.1/bug19402-max_allowed/mysql-test/t/rpl_packet-slave.opt
    mysql-test/t/rpl_packet.test:
      test examines repliation of a max-sized query when database name is set to have
      NAME_LEN bytes. This makes replication header size the maximum.
    0f2fe8bd
log_event.h 33 KB