Re: [HACKERS] pgbench small bug fix

2016-03-09 Thread Fabien COELHO
OK, I've committed the fix for the -T part. It didn't back-patch cleanly, and it is a minor bug, so I'm not inclined to worry about it further. I agree that it is a very minor bug and not necessary worth back-patching. I didn't commit the fix for the -P part, because Alvaro objected to the

Re: [HACKERS] pgbench small bug fix

2016-03-09 Thread Robert Haas
On Wed, Mar 9, 2016 at 4:12 AM, Fabien COELHO wrote: >> On Wed, Jan 27, 2016 at 2:31 PM, Fabien COELHO >> wrote: >>> >>> - when a duration (-T) is specified, ensure that pgbench ends at that >>>time (i.e. do not wait for a transaction beyond the end

Re: [HACKERS] pgbench small bug fix

2016-03-09 Thread Fabien COELHO
On Wed, Jan 27, 2016 at 2:31 PM, Fabien COELHO wrote: - when a duration (-T) is specified, ensure that pgbench ends at that time (i.e. do not wait for a transaction beyond the end of the run). Every other place where doCustom() returns false is implemented as return

Re: [HACKERS] pgbench small bug fix

2016-03-08 Thread Robert Haas
On Wed, Jan 27, 2016 at 2:31 PM, Fabien COELHO wrote: > - when a duration (-T) is specified, ensure that pgbench ends at that >time (i.e. do not wait for a transaction beyond the end of the run). Every other place where doCustom() returns false is implemented as return

Re: [HACKERS] pgbench small bug fix

2016-03-04 Thread Fabien COELHO
You're probably right, but TBH I'm pretty unsure about this whole thing. If the question is "is there a bug", then answer is yes. The progress report may disappear if thread 0 happens to stop, even of all other threads go on. Obviously it only concerns slow queries, but there is no reason why

Re: [HACKERS] pgbench small bug fix

2016-03-04 Thread Alvaro Herrera
Fabien COELHO wrote: > > >>Probably it is possible, but it will sure need more that one little > >>condition to be achieved... I do not think that introducing a non trivial > >>distributed election algorithm involving locks and so would be a good > >>decision for this very little matter. > >> >

Re: [HACKERS] pgbench small bug fix

2016-03-04 Thread Fabien COELHO
Probably it is possible, but it will sure need more that one little condition to be achieved... I do not think that introducing a non trivial distributed election algorithm involving locks and so would be a good decision for this very little matter. My advice is "keep it simple". If this is a

Re: [HACKERS] pgbench small bug fix

2016-03-04 Thread Alvaro Herrera
Fabien COELHO wrote: > Probably it is possible, but it will sure need more that one little > condition to be achieved... I do not think that introducing a non trivial > distributed election algorithm involving locks and so would be a good > decision for this very little matter. > > My advice is

Re: [HACKERS] pgbench small bug fix

2016-03-04 Thread Fabien COELHO
Hello Alvaro, Attached is a v3 which test integers more logically. I'm a lazy programmer who tends to minimize the number of key strokes. Well. From what I can tell this patch is Ready for Committer. I'm not a fan of this approach either. Would it be too complicated if we had a global

Re: [HACKERS] pgbench small bug fix

2016-03-04 Thread Alvaro Herrera
Aleksander Alekseev wrote: > > Attached is a v3 which test integers more logically. I'm a lazy > > programmer who tends to minimize the number of key strokes. > > Well. From what I can tell this patch is Ready for Committer. I'm not a fan of this approach either. Would it be too complicated if

Re: [HACKERS] pgbench small bug fix

2016-03-04 Thread Aleksander Alekseev
> Attached is a v3 which test integers more logically. I'm a lazy > programmer who tends to minimize the number of key strokes. Well. From what I can tell this patch is Ready for Committer. -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your

Re: [HACKERS] pgbench small bug fix

2016-03-03 Thread Fabien COELHO
Hello Aleksander, Thanks for the look at the patch. time pgbench -T 5 -R 0.1 -P 1 -c 2 -j 2 On my laptop this command executes 25 seconds instead of 5. I'm pretty sure it IS a bug. Probably a minor one though. Sure. [...] you should probably write: if(someint > 0) Ok. if(somebool

Re: [HACKERS] pgbench small bug fix

2016-03-03 Thread Robert Haas
On Thu, Mar 3, 2016 at 7:23 AM, Aleksander Alekseev wrote: >> time pgbench -T 5 -R 0.1 -P 1 -c 2 -j 2 > > On my laptop this command executes 25 seconds instead of 5. I'm pretty > sure it IS a bug. Probably a minor one though. > > I tested this patch on Ubuntu 14.04 LTS

Re: [HACKERS] pgbench small bug fix

2016-03-03 Thread Aleksander Alekseev
> time pgbench -T 5 -R 0.1 -P 1 -c 2 -j 2 On my laptop this command executes 25 seconds instead of 5. I'm pretty sure it IS a bug. Probably a minor one though. I tested this patch on Ubuntu 14.04 LTS with GCC 4.8. It applies cleanly on master branch (c7111d11) and solves a described problem. No

Re: [HACKERS] pgbench small bug fix

2016-02-07 Thread Fabien COELHO
Hello Robert, > While testing for something else I encountered two small bugs under very low > rate (--rate=0.1). The attached patches fixes these. > > - when a duration (-T) is specified, ensure that pgbench ends at that >time (i.e. do

Re: [HACKERS] pgbench small bug fix

2016-02-06 Thread Robert Haas
On Wed, Jan 27, 2016 at 2:31 PM, Fabien COELHO wrote: > > While testing for something else I encountered two small bugs under very low > rate (--rate=0.1). The attached patches fixes these. > > - when a duration (-T) is specified, ensure that pgbench ends at that >time

[HACKERS] pgbench small bug fix

2016-01-27 Thread Fabien COELHO
While testing for something else I encountered two small bugs under very low rate (--rate=0.1). The attached patches fixes these. - when a duration (-T) is specified, ensure that pgbench ends at that time (i.e. do not wait for a transaction beyond the end of the run). - when there is a