Re: Range checks of pg_test_fsync --secs-per-test and pg_test_timing --duration

From: Peter Eisentraut <peter(dot)eisentraut(at)2ndquadrant(dot)com>
To: Michael Paquier <michael(at)paquier(dot)xyz>
Cc: Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Range checks of pg_test_fsync --secs-per-test and pg_test_timing --duration
Date: 2020-09-07 08:06:57
Message-ID: f3942fa1-8aea-a2c0-4443-ce7d76b9c01b@2ndquadrant.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 2020-09-06 05:04, Michael Paquier wrote:
>> I would allow 0. It's not
>> very useful, but it's not harmful and could be applicable in testing.
>
> Hmm, OK. For pg_test_fsync, 0 means infinity, and for pg_test_timing
> that means stopping immediately (we currently don't allow that). How
> does this apply to testing? For pg_test_fsync, using 0 would mean to
> just remain stuck in the first fsync() pattern, while for
> pg_test_fsync this means doing no test loops at all, generating a
> useless log once done. Or do you mean to change the logic of
> pg_test_fsync so as --secs-per-test=0 means doing one single write?
> That's something I thought about for this thread, but I am not sure
> that the extra regression test gain is worth more complexity in this
> code.

I think in general doing something 0 times should be allowed if possible.

However, I see that in the case of pg_test_fsync you end up in alarm(0),
which does something different, so it's okay in that case to disallow it.

I notice that the error checking you introduce is different from the
checks for pgbench -t and -T (the latter having no errno checks). I'm
not sure which is correct, but it's perhaps worth making them the same.

(pgbench -t 0, which is also currently not allowed, is a good example of
why this could be useful, because that would allow checking whether the
script etc. can be loaded without running an actual test.)

--
Peter Eisentraut http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrey M. Borodin 2020-09-07 08:36:46 Re: Yet another fast GiST build (typo)
Previous Message k.jamison@fujitsu.com 2020-09-07 08:03:05 RE: [Patch] Optimize dropping of relation buffers using dlist