← Back to team overview

maria-developers team mailing list archive

Re: metadata_lock_info plugin


Hi guys! i'm a bit far from mariadb source :( but let me help with some

2013/11/7 kentoku <kentokushiba@xxxxxxxxx>

> Hi Sergey,
> > please find iterator prototype attached. I didn't test it.
> Thanks a lot. I'll try it.
> > > > - Roberto suggests to add QUERY_ID column and I agree
> > >
> > > Not fixed. Where can I get locker's QUERY_ID?
> > It is mdl_ctx->get_owner()->get_thd()->query_id.

i think the locker for query_id is the same for thread id, not? they are in
the same THD class variable at least

> I think it is owner thread's current query_id. This query_id should be
> query_id when lock was taken. Why do you need query_id in this table?

like the processlist and KILL QUERY ID, the query id is the only way to
know what query have the lock
with the thread id we could have the same information, but the query id
could change between the first and the second SELECT at information schema
for example
in other words query id is something to have the precise information about
the query with that lock, and not the "thread id" with that lock and the
wrong "query id"
that's the same point solved by the KILL QUERY ID command

> > > > - Roberto suggests to add LOCK_DURATION column and I agree
> > >
> > > Fixed. If calling find_ticket() for getting LOCK_DURATION is costly, I
> will
> > > change it. Please review it.
> > It's a bit heavy indeed. What is the other option you're considering?
i didn't read the patch yet,
but duration is a nice information to check what the DBA should do with
some problem at slow queries or blocks
for example a lock with more than 60 seconds could be killed, and less than
60 not... just to help DBA and to get nice numbers to developers select how
many time he should consider in a MDL (statistic information)

> On debug build, MDL_ticket class has enum_mdl_duration. I think this
> enum_mdl_duration can use for non debug build, if remove "#ifndef DBUG_OFF"
> for enum_mdl_duration. How do you think about it?

i didn't checked that :( sorry maybe just with debug version this could work
but let's think about who will use mdl plugin.... i think that MDL plugin
is just to developers and DBA that need more information, in this case they
probably will use the debug version, right?!

> Thanks,
> Kentoku
thanks guys! =)

Roberto Spadim