List:Internals« Previous MessageNext Message »
From:Yuan Wang Date:November 21 2009 9:24am
Subject:Re: Primary key is miss in row based replication.
View as plain text  
Hi Mats

I have checked the code of 5.1 (current head version of 5.1 branch in
launchpad), and it don't seem to fill missing attributes automatically
when RBR is used.

The patch (http://lists.mysql.com/commits/40151) of bug 33055
(http://bugs.mysql.com/bug.php?id=33055) does the following change to
st_table::mark_columns_needed_for_delete().

-  if (file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_DELETE)
+  if (file->ha_table_flags() & HA_PRIMARY_KEY_REQUIRED_FOR_DELETE ||
+      mysql_bin_log.is_open() && in_use &&
+      in_use->current_stmt_binlog_row_based)

This patch has been pushed into 6.0. However,
st_table::mar_columns_needed_for_update don't have this change.

It seems that if my storage engine mark the
HA_PRIMARY_KEY_REQUIRED_FOR_DELETE flag in table_flags, then the
server will add primary key to binlog automatically, which is just
what we need.

On Fri, Nov 20, 2009 at 4:04 PM, Mats Kindahl <mats@stripped> wrote:
> Hi Yuan,
>
> In 5.1, the full row is sent over to the slave, so I am a little surprised that
> there is anything missing at all.
>
> Do you have an example I can look at?
>
> Best wishes,
> Mats Kindahl
>
> Yuan Wang wrote:
>> We are developed a storage engine using row based replication. During
>> the test we found that primary key values will not be included in the
>> binlog event. So the slave is impossible to identify which row to
>> update.
>>
>> Is this a bug or is there a flag to tell MySQL to include primary key?
>> We are based on 5.1.33 currently.
>>
>
> --
> Mats Kindahl
> Senior Software Engineer
> Database Technology Group
> Sun Microsystems
>
Thread
Primary key is miss in row based replication.Yuan Wang20 Nov
  • Re: Primary key is miss in row based replication.Venu Kalyan20 Nov
  • Re: Primary key is miss in row based replication.Venu Kalyan20 Nov
  • Re: Primary key is miss in row based replication.Mats Kindahl20 Nov
    • Re: Primary key is miss in row based replication.Yuan Wang21 Nov
      • Re: Primary key is miss in row based replication.Mats Kindahl24 Nov
        • Re: Primary key is miss in row based replication.Yuan Wang25 Nov
          • Re: Primary key is miss in row based replication.Kristian Nielsen25 Nov
          • Re: Primary key is miss in row based replication.Mats Kindahl25 Nov
            • Re: Primary key is miss in row based replication.Yuan Wang26 Nov
              • Re: Primary key is miss in row based replication.Kristian Nielsen26 Nov
                • Re: Primary key is miss in row based replication.Mats Kindahl26 Nov
              • Re: Primary key is miss in row based replication.Mats Kindahl26 Nov
Re: Primary key is miss in row based replication.Yuan Wang20 Nov
  • Re: Primary key is miss in row based replication.Mats Kindahl20 Nov
    • Re: Primary key is miss in row based replication.Yuan Wang20 Nov
  • Re: Primary key is miss in row based replication.Mats Kindahl20 Nov
    • Re: Primary key is miss in row based replication.Yuan Wang20 Nov
      • Re: Primary key is miss in row based replication.Mats Kindahl20 Nov