pgsql: Fix possible failure to send final transaction counts to stats c

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: pgsql-committers(at)postgresql(dot)org
Subject: pgsql: Fix possible failure to send final transaction counts to stats c
Date: 2013-02-07 19:44:49
Message-ID: [email protected]
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-committers

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.

Branch
------
REL9_2_STABLE

Details
-------
http://git.postgresql.org/pg/commitdiff/89b81f0d8b7cfaf8f317b09b43a030725c7d71de

Modified Files
--------------
src/backend/postmaster/pgstat.c | 4 ++--
1 files changed, 2 insertions(+), 2 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Tom Lane 2013-02-07 22:44:58 pgsql: Repair bugs in GiST page splitting code for multi-column indexes
Previous Message Simon Riggs 2013-02-07 18:58:02 Re: [COMMITTERS] pgsql: Fast promote mode skips checkpoint at end of recovery.