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

Commit8a7025f

Browse files
committed
Move pgstat_report_tabstat() call so that stats are not reported to the
collector until the transaction commits. Per recent discussion, thisshould avoid confusing autovacuum when an updating transaction runs fora long time.
1 parente719591 commit8a7025f

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

‎src/backend/tcop/postgres.c

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.437 2004/11/14 19:35:31 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/tcop/postgres.c,v 1.438 2004/11/20 00:48:58 tgl Exp $
1212
*
1313
* NOTES
1414
* this is the "main" module of the postgres backend and
@@ -2904,19 +2904,20 @@ PostgresMain(int argc, char *argv[], const char *username)
29042904
* This is also a good time to send collected statistics to the
29052905
* collector, and to update the PS stats display. We avoid doing
29062906
* those every time through the message loop because it'd slow
2907-
* down processing of batched messages.
2907+
* down processing of batched messages, and because we don't want
2908+
* to report uncommitted updates (that confuses autovacuum).
29082909
*/
29092910
if (send_rfq)
29102911
{
2911-
pgstat_report_tabstat();
2912-
29132912
if (IsTransactionOrTransactionBlock())
29142913
{
29152914
set_ps_display("idle in transaction");
29162915
pgstat_report_activity("<IDLE> in transaction");
29172916
}
29182917
else
29192918
{
2919+
pgstat_report_tabstat();
2920+
29202921
set_ps_display("idle");
29212922
pgstat_report_activity("<IDLE>");
29222923
}

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp