Fix the computation of slot stats for 'total_bytes'.
authorAmit Kapila <akapila@postgresql.org>
Mon, 3 May 2021 01:52:08 +0000 (07:22 +0530)
committerAmit Kapila <akapila@postgresql.org>
Mon, 3 May 2021 01:52:08 +0000 (07:22 +0530)
commit205f466282be11ec97506f73341e47b72e0aee5d
tree64f98a2c182758483d700306f6b1ca86751cdf35
parenteb086056fec44516efdd5db71244a079fed65c7f
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
src/backend/replication/logical/reorderbuffer.c