Hi Daogang,
On 11/22/2010 07:54 AM, Daogang Qu wrote:
> 2010-11-22 15:25, Daogang Qu wrote:
>> 2010-11-19 18:13, Alfranio Correia wrote:
>>> Hi Daogang,
>>>
>>> Some answers were missing in the previous email.
>>>
>>> Cheers.
>>>
>>> On 11/19/2010 09:25 AM, Alfranio Correia wrote:
>>>> Hi Daogang,
>>>>
>>>> On 11/19/2010 07:47 AM, Daogang Qu wrote:
>>>>> Hi Alfranio,
>>>>> Thanks for your comments. See reply in-line.
>>>>> Please review the updated patch:
>>>>> http://lists.mysql.com/commits/124364
>>>>>
>> [snip]
>>>>
>>>>>
>>>>>>
>>>>>>
>>>>>> SUGGESTIONS
>>>>>> -----------
>>>>>>
>>>>>> 1. The crash-safety for the binlog is based on the assumption
> that
>>>>>> the
>>>>>> "my_chsize" is idempotent. Howerver, my_chsize may not be an
> atomic
>>>>>> operation.
>>>>>> So I think we should inject some faults in order to make sure
> that
>>>>>> the
>>>>>> master
>>>>>> will be safe if the recovery fails.
>>>>> That's better. Inject faults as following:
>>>>> DBUG_EXECUTE_IF("crash_before_change_binlog_file_size",
>>>>> DBUG_SUICIDE(););
>>>>> my_chsize(...)
>>>>> DBUG_EXECUTE_IF("crash_after_change_binlog_file_size",
>>>>> DBUG_SUICIDE(););
>>>>> Right?
>>>>>>
>>>
>>>
>>> No. Crash inside my_chsize.
>> my_chsize() have encapsulated different system calls according to
>> different platforms.
>> Where did you want to set the DBUG POINT? Before return or somewhere?
>> But I think it's better to set the DBUG POINT at top level as we used
>> to do that.
> Sure. It's better if we can set DEBUG POINT in the middle of system
> calls, for example:
> ftruncate(...) or my_win_chsize(...). But we can't. So It's different to
> set DEBUG POINT
> inside or outside the my_chsize() function.
>
> Best Regards,
>
> Daogang
The point here is about ensure that the recovery is idempotent.
It is idempotent and I don't think you need to introduce any fault
injection to check this.
Even if the operations in my_chsize are not atomically, I don't
see any problem. Am I missing something?
So I am fine.
Cheers.