Error on pgbench logs

YoungHwan Joo <rulyox@gmail.com>

From: YoungHwan Joo <rulyox@gmail.com>
To: pgsql-hackers@lists.postgresql.org
Date: 2021-06-08T03:09:47Z
Lists: pgsql-hackers

Attachments

Hello!

While I was using pgbench from the master branch, I discovered an error on
pgbench logs.
When I run pgbench, the log file contains a lot of redundant 0s.

I ran git bisect and found out that this error occured since the commit
547f04e7348b6ed992bd4a197d39661fe7c25097 (Mar 10, 2021).

I ran the tests below on the problematic commit and the commit before it.
(I used Debian 10.9 and Ubuntu 20.04)

=====
./pg_ctl -D /tmp/data init
./pg_ctl -D /tmp/data start

./pgbench -i -s 1 postgres

./pgbench -r -c 1 -j 1 -T 1 --aggregate-interval 1 -l --log-prefix
pgbench-log postgres
./pgbench -r -c 2 -j 4 -T 60 --aggregate-interval 1 -l --log-prefix
pgbench-log postgres
./pgbench -r -c 2 -j 4 -T 60 --aggregate-interval 10 -l --log-prefix
pgbench-log postgres
=====

The result screenshots are in the attachments.
(I didn't attach the problematic 60 second log file which was bigger than
1GB.)

Please take a look at this issue.

Thank you!

Regards,
YoungHwan

Commits

  1. Fix pgbench timestamp bugs.

  2. pgbench: Improve time logic.

  3. Make [U]INT64CONST safe for use in #if conditions.

  4. Teach libpq to detect integer overflow in the row count of a PGresult.