<?xml version="1.0" encoding="utf-8"?>
<launchpad-bug id="872754">
  <date_last_updated>2011-10-24 14:35:42.673706+00:00</date_last_updated>
  <api_links>
    <bug_api_link>https://api.launchpad.net/1.0/bugs/872754</bug_api_link>
    <bug_owner_link>https://api.launchpad.net/1.0/~tsarev</bug_owner_link>
    <milestone_link></milestone_link>
    <linked_branches_collection_link>https://api.launchpad.net/1.0/bugs/872754/linked_branches</linked_branches_collection_link>
    <activity_link>https://api.launchpad.net/1.0/bugs/872754/activity</activity_link>
  </api_links>
  <bug_web_link>https://bugs.launchpad.net/bugs/872754</bug_web_link>
  <owner>Oleg Tsarev</owner>
  <assignee>Kristian Nielsen</assignee>
  <milestone_title></milestone_title>
  <duplicate_link></duplicate_link>
  <duplicate_bug_id></duplicate_bug_id>
  <title>Annotate rows events  on slave doesnt' work without slave's binlog</title>
  <status>New</status>
  <importance>Undecided</importance>
  <created>2011-10-12 09:50:46.662036+00:00</created>
  <description>
<![CDATA[master: --binlog_annotate_rows_log_events
slave: --slave_annotate_rows_log_event --log_slave_updates=0

slave fails with error:
[ERROR] Slave I/O: Got fatal error 1236 from master when reading data from binary log: 'log event entry exceeded max_allowed_packet; Increase max_allowed_packet on master', Error_code: 1236

if master idle more than --slave_net_timeout.

Test-case in attachment.

I investigated it, and found the following:
1) master doesn't replicate Annotate_rows_log_event to slave if one of the following is true:
  a) --replicate_annotate_rows_event is OFF
  b) --log_slave_updates is OFF
2) While slave executes events, it calculates mi->master_log_pos (Exec_Master_Log_Pos).
If master doesn't replicate Annotate_rows_log_event to slave, mi->master_log_pos is incorrect (less than log_pos-on-master to sizeof(Annotate_rows_log_event) that weren't sent from master to slave).
3) After slave_net_timeout slave reconnects to master and sends mi->master_log_pos to it.
As a result, master tries  to read event from its log from incorrect position.

Possible fixes:
1) always replicate Annotate_rows_log_event from master to slave. If you do this, option "--replicate_annotate_rows_events" doesn't have sense (always true) and should be removed
2) fix the Master Dump Thread - when "--replicate_annotate_rows_events" disabled or slave run with "--log_slave_updates=0", master should notify slave about skipped events (probably as filtered event or send Rotate_log_event )- I don't sure what this is possible or correct fix (just idea)]]>  </description>
  <activities>
    <activity datechanged="2011-10-12T09:42:26.903437+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>bug</whatchanged>
      <person>Oleg Tsarev</person>
      <message>added bug</message>
    </activity>
    <activity datechanged="2011-10-12T09:42:26.903437+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[unworkable_replicate_annotate_rows_events.test https://bugs.launchpad.net/bugs/872754/+attachment/2538167/+files/unworkable_replicate_annotate_rows_events.test]]>      </newvalue>
      <whatchanged>attachment added</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:42:40.012914+00:00">
      <oldvalue>
<![CDATA[unworkable_replicate_annotate_rows_events.test https://bugs.launchpad.net/percona-server/+bug/872754/+attachment/2538167/+files/unworkable_replicate_annotate_rows_events.test]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>attachment removed</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:43:53.944826+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[unworkable_annotate_rows_event.tar https://bugs.launchpad.net/percona-server/+bug/872754/+attachment/2538169/+files/unworkable_annotate_rows_event.tar]]>      </newvalue>
      <whatchanged>attachment added</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:49:53.959110+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[unworkable_replicate_annotate_rows_events.tar https://bugs.launchpad.net/percona-server/+bug/872754/+attachment/2538173/+files/unworkable_replicate_annotate_rows_events.tar]]>      </newvalue>
      <whatchanged>attachment added</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:50:21.837244+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[percona-server/rnt-5.1]]>      </newvalue>
      <whatchanged>nominated for series</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:50:21.837244+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[percona-server/rnt-5.1]]>      </newvalue>
      <whatchanged>bug task added</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:50:46.662036+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[maria]]>      </newvalue>
      <whatchanged>bug task added</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:51:05.980010+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Oleg Tsarev (tsarev)]]>      </newvalue>
      <whatchanged>percona-server: assignee</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:51:08.769591+00:00">
      <oldvalue>
<![CDATA[New]]>      </oldvalue>
      <newvalue>
<![CDATA[Confirmed]]>      </newvalue>
      <whatchanged>percona-server: status</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:51:15.512039+00:00">
      <oldvalue>
<![CDATA[New]]>      </oldvalue>
      <newvalue>
<![CDATA[Confirmed]]>      </newvalue>
      <whatchanged>percona-server/rnt-5.1: status</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:51:18.238912+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Oleg Tsarev (tsarev)]]>      </newvalue>
      <whatchanged>percona-server/rnt-5.1: assignee</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:51:21.263581+00:00">
      <oldvalue>
<![CDATA[Undecided]]>      </oldvalue>
      <newvalue>
<![CDATA[High]]>      </newvalue>
      <whatchanged>percona-server: importance</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:51:24.138208+00:00">
      <oldvalue>
<![CDATA[Undecided]]>      </oldvalue>
      <newvalue>
<![CDATA[High]]>      </newvalue>
      <whatchanged>percona-server/rnt-5.1: importance</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:51:36.303001+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[cr i13894]]>      </newvalue>
      <whatchanged>tags</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T09:57:05.748828+00:00">
      <oldvalue>
<![CDATA[New]]>      </oldvalue>
      <newvalue>
<![CDATA[Confirmed]]>      </newvalue>
      <whatchanged>maria: status</whatchanged>
      <person>Kristian Nielsen</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T10:10:58.646871+00:00">
      <oldvalue>
<![CDATA[Confirmed]]>      </oldvalue>
      <newvalue>
<![CDATA[New]]>      </newvalue>
      <whatchanged>maria: status</whatchanged>
      <person>Kristian Nielsen</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T10:10:58.646871+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[Kristian Nielsen (knielsen)]]>      </newvalue>
      <whatchanged>maria: assignee</whatchanged>
      <person>Kristian Nielsen</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-12T10:36:21.834037+00:00">
      <oldvalue>
<![CDATA[]]>      </oldvalue>
      <newvalue>
<![CDATA[lp:~tsarev/percona-server/rnt-5.1_fix_bug_872754]]>      </newvalue>
      <whatchanged>branch linked</whatchanged>
      <person>Launchpad Janitor</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-13T06:47:45.817378+00:00">
      <oldvalue>
<![CDATA[Confirmed]]>      </oldvalue>
      <newvalue>
<![CDATA[Fix Committed]]>      </newvalue>
      <whatchanged>percona-server/rnt-5.1: status</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-13T06:47:48.523518+00:00">
      <oldvalue>
<![CDATA[Confirmed]]>      </oldvalue>
      <newvalue>
<![CDATA[Fix Committed]]>      </newvalue>
      <whatchanged>percona-server: status</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-14T07:32:13.625590+00:00">
      <oldvalue>
<![CDATA[lp:~tsarev/percona-server/rnt-5.1_fix_bug_872754]]>      </oldvalue>
      <newvalue>
<![CDATA[]]>      </newvalue>
      <whatchanged>branch unlinked</whatchanged>
      <person>Alexey Kopytov</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-14T07:32:24.129939+00:00">
      <oldvalue>
<![CDATA[Oleg Tsarev (tsarev)]]>      </oldvalue>
      <newvalue>
<![CDATA[Alexey Kopytov (akopytov)]]>      </newvalue>
      <whatchanged>percona-server: assignee</whatchanged>
      <person>Alexey Kopytov</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-14T07:32:26.481251+00:00">
      <oldvalue>
<![CDATA[Oleg Tsarev (tsarev)]]>      </oldvalue>
      <newvalue>
<![CDATA[Alexey Kopytov (akopytov)]]>      </newvalue>
      <whatchanged>percona-server/rnt-5.1: assignee</whatchanged>
      <person>Alexey Kopytov</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-14T07:32:28.837887+00:00">
      <oldvalue>
<![CDATA[Fix Committed]]>      </oldvalue>
      <newvalue>
<![CDATA[In Progress]]>      </newvalue>
      <whatchanged>percona-server: status</whatchanged>
      <person>Alexey Kopytov</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-14T07:32:30.924753+00:00">
      <oldvalue>
<![CDATA[Fix Committed]]>      </oldvalue>
      <newvalue>
<![CDATA[In Progress]]>      </newvalue>
      <whatchanged>percona-server/rnt-5.1: status</whatchanged>
      <person>Alexey Kopytov</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-14T10:19:08.581538+00:00">
      <oldvalue>
<![CDATA[Alexey Kopytov (akopytov)]]>      </oldvalue>
      <newvalue>
<![CDATA[Oleg Tsarev (tsarev)]]>      </newvalue>
      <whatchanged>percona-server: assignee</whatchanged>
      <person>Stewart Smith</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-14T10:19:18.813728+00:00">
      <oldvalue>
<![CDATA[Alexey Kopytov (akopytov)]]>      </oldvalue>
      <newvalue>
<![CDATA[Oleg Tsarev (tsarev)]]>      </newvalue>
      <whatchanged>percona-server/rnt-5.1: assignee</whatchanged>
      <person>Stewart Smith</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-14T10:19:26.732986+00:00">
      <oldvalue>
<![CDATA[In Progress]]>      </oldvalue>
      <newvalue>
<![CDATA[Fix Committed]]>      </newvalue>
      <whatchanged>percona-server: status</whatchanged>
      <person>Stewart Smith</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-14T10:19:28.215417+00:00">
      <oldvalue>
<![CDATA[In Progress]]>      </oldvalue>
      <newvalue>
<![CDATA[Fix Committed]]>      </newvalue>
      <whatchanged>percona-server/rnt-5.1: status</whatchanged>
      <person>Stewart Smith</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-24T14:35:39.400510+00:00">
      <oldvalue>
<![CDATA[Fix Committed]]>      </oldvalue>
      <newvalue>
<![CDATA[Fix Released]]>      </newvalue>
      <whatchanged>percona-server: status</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
    <activity datechanged="2011-10-24T14:35:41.632263+00:00">
      <oldvalue>
<![CDATA[Fix Committed]]>      </oldvalue>
      <newvalue>
<![CDATA[Fix Released]]>      </newvalue>
      <whatchanged>percona-server/rnt-5.1: status</whatchanged>
      <person>Oleg Tsarev</person>
      <message></message>
    </activity>
  </activities>
  <comments>
    <comment commentlink="https://api.launchpad.net/1.0/percona-server/+bug/872754/comments/1" datecreated="2011-10-12T09:42:26.903437+00:00">
      <person>Oleg Tsarev</person>
      <subject>
<![CDATA[Re: Annotate rows events  on slave doesnt' work without slave's binlog]]>      </subject>
      <content>
<![CDATA[]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/percona-server/+bug/872754/comments/2" datecreated="2011-10-12T09:43:53.944826+00:00">
      <person>Oleg Tsarev</person>
      <subject>
<![CDATA[Re: Annotate rows events  on slave doesnt' work without slave's binlog]]>      </subject>
      <content>
<![CDATA[Test-case for MariaDB]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/percona-server/+bug/872754/comments/3" datecreated="2011-10-12T09:49:53.959110+00:00">
      <person>Oleg Tsarev</person>
      <subject>
<![CDATA[Re: Annotate rows events  on slave doesnt' work without slave's binlog]]>      </subject>
      <content>
<![CDATA[Test-case for Percona-Server rnt-5.1]]>      </content>
    </comment>
    <comment commentlink="https://api.launchpad.net/1.0/percona-server/+bug/872754/comments/4" datecreated="2011-10-12T10:11:19.508542+00:00">
      <person>Kristian Nielsen</person>
      <subject>
<![CDATA[Re: Annotate rows events  on slave doesnt' work without slave's binlog]]>      </subject>
      <content>
<![CDATA[I think this will be fixed in mariadb when MWL#234 is merged.]]>      </content>
    </comment>
  </comments>
  <messages>
    <message created="2011-10-12 09:43:53.944826+00:00" owner="Oleg Tsarev">
<![CDATA[Test-case for MariaDB]]>      <attachment link="https://bugs.launchpad.net/bugs/872754/+attachment/2538169" type="Unspecified">
        <title>unworkable_annotate_rows_event.tar</title>
        <file>LPexportBug872754_unworkable_annotate_rows_event.tar</file>
      </attachment>
    </message>
    <message created="2011-10-12 09:49:53.959110+00:00" owner="Oleg Tsarev">
<![CDATA[Test-case for Percona-Server rnt-5.1]]>      <attachment link="https://bugs.launchpad.net/bugs/872754/+attachment/2538173" type="Unspecified">
        <title>unworkable_replicate_annotate_rows_events.tar</title>
        <file>LPexportBug872754_unworkable_replicate_annotate_rows_events.tar</file>
      </attachment>
    </message>
  </messages>
</launchpad-bug>
