diff options
| author | Michael Paquier <michael@paquier.xyz> | 2025-10-29 09:13:31 +0900 |
|---|---|---|
| committer | Michael Paquier <michael@paquier.xyz> | 2025-10-29 09:13:31 +0900 |
| commit | d3111cb753e81a64c1a4417ed6de98a90a04432a (patch) | |
| tree | 364cd382d129ce691a3e2914e06e4b2b87ed39a0 /src/test/modules/test_int128/test_int128.c | |
| parent | b3ce55f413cdf70b1bc4724052fb4eacf9de239a (diff) | |
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 f9a09aa29520 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
Diffstat (limited to 'src/test/modules/test_int128/test_int128.c')
0 files changed, 0 insertions, 0 deletions
