← Back to team overview

maria-developers team mailing list archive

Re: [Commits] Rev 4056: MDEV-5607: Query cache destroys uninitialized rwlock in file:///home/bell/maria/bzr/work-maria-5.5-MDEV-5607/

 

Hi, Sergey!

08.02.2014 18:50, Sergey Vojtovich пишет:
Hi Sanja,

JFYI: while reporting this bug I came up with two questions that I couldn't
answer quickly. Probably they make sense, if not just ignore them:

1. This code was introduced with https://bugs.launchpad.net/maria/+bug/782223,
    revision: wlad@xxxxxxxxxxxxxxxx-20110514163720-rmico2qegtptjguk
   <quot>
   The callstack leading of "free" containing critical section is:
     mysqld!free
     my_no_flags_free
     Query_cache::free_cache
     Query_cache::resize
     fix_query_cache_size
     set_var::update
     sql_set_variables
     mysql_execute_command
     mysql_parse
   <quot>

   It means that this code was supposed to be executed exactly by
   Query_cache::resize(), where you disable it.

   Question: if this code is not supposed to be executed by ::resize(), is it
   needed at all?

It makes some other things so probably it is needed (and as can see stack it was more about whole cache, but of course I can't revise head of Wlad :)

2. In Query_cache::resize() I can see block-level locks are acquired with the
    following comment:
    <quot>
    Wait for all readers and writers to exit. When the list of all queries
    is iterated over with a block level lock, we are done.
    </quot>

    Isn't it needed in ::free_cache() also?

Free cache used in
1) init (it definitely do not need)
2) unlock with check that there is no requests (when switching cache off)
3) destruction here (as I think) all clients should be disconnected already because of server shutdown.
4) resize (but here you see that it was locked and unlocked


[skip]


References