postgresql/src
Heikki Linnakangas 547a8aaa7d Don't reset 'latest_page_number' when replaying multixid truncation
'latest_page_number' is set to the correct value, according to
nextOffset, early at system startup. Contrary to the comment, it hence
should be set up correctly by the time we get to WAL replay.

This fixes a failure to replay WAL generated on older minor versions,
before commit 789d65364c (18.2, 17.8, 16.12, 15.16, 14.21). The
failure occurs after a truncation record has been replayed and looks
like this:

    FATAL:  could not access status of transaction 858112
    DETAIL:  Could not read from file "pg_multixact/offsets/000D" at offset 24576: read too few bytes.
    CONTEXT:  WAL redo at 3/2A3AB408 for MultiXact/CREATE_ID: 858111 offset 6695072 nmembers 5: 1048228 (sh) 1048271 (keysh) 1048316 (sh) 1048344 (keysh) 1048370 (sh)

Reported-by: Sebastian Webber <sebastian@swebber.me>
Reviewed-by: Andrey Borodin <x4mmm@yandex-team.ru>
Reviewed-by: Kirill Reshke <reshkekirill@gmail.com>
Discussion: https://www.postgresql.org/message-id/20260214090150.GC2297@p46.dedyn.io;lightning.p46.dedyn.io
Backpatch-through: 14-18
2026-02-16 17:20:56 +02:00
..
backend Don't reset 'latest_page_number' when replaying multixid truncation 2026-02-16 17:20:56 +02:00
bin Translation updates 2026-02-08 15:11:05 +01:00
common Fix mb2wchar functions on short input. 2026-02-09 12:38:12 +13:00
fe_utils In fmtIdEnc(), handle failure of enlargePQExpBuffer(). 2025-02-16 12:46:35 -05:00
include Don't reset 'latest_page_number' when replaying multixid truncation 2026-02-16 17:20:56 +02:00
interfaces Translation updates 2026-02-08 15:11:05 +01:00
makefiles Add NO_INSTALL option to pgxs 2021-05-27 13:58:29 +02:00
pl Fix plpgsql's handling of "return simple_record_variable". 2026-02-11 16:53:14 -05:00
port Fix POSIX compliance in pgwin32_unsetenv() for "name" argument 2025-10-21 08:08:42 +09:00
template On NetBSD, force dynamic symbol resolution at postmaster start. 2022-08-30 17:29:03 -04:00
test Fix SUBSTRING() for toasted multibyte characters. 2026-02-14 12:16:21 -08:00
timezone Update time zone data files to tzdata release 2025c. 2026-01-18 14:55:13 -05:00
tools Harden _int_matchsel() against being attached to the wrong operator. 2026-02-09 10:14:22 -05:00
tutorial Doc: sync src/tutorial/basics.source with SGML documentation. 2022-11-19 13:09:14 -05:00
.gitignore
DEVELOPERS
Makefile Remove the option to build thread_test.c outside configure. 2020-10-21 12:08:48 -04:00
Makefile.global.in Don't put library-supplied -L/-I switches before user-supplied ones. 2025-07-29 15:17:41 -04:00
Makefile.shlib Stop using "-multiply_defined suppress" on macOS. 2023-09-26 21:06:21 -04:00
nls-global.mk Fix update-po for the PGXS case 2025-10-16 20:21:05 +02:00