]> granicus.if.org Git - postgresql/commit
Fix possible failure to send final transaction counts to stats collector.
authorTom Lane <tgl@sss.pgh.pa.us>
Thu, 7 Feb 2013 19:44:24 +0000 (14:44 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Thu, 7 Feb 2013 19:44:24 +0000 (14:44 -0500)
commit19c115cb9aa6b4348849402827be45086ebc8a43
treefd523c933ead52979b4e5386b43f1f56fb8ab8eb
parent2228ce6a11def75e11f0232592848614f27bd7dc
Fix possible failure to send final transaction counts to stats collector.

Normally, we suppress sending a tabstats message to the collector unless
there were some actual table stats to send.  However, during backend exit
we should force out the message if there are any transaction commit/abort
counts to send, else the session's last few commit/abort counts will never
get reported at all.  We had logic for this, but the short-circuit test
at the top of pgstat_report_stat() ignored the "force" flag, with the
consequence that session-ending transactions that touched no database-local
tables would not get counted.  Seems to be an oversight in my commit
641912b4d17fd214a5e5bae4e7bb9ddbc28b144b, which added the "force" flag.
That was back in 8.3, so back-patch to all supported versions.
src/backend/postmaster/pgstat.c