Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
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

+7
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)