Fix the computation of slot stats for 'total_bytes'.

Amit Kapila <akapila@postgresql.org>

Commit: 205f466282be11ec97506f73341e47b72e0aee5d
Author: Amit Kapila <akapila@postgresql.org>
Date: 2021-05-03T01:52:08Z
Releases: 14.0
Fix the computation of slot stats for 'total_bytes'.

Previously, we were using the size of all the changes present in
ReorderBuffer to compute total_bytes after decoding a transaction and that
can lead to counting some of the transactions' changes more than once. Fix
it by using the size of the changes decoded for a transaction to compute
'total_bytes'.

Author: Sawada Masahiko
Reviewed-by: Vignesh C, Amit Kapila
Discussion: https://postgr.es/m/20210319185247.ldebgpdaxsowiflw@alap3.anarazel.de

Files

PathChange+/−
src/backend/replication/logical/reorderbuffer.c modified +19 −20

Discussion