Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitac46de5

Browse files
committed
Smooth reporting of commit/rollback statistics.
If a connection committed or rolled back any transactions within aPGSTAT_STAT_INTERVAL pacing interval without accessing any tables,the reporting of those statistics would be held up until theconnection closed or until it ended a PGSTAT_STAT_INTERVAL intervalin which it had accessed a table. This could result in under-reporting of transactions for an extended period, followed by aspike in reported transactions.While this is arguably a bug, the impact is minimal, primarilyaffecting, and being affected by, monitoring software. It mightcause more confusion than benefit to change the existing behaviorin released stable branches, so apply only to master and the 9.4beta.Gurjeet Singh, with review and editing by Kevin Grittner,incorporating suggested changes from Abhijit Menon-Sen and TomLane.
1 parenta61daa1 commitac46de5

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎src/backend/postmaster/pgstat.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -753,7 +753,8 @@ pgstat_report_stat(bool force)
753753

754754
/* Don't expend a clock check if nothing to do */
755755
if ((pgStatTabList==NULL||pgStatTabList->tsa_used==0)&&
756-
!have_function_stats&& !force)
756+
pgStatXactCommit==0&&pgStatXactRollback==0&&
757+
!have_function_stats)
757758
return;
758759

759760
/*
@@ -817,11 +818,11 @@ pgstat_report_stat(bool force)
817818
}
818819

819820
/*
820-
* Send partial messages.If force is true, makesure that any pending
821-
*xact commit/abortgets counted, even if no table stats to send.
821+
* Send partial messages.Makesure that any pending xact commit/abort
822+
* gets counted, even if there are no table stats to send.
822823
*/
823824
if (regular_msg.m_nentries>0||
824-
(force&& (pgStatXactCommit>0||pgStatXactRollback>0)))
825+
pgStatXactCommit>0||pgStatXactRollback>0)
825826
pgstat_send_tabstat(&regular_msg);
826827
if (shared_msg.m_nentries>0)
827828
pgstat_send_tabstat(&shared_msg);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp