Content-Length: 265776 | pFad | http://github.com/postgrespro/postgres/commit/b2ed8edeecd715c8a23ae462da843578e5cde7f4

0C Fix bug in collecting total_latencies from all threads in pgbench. · postgrespro/postgres@b2ed8ed · GitHub
Skip to content

Commit b2ed8ed

Browse files
committed
Fix bug in collecting total_latencies from all threads in pgbench.
This was broken in 1bc90f7, which removed the thread-emulation. With modest -j and -c settings the result were usually close enough that you wouldn't notice it easily, but with a high enough thread count it would access uninitialized memory and crash. Per report from Andres Freund offlist.
1 parent 5e65f45 commit b2ed8ed

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/bin/pgbench/pgbench.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3456,8 +3456,8 @@ main(int argc, char **argv)
34563456
for (j = 0; j < thread->nstate; j++)
34573457
{
34583458
total_xacts += thread->state[j].cnt;
3459-
total_latencies += thread->state[i].txn_latencies;
3460-
total_sqlats += thread->state[i].txn_sqlats;
3459+
total_latencies += thread->state[j].txn_latencies;
3460+
total_sqlats += thread->state[j].txn_sqlats;
34613461
}
34623462
}
34633463
disconnect_all(state, nclients);

0 commit comments

Comments
 (0)








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: http://github.com/postgrespro/postgres/commit/b2ed8edeecd715c8a23ae462da843578e5cde7f4

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy