postgres/src/backend
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
..
access Fix correctness issue with computation of FPI size in WAL stats 2025-10-29 09:13:31 +09:00
archive
backup Don't include access/htup_details.h in executor/tuptable.h 2025-10-05 18:00:38 +02:00
bootstrap Add new OID alias type regdatabase. 2025-06-30 15:38:54 -05:00
catalog Don't error out when dropping constraint if relchecks is already zero 2025-10-28 19:13:32 +01:00
commands Add worker type argument to logical replication worker functions. 2025-10-28 05:47:50 +00:00
executor Add wal_fpi_bytes to pg_stat_wal and pg_stat_get_backend_wal() 2025-10-28 16:21:51 +09:00
foreign Track the number of presorted outer pathkeys in MergePath 2025-05-08 18:21:32 +09:00
jit Fix incorrect zero extension of Datum in JIT tuple deform code 2025-10-23 13:11:02 +13:00
lib Replace defunct URL with stable archive.org URL in rbtree.c 2025-10-17 09:38:49 +02:00
libpq Remove hbaPort type 2025-09-15 11:04:10 +02:00
main Force LC_COLLATE to C in postmaster. 2025-07-16 14:13:18 -07:00
nodes Fix internal error from CollateExpr in SQL/JSON DEFAULT expressions 2025-10-09 01:07:59 -04:00
optimizer Use CompactAttribute more often, when possible 2025-10-22 11:36:26 +13:00
parser Introduce "REFRESH SEQUENCES" for subscriptions. 2025-10-23 08:30:27 +00:00
partitioning Avoid leakage of zero-length arrays in partition_bounds_copy(). 2025-08-02 21:59:46 -04:00
po Translation updates 2025-05-05 12:04:49 +02:00
port Remove traces of support for Sun Studio compiler 2025-09-12 07:39:05 +02:00
postmaster Avoid assuming that time_t can fit in an int. 2025-10-22 17:50:11 -04:00
regex Add pg_iswalpha() and related functions. 2025-10-15 12:54:01 -07:00
replication Add worker type argument to logical replication worker functions. 2025-10-28 05:47:50 +00:00
rewrite Don't generate fake "*TLOCRN*" or "*TROCRN*" aliases, either. 2025-09-08 12:58:07 -04:00
snowball Use PG_MODULE_MAGIC_EXT in our installable shared libraries. 2025-03-26 11:11:02 -04:00
statistics Fix lookups in pg_{clear,restore}_{attribute,relation}_stats(). 2025-10-15 12:47:33 -05:00
storage Fix a couple of comments. 2025-10-27 10:30:05 -05:00
tcop Add ExplainState argument to pg_plan_query() and planner(). 2025-10-08 08:33:29 -04:00
tsearch tsearch: use database default collation for parsing. 2025-10-21 09:31:49 -07:00
utils formatting.c cleanup: Move loop variables definitions into for statement 2025-10-28 19:20:17 +01:00
.gitignore
common.mk
Makefile aio: Add liburing dependency 2025-03-26 19:45:32 -04:00
meson.build meson: add and use stamp files for generated headers 2025-08-11 15:18:23 -04:00
nls.mk Create a separate file listing backend types 2025-09-26 15:21:49 +02:00