← Back to team overview

mysql-proxy-discuss team mailing list archive

Re: funnel - a multiplexer plugin for mysql-proxy

 

Hi!

On Tue, Feb 24, 2009 at 10:49 AM, Jan Kneschke <jan@xxxxxxxxxxx> wrote:
> nick loeve wrote:
>> Hey
>>
>>
>> Well I fixed a couple of issues. Im a bit stuck with the following issue:
>>
>> If I set event-threads > 0 then we get memory corruption like the
>> following backtrace.
>
> [...]
>
>> As each connection should have it's state machine running in exactly
>> one thread at any given time, So I am not how the network_socket
>> queues are becoming an issue.
>>
>> I assume though that although the crash consistently happens while
>> processing the network_socket queues, it may have been caused by my
>> stupidity elsewhere.
>>
>> Running with '--event-threads=0' shows no issue.
>>
>> This has pretty stopped me flat at the moment... any help/pointers
>> would be appreciated.
>
> I'll take a look at it today.

I have pushed a new version of my branch, which adds a simplified
version of the funnel plugin (rebased against 0.8 branch). This plugin
now assumes outright that it runs locally next to a single mysqld
instance, and also that all authentication will be done by a single
user accessing a single database (we run in a locked down network and
do not rely on mysqld authentication/authorization).

Later, once we have some stability I would like to add the capability
for more non-local backends, and different users etc back in again,
but for now I am focusing on getting a stable build for the use-case
we have here at work.

I still see memory corruption when using the event threads,
specifically when I push/pull from the backlog. If I alter the
behavior to not multiplex connections, the corruption disappears.
Using the proxy plugin I see no corruption, but then that is never
sharing backend connections amongst clients. So im guessing my attempt
at adding a global backlog or my understanding of the mysql protocol
is flawed.

Im tearing my hair out to spot the point where concurrent memory
alloc/free is happening. If anyone cares to take a look that would be
awesome!

If you anyone has any questions Id be more than happy to explain, and
to start the 'funnel' in front of a mysqld instance just run:

./sbin/mysql-proxy --plugins=funnel
--funnel-backend=/var/run/mysqld/mysqld.sock
--funnel-max-backend-cons=XXX

Cheers

-- 
Nick Loeve



Follow ups

References