← Back to team overview

randgen team mailing list archive

Re: A randgen coding question - getting child process id's ona per-query basis.

 

Hi,

In a grammar, you can already use:

query:
SELECT * FROM t1 ; /* This query was generated by child process pid _pid */ ;

In perl, you can use:

query:
   SELECT * FROM t1 ; /* This query was generated by { $$ } */ ;

If you want to INSERT or UPDATE the value somewhere, you can also use:

INSERT INTO t1 VALUES (CONNECTION_ID());


What identifier for the child process do you want to record? The pid of the process, the CONNECTION_ID() as seen from MySQL, or, for say --threads=1, a number from 1 to 10 ?

Philip Stoev

----- Original Message ----- From: "Patrick Crews" <gleebix@xxxxxxxxx>
To: <randgen@xxxxxxxxxxxxxxxxxxx>
Sent: Tuesday, November 09, 2010 3:20 AM
Subject: [Randgen] A randgen coding question - getting child process id's ona per-query basis.


Hi everyone,

I'm writing to seek some coding guidance for an randgen enhancement I'm
needing:
If debug and/or sqltrace is on, I would like to know which child process
generated which query.  We're testing our transaction log and this
information would make debugging our concurrency tests much easier.

I have looked through the source code and I'm not seeing anything that's
screaming out as a starting point.  I'm kind of stuck on having this code
live in the Drizzle Executor as I don't want to sully anyone else's code,
but it seems like it would take a bit of effort to get the GenTest child
process' id to the Executor. Of course, I'm still learning to wrap my mind around the deviant mutations of logic that is known as perl so I'm probably
missing something obvious ; )

Any recommendations or thoughts are most welcome.

Thanks,
Patrick



--------------------------------------------------------------------------------


_______________________________________________
Mailing list: https://launchpad.net/~randgen
Post to     : randgen@xxxxxxxxxxxxxxxxxxx
Unsubscribe : https://launchpad.net/~randgen
More help   : https://help.launchpad.net/ListHelp





References