List:Internals« Previous MessageNext Message »
From:Zardosht Kasheff Date:July 28 2011 2:44am
Subject:Re: what can a sequence of handler::index_XXX be interrupted by?
View as plain text  
Actually, let me put the question another way.

Given that we have had one call of handler::index_init with some thd
and keynr, are we guaranteed to NOT get another call to
handler::index_init with the SAME thd and keynr, until we get a call
to handler::index_end for the first call?

Thanks
-Zardosht

On Wed, Jul 27, 2011 at 5:18 PM, Zardosht Kasheff <zardosht@stripped> wrote:
> One last question on this. Each of the handlers below in the index
> merge/intersection code. Will each of the handlers be calling
> index_XXX() on a different index? Or is it possible that two of them
> may be called on the same index?
>
> Thanks
> -Zardosht
>
> On Wed, Jul 27, 2011 at 1:28 PM, Sergey Petrunya <psergey@stripped> wrote:
>> On Tue, Jul 26, 2011 at 06:13:54PM -0400, Zardosht Kasheff wrote:
>>> For the last case, where we have:
>>> >    handlers[0]->index_XXX();
>>> >    handlers[1]->index_XXX();
>>> >    handlers[2]->index_XXX();
>>> >    handlers[0]->index_XXX();
>>> >    handlers[0]->index_XXX();
>>> >    handlers[1]->index_XXX();
>>>
>>> I assume each of the handlers share the same thd object? So if I check
>>> the thd object for each of the handlers, I will get the same one?
>>
>> Yes. handlers[i]->ha_thd() == handlers[j]->ha_thd() for any i and j.
>>
>>> I guess here is another question. Is there any way for a handler with
>>> some thd object be blocked from executing until some operation with
>>> ANOTHER thd finishes. For instance, in the above example, handlers[1]
>>> cannot execute until handlers[0] performs its index_XXX function, but
>>> (I hope) they have the same thd.
>>
>> Every query is executed by some particular thread, and all ha_xxx objects
>> used by a thread must have their thd equal to thread's thd. This means that
>> the blockings you're interested in cannot be caused by a single query.
>>
>> As for multiple queries, I can only think of locking:
>> - If your storage engine's ha_xxx::store_lock() produces lock objects that are
>>  exclusive for one another, then the blocking may occur
>> - I suspect something similar can happen with DDL operations. if there is a
>>  DDL operation running, other threads won't be able to open the table until
>>  the DDL op has finished.
>>
>> BR
>>  Sergey
>> --
>> Sergey Petrunia, Software Developer
>> Monty Program AB, http://askmonty.org
>> Blog: http://s.petrunia.net/blog
>>
>
Thread
what can a sequence of handler::index_XXX be interrupted by?Zardosht Kasheff26 Jul
  • Re: what can a sequence of handler::index_XXX be interrupted by?Sergey Petrunya26 Jul
    • Re: what can a sequence of handler::index_XXX be interrupted by?Zardosht Kasheff27 Jul
      • Re: what can a sequence of handler::index_XXX be interrupted by?Sergey Petrunya27 Jul
        • Re: what can a sequence of handler::index_XXX be interrupted by?Zardosht Kasheff27 Jul
        • Re: what can a sequence of handler::index_XXX be interrupted by?Zardosht Kasheff27 Jul
          • Re: what can a sequence of handler::index_XXX be interrupted by?Zardosht Kasheff28 Jul
            • Re: what can a sequence of handler::index_XXX be interrupted by?Sergey Petrunya28 Jul
          • Re: what can a sequence of handler::index_XXX be interrupted by?Sergey Petrunya28 Jul
  • re: what can a sequence of handler::index_XXX be interrupted by?Michael Widenius26 Jul