Re: Ragged latency log data in multi-threaded pgbench

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Smith <greg(at)2ndquadrant(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Ragged latency log data in multi-threaded pgbench
Date: 2010-03-15 16:06:19
Message-ID: 19142.1268669179@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Smith <greg(at)2ndquadrant(dot)com> writes:
> Looks like sometimes a client is only getting part of its line written
> out before getting stomped on by the next one. I think one of the
> assumptions being made about how to safely write to this log file may be
> broken by the multi-process implementation, which is what you get when
> thread-safety is not available.

pgbench doesn't make any effort at all to avoid interleaved writes on
that file. I don't think there is anything much that can be done about
it when you are using the forked-processes implementation. It's
probably possible for it to show up on the multi-threads version too,
depending on how hard libc tries to interlock stdio calls.

regards, tom lane

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Merlin Moncure 2010-03-15 16:14:03 Re: Dyamic updates of NEW with pl/pgsql
Previous Message Andrew Dunstan 2010-03-15 15:58:15 Re: Ragged latency log data in multi-threaded pgbench