Re: Simulating Clog Contention

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Robert Haas <robertmhaas(at)gmail(dot)com>
Cc: Simon Riggs <simon(at)2ndquadrant(dot)com>, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Simulating Clog Contention
Date: 2012-01-30 15:48:34
Message-ID: CAMkU=1xCX+Uk76c8T=VnFOGu4V4qU+7Y0fgg4ghibnjzjfDL7w@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Mon, Jan 30, 2012 at 7:24 AM, Robert Haas <robertmhaas(at)gmail(dot)com> wrote:
> On Sat, Jan 28, 2012 at 3:32 PM, Jeff Janes <jeff(dot)janes(at)gmail(dot)com> wrote:
>>> I think that even in normal (non-initialization) usage, this message
>>> should be suppressed when the provided scale factor
>>> is equal to the pgbench_branches table count.
>>
>> The attached patch does just that.  There is probably no reason to
>> warn people that we are doing what they told us to, but not for the
>> reason they think.
>
> In my opinion, a more sensible approach than anything we're doing
> right now would be to outright *reject* options that will only be
> ignored.  If -s isn't supported except with -i, then trying to specify
> -s without -i should just error out at the options-parsing stage,
> before we even try to connect to the database.  It's not very helpful
> to accept options and then ignore them, and we have many instances of
> that right now: initialization-only switches are accepted and ignored
> when not initializing, and run-only switches are accepted and ignored
> with initializing.

I like the ability to say, effectively, "I think I had previously did
the initialization with -s 40, if I actually didn't then scream at me,
and if I did then go ahead and do the pgbench I just asked for".
But, since it does unconditionally report the scale actually used and
I just have to have the discipline to go look at the result, I can see
where this is perhaps overkill. In my own (non-PG-related) code,
when I have tasks that have to be run in multiple phases that can get
out of sync if I am not careful, I like to be able to specify the
flags even in the "unused" invocation, so that the code can verify I
am being consistent. Code is better at that than I am.

I'm not sure I know what all would be incompatible with what. I could
start drawing that matrix up once the API stabilizes, but I think you
are still planning on whacking this -I option around a bit.

Cheers,

Jeff

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jeff Janes 2012-01-30 15:53:36 Re: Simulating Clog Contention
Previous Message hubert depesz lubaczewski 2012-01-30 15:39:13 Re: pg_dump -s dumps data?!