← Back to team overview

ourdelta-developers team mailing list archive

Re: fix from Neil Katin for userstatv2

 

I'll leave valgrind running all night on my development box.

It's altogether possible that the leak isn't a leak in the traditional
sense.

With the CLIENT_STATISTICS bug, what was actually happening is that a flood
of queries were received with 3rd-level domains as hostnames--all longer
than 16 characters long.

MySQL tried to match the long hostname with an already exiting one. We ended
up getting a new entry in the CLIENT_STATISTICS table for every query. When
we issued a SELECT on that table, all the columns were 0 (IIRC) except for
the second one displayed. That one displayed a truncated hostname.

... So that wasn't really forgetting to free some malloc'ed memory. It was
just that the longer mysqld ran, the larger the CLIENT_STATISTICS table grew
... and it just kept growing (and growing and growing).

It's possible that what our admins are reporting isn't really a leak, but
some internal table growing. It might be that a "fix" would be to just have
a switch (global variable/my.cnf cirective) to disable the tables we aren't
using, then see if the bloat stops ...

I'll DoS my box all night and see what valgrind says tomorrow morning. (Thus
far, the only errors I've seen are three "Conditional jump of move depends
on uninitialised value(s)" in strmake (strmake.c:44), on initialization.)

Thanks for your reply.

WW

On Tue, Sep 29, 2009 at 4:39 PM, Arjen Lentz <arjen@xxxxxxxxxxxxx> wrote:

> Hi Weldon
>
> On 30/09/2009, at 2:48 AM, Weldon Whipple wrote:
>
>> I noticed elsewhere a mention of Neil Katin's memory leak fix in 5.0.86.
>> Is the CLIENT USER_STATISTICS patch described below that patch? (If it is, I
>> will quit  pursuing the fix, since I have already incorporated his fix in
>> our source tree. Thanks, Neil!!)
>>
>> Our system administrators report that there might still be a small memory
>> leak in our mysql servers--it appears in a few of our boxes. If you are
>> aware of other memory leaks in any of the Google or Percona patches, I would
>> appreciate hearing about them, so I can compare the changes with our own
>> code. The leaks *might* be in vanilla mysql itself ...??
>>
>
> Do you have a chance of running under Valgrind (perhaps a slave) ?
>
> Cheers,
> Arjen.
>
>
>
>  On Fri, Sep 25, 2009 at 5:38 PM, Arjen Lentz <arjen@xxxxxxxxxxxxx> wrote:
>> Hi Vadim
>>
>> Please merge this in (sorry the paths are from the ourdelta tree, but the
>> offset within the file is compatible with yours)
>>
>> === modified file 'mysql/5.0/percona_maintained/userstatv2.patch'
>> --- mysql/5.0/percona_maintained/userstatv2.patch       2009-09-25
>> 23:16:39 +0000
>> +++ mysql/5.0/percona_maintained/userstatv2.patch       2009-09-25
>> 23:28:28 +0000
>> @@ -3901,7 +3901,7 @@
>>
>>  +ST_FIELD_INFO user_stats_fields_info[]=
>>  +{
>> -+  {"USER", 16, MYSQL_TYPE_STRING, 0, 0, "User"},
>> ++  {"USER", USERNAME_LENGTH, MYSQL_TYPE_STRING, 0, 0, "User"},
>>
>>
>>
>> By the way, his fix for the CLIENT field was HOSTNAME_LENGTH (60) whereas
>> you used LIST_PROCESS_HOST_LEN (64)
>> In the mysql.user table the host field is a CHAR(60), so I'm guessing that
>> Neil picked the correct macro.
>> Harmless in this case, now, but might as well use the proper macro because
>> if anything else changes later it could break.
>>
>>
>> --
>> Arjen Lentz, Exec.Director @ Open Query (http://openquery.com)
>> Exceptional Services for MySQL at a fixed budget.
>>
>> Follow our blog at http://openquery.com/blog/
>> OurDelta: enhanced builds for MySQL @ http://ourdelta.org
>>
>>
>>
>>
>>
>>
>>
>>
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~ourdelta-developers<https://launchpad.net/%7Eourdelta-developers>
>> Post to     : ourdelta-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~ourdelta-developers<https://launchpad.net/%7Eourdelta-developers>
>> More help   : https://help.launchpad.net/ListHelp
>>
>> _______________________________________________
>> Mailing list: https://launchpad.net/~ourdelta-developers<https://launchpad.net/%7Eourdelta-developers>
>> Post to     : ourdelta-developers@xxxxxxxxxxxxxxxxxxx
>> Unsubscribe : https://launchpad.net/~ourdelta-developers<https://launchpad.net/%7Eourdelta-developers>
>> More help   : https://help.launchpad.net/ListHelp
>>
>
> --
> Arjen Lentz, Exec.Director @ Open Query (http://openquery.com)
> Exceptional Services for MySQL at a fixed budget.
>
> Follow our blog at http://openquery.com/blog/
> OurDelta: enhanced builds for MySQL @ http://ourdelta.org
>
>
>
>
>
>
>
>
>

Follow ups

References