List:Internals« Previous MessageNext Message »
From:Zardosht Kasheff Date:May 11 2010 12:21pm
Subject:Re: HA_EXTRA_WRITE_CAN_REPLACE and row based replication
View as plain text  
I filed the following bug:

http://bugs.mysql.com/bug.php?id=53561

-Zardosht

On Tue, May 11, 2010 at 7:23 AM, Zardosht Kasheff <zardosht@stripped> wrote:
> Hello Mats and Sergei,
>
> Thank for responding to my question. I will file a bug. The bug seems
> to be the following. As Mats said, the flag means "I'm executing a
> replace right now, so you can optimize for that if you like." Storage
> engines that want to replace the row in the write call (which is what
> the name of the flag implies) cannot do so, because replication does
> not work.
>
> I do not understand the following statement: "we have no support for
> allowing the engine to give this information". I do not see why the
> engine needs to provide any information. This is how I thought the
> flag should work. If the operation is "replace into" (and there are no
> delete triggers on the table), then MySQL calls the storage engine
> with HA_EXTRA_WRITE_CAN_REPLACE. If the write succeeds, the binary log
> takes note that an insert with HA_EXTRA_WRITE_CAN_REPLACE has taken
> place. Then, on the slave, an insert is replayed with this flag set.
> If the insert fails with a duplicate key error, then the slave should
> call an update.
>
> This is how I assumed it would work, and I how I think it should work
> (I would be happy to hear other opinions).
>
> Also, other questions:
>  - What does the IDEMPOTENT flag mean in this context?
>  - What happens if NDB is the master and slave? Does NDB use the flag
> to optimize inserts on the master?
>  - What about if NDB is the master and MyISAM is the slave? How does
> the master behave?
>
> Thanks
> -Zardosht
>
> On Tue, May 11, 2010 at 4:55 AM, Mats Kindahl <Mats.Kindahl@stripped> wrote:
>> On 05/11/2010 10:30 AM, Sergei Golubchik wrote:
>>> Hi, Mats!
>>>
>>> On May 11, Mats Kindahl wrote:
>>>
>>>> Hi Zardosht,
>>>>
>>>> The flag HA_EXTRA_WRITE_CAN_REPLACE only is set on the slave for Write
>>>> rows when --slave-exec-mode is IDEMPOTENT *or when the NDB Cluster
>>>> engine is used*. In other words, the NDB engine is hardcoded to always
>>>> use IDEMPOTENT.
>>>>
>>> Which is, arguably, a bug. The flag is not HA_EXTRA_IS_NDB_CLUSTER,
>>> other engines may take use of it too.
>>>
>>
>> Agree on that, but we have no support for allowing the engine to give
>> this information right now.
>>
>> Note that the HA_EXTRA flags are means for the server to communicate
>> with the engine, not the other way around. This flag says "I'm executing
>> a replace right now, so you can optimize for that if you like."
>>
>> Best wishes,
>> Mats Kindahl
>>
>>>
>>> Regards,
>>> Sergei
>>>
>>
>>
>> --
>> Mats Kindahl
>> Senior Software Engineer
>> Database Technology Group
>> Sun Microsystems
>>
>>
>> --
>> MySQL Internals Mailing List
>> For list archives: http://lists.mysql.com/internals
>> To unsubscribe:    http://lists.mysql.com/internals?unsub=1
>>
>>
>
Thread
HA_EXTRA_WRITE_CAN_REPLACE and row based replicationZardosht Kasheff10 May
  • Re: HA_EXTRA_WRITE_CAN_REPLACE and row based replicationMats Kindahl11 May
    • Re: HA_EXTRA_WRITE_CAN_REPLACE and row based replicationSergei Golubchik11 May
      • Re: HA_EXTRA_WRITE_CAN_REPLACE and row based replicationMats Kindahl11 May
        • Re: HA_EXTRA_WRITE_CAN_REPLACE and row based replicationZardosht Kasheff11 May
          • Re: HA_EXTRA_WRITE_CAN_REPLACE and row based replicationZardosht Kasheff11 May
          • Re: HA_EXTRA_WRITE_CAN_REPLACE and row based replicationMats Kindahl11 May
            • Re: HA_EXTRA_WRITE_CAN_REPLACE and row based replicationZardosht Kasheff11 May