postgres/src/backend/access
Michael Paquier d3111cb753 Fix correctness issue with computation of FPI size in WAL stats
XLogRecordAssemble() may be called multiple times before inserting a
record in XLogInsertRecord(), and the amount of FPIs generated inside
a record whose insertion is attempted multiple times may vary.

The logic added in f9a09aa295 touched directly pgWalUsage in
XLogRecordAssemble(), meaning that it could be possible for pgWalUsage
to be incremented multiple times for a single record.  This commit
changes the code to use the same logic as the number of FPIs added to a
record, where XLogRecordAssemble() returns this information and feeds it
to XLogInsertRecord(), updating pgWalUsage only when a record is
inserted.

Reported-by: Shinya Kato <shinya11.kato@gmail.com>
Discussion: https://postgr.es/m/CAOzEurSiSr+rusd0GzVy8Bt30QwLTK=ugVMnF6=5WhsSrukvvw@mail.gmail.com
2025-10-29 09:13:31 +09:00
..
brin Add some const qualifications 2025-10-27 09:55:59 +01:00
common Add log_autoanalyze_min_duration 2025-10-15 14:31:12 +02:00
gin Add some const qualifications 2025-10-27 09:55:59 +01:00
gist Remove Item type 2025-10-27 09:55:59 +01:00
hash Remove Item type 2025-10-27 09:55:59 +01:00
heap Remove Item type 2025-10-27 09:55:59 +01:00
index Remove PointerIsValid() 2025-09-24 15:17:20 +02:00
nbtree Add some const qualifications 2025-10-27 09:55:59 +01:00
rmgrdesc Eliminate XLOG_HEAP2_VISIBLE from vacuum phase III 2025-10-13 18:01:06 -04:00
sequence Update copyright for 2025 2025-01-01 11:21:55 -05:00
spgist Remove Item type 2025-10-27 09:55:59 +01:00
table Update some more forward declarations to use typedef 2025-09-25 14:33:19 +02:00
tablesample Update copyright for 2025 2025-01-01 11:21:55 -05:00
transam Fix correctness issue with computation of FPI size in WAL stats 2025-10-29 09:13:31 +09:00
Makefile Introduce sequence_*() access functions 2024-02-26 16:04:59 +09:00
meson.build Update copyright for 2025 2025-01-01 11:21:55 -05:00