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

Commitea9ac77

Browse files
committed
Reset pg_stat_activity.xact_start during PREPARE TRANSACTION.
Once we've completed a PREPARE, our session is not running a transaction,so its entry in pg_stat_activity should show xact_start as null, ratherthan leaving the value as the start time of the now-prepared transaction.I think possibly this oversight was triggered by faulty extrapolationfrom the adjacent comment that says PrepareTransaction should not callAtEOXact_PgStat, so tweak the wording of that comment.Noted by Andres Freund while considering bug #10123 from Maxim Boguk,although this error doesn't seem to explain that report.Back-patch to all active branches.
1 parentf9cd2b7 commitea9ac77

File tree

1 file changed

+2
-1
lines changed
  • src/backend/access/transam

1 file changed

+2
-1
lines changed

‎src/backend/access/transam/xact.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2247,8 +2247,9 @@ PrepareTransaction(void)
22472247
AtEOXact_Files();
22482248
AtEOXact_ComboCid();
22492249
AtEOXact_HashTables(true);
2250-
/* don't call AtEOXact_PgStat here */
2250+
/* don't call AtEOXact_PgStat here; we fixed pgstat state above */
22512251
AtEOXact_Snapshot(true);
2252+
pgstat_report_xact_timestamp(0);
22522253

22532254
CurrentResourceOwner=NULL;
22542255
ResourceOwnerDelete(TopTransactionResourceOwner);

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp