Hi Andrei,
On Monday 25 June 2007, Andrei Elkin wrote:
>> Even if there were, inserting a corresponding
>> DBUG_EXECUTE_IF() wouldn't help, because the slave would get an error
>> during initial handshake, so the testcase would be unable to actually test
>> anything.
>>
>> Please elaborate.
>
>Let's do that together :)
>
>Where exactly do you think master got OOM? My guess is that's
>my_malloc() in the right function (might it be net_real_write - I am
>not sure).
>Then, what can stop us from elulating the OOM?
>
Nothing can, but when emulating an OOM error this way, the slave I/O thread
would not even be able to connect to master because the connection would be
terminated during initial handshake. We need a way to "filter' packets on
master so that we only run DBUG_EXECUTE_IF() emulating an OOM error _only_
when sending the first binlog event. Do you have any ideas about how that can
be done in net_* functions?
>>>The code you added guards against symptoms the bug report mistakenly
>>>came up with.
>>>We could actually do a similar in
>>>
>>>my_bool net_realloc(NET *net, ulong length)
>>> ...
>>> net->last_errno= ER_OUT_OF_RESOURCES
>>> ....
>>>
>>> (where ER_OUT_OF_RESOURCES is returned and slave seems does not
>>> verify neither in the basic code nor by your patch)
>>
>> I have tried this way and it does not work for the following reason:
>> ER_OUT_OF_RESOURCES in net_realloc() causes the cli_safe_read() call in
>> slave.cc:read_event() to fail with the 'packet_error" return value.
>> However, the error code is converted from ER_OUT_OF_RESOURCE to
>> CR_SERVER_LOST in cli_safe_read(). Hence there is no reason for checking
>> for
>> ER_OUT_OF_RESOURCES in read_event() and its callers, because that error
>> will never reach that code.
>>
>> While this worth investigating further, I feel that the above should be
>> reported and fixed as a separate bug, it does not look related to 24192
>> which was triggered by an OOM on master,
>
>agree, as you must be more prepared could you file a bug report?
>
Yes, I will.
>> and I still don't see a way to emulate exactly that condition.
>
>This another issue looks to stay in the way of the idea.
>After cli_safe_read() is refined to not hide ER_OUT_OF_RESOURCES
>emulation becomes possible. Does this hint to fix two bugs within one
>chuck of work?
>
We can fix as many bugs as we like in one chunk of work, but the problem in
question remains unsolved: we still don't have a way to write a testcase for
this particular bug. Do you agree?
Best regards,
--
Alexey Kopytov, Software Developer
MySQL AB, www.mysql.com
Are you MySQL certified? www.mysql.com/certification
| Thread |
|---|
| • Re: Reviews for bug 24192 "MySQL replication does not exit server when running out of memory" | Alexey Kopytov | 28 Jun |