Re: Testing with concurrent sessions

Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>

From: Marko Tiikkaja <marko.tiikkaja@cs.helsinki.fi>
To: Craig Ringer <craig@postnewspapers.com.au>
Cc: Robert Haas <robertmhaas@gmail.com>, Kevin Grittner <Kevin.Grittner@wicourts.gov>, Peter Eisentraut <peter_e@gmx.net>, "David E. Wheeler" <david@kineticode.com>, pgsql-hackers@postgresql.org
Date: 2010-01-07T16:13:59Z
Lists: pgsql-hackers
On 2010-01-07 11:50 +0200, Craig Ringer wrote:
> On 7/01/2010 9:15 AM, Robert Haas wrote:
>> Doing this without DBI is going to be ten times harder than doing it
>> with DBI.  Are we really sure that's not a viable option?
>
> At this point, I'm personally wondering if it's worth putting together a
> simple (ish) C program that reads a file describing command
> interleavings on n connections. It fires up one thread per connection
> required, then begins queuing commands up for the threads to execute in
> per-thread fifo queues. The input file may contain synchronization
> points where two or more explicitly specified threads (or just all
> threads) must finish all their queued work before they may be given more.

> CONN conn1: dbname=regress, user=regress
> CONN conn2: dbname=regress, user=regress
> STMT conn1: SELECT blah blah;
> STMT conn2: UPDATE blah blah;
> SYNC conn1, conn2
>
> etc. Or alternately one-file-per-connection (which would be handy if one
> connection has *lots* of commands and others only occasional ones) - the
> only trouble there being how to conveniently specify synchronization points.

I had a similar syntax in mind, but instead of using threads, just 
execute the file in order using asynchronous connections.


Regards,
Marko Tiikkaja