Skip to content

Commit a6dec19

Browse files
committed
Fix bug in 2PC xact stats reporter
1 parent a7d5bb1 commit a6dec19

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

src/backend/postmaster/pgstat.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2218,6 +2218,13 @@ pgstat_twophase_postcommit(TransactionId xid, uint16 info,
22182218
pgstat_info->t_counts.t_tuples_deleted += rec->tuples_deleted;
22192219
pgstat_info->t_counts.t_truncated = rec->t_truncated;
22202220

2221+
if (rec->t_truncated)
2222+
{
2223+
/* forget live/dead stats seen by backend thus far */
2224+
pgstat_info->t_counts.t_delta_live_tuples = 0;
2225+
pgstat_info->t_counts.t_delta_dead_tuples = 0;
2226+
}
2227+
22212228
pgstat_info->t_counts.t_delta_live_tuples +=
22222229
rec->tuples_inserted - rec->tuples_deleted;
22232230
pgstat_info->t_counts.t_delta_dead_tuples +=

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy