List:Internals« Previous MessageNext Message »
From:Tianwei Date:March 24 2010 12:58pm
Subject:Re: Is that intentional or my configure error?
View as plain text  
Hi, Konstantin,
> On Wed, Mar 24, 2010 at 2:59 AM, Konstantin Osipov <kostja@stripped> wrote:
>>
>> * Tianwei <tianwei.sheng@stripped> [10/03/23 17:39]:
>> >
>> > 3. if the above is true, then how we can understand the following
>> > comments as it assumes that data_file_length is protected by the same
>> > strucutre_guard_mutex: sql/ha_myisam.cc
>> > +  /*
>> > +    POSIX visibility rules specify that "2. Whatever memory
> values a
>> > +    thread can see when it unlocks a mutex <...> can also
> be seen by any
>> > +    thread that later locks the same mutex". In this particular
> case,
>> > +    concurrent insert thread had modified the data_file_length
> in
>> > +    MYISAM_SHARE before it has unlocked (or even locked)
>> > +    structure_guard_mutex. So, here we're guaranteed to see at
> least that
>> > +    value after we've locked the same mutex. We can see a later
> value
>> > +    (modified by some other thread) though, but it's ok, as we
> only want
>> > +    to know if the variable was changed, the actual new value
> doesn't matter
>> > +  */
>>
>> This comment explains a hack that is used in the query cache:
>>
>> we don't take the mutex that protects the myisam share, but
>> by taking a different mutex ensure some level of memory coherency,
>> sufficient for the task.
>>

Thanks for your reply. What do you mean about "some level of memory
coherency" with different locks?
for the query cache, Kristofer's fix seems reasonable, at least for
the bug 28249.  But I still want to learn the general design about
concurrent insert.  I follow
http://forge.mysql.com/wiki/MySQL_Internals_MyISAM#MyISAM_Concurrent_Insert,
and found lots of bug reported (whatever duplicated or not) when
concurrent insert is enabled.  I believe the query cache just add
another level of complication for this problem. Is there a clear
documentation for the design of concurrent insert?


Thanks.

Tianwei
--
Sheng, Tianwei
Inst. of High Performance Computing
Dept. of Computer Sci. & Tech.
Tsinghua Univ.
Thread
Is that intentional or my configure error?Tianwei23 Mar
  • Re: Is that intentional or my configure error?xiaobing jiang23 Mar
    • Re: Is that intentional or my configure error?Tianwei23 Mar
  • Re: Is that intentional or my configure error?Sergey Vojtovich23 Mar
    • Re: Is that intentional or my configure error?Tianwei23 Mar
      • Re: Is that intentional or my configure error?Tianwei23 Mar
        • Re: Is that intentional or my configure error?Sergey Vojtovich23 Mar
        • Re: Is that intentional or my configure error?Konstantin Osipov23 Mar
Re: Is that intentional or my configure error?Tianwei24 Mar