]> git.ipfire.org Git - thirdparty/postgresql.git/commitdiff
Fix error message related to end TLI in backup manifest
authorMichael Paquier <michael@paquier.xyz>
Sun, 18 Jan 2026 08:25:04 +0000 (17:25 +0900)
committerMichael Paquier <michael@paquier.xyz>
Sun, 18 Jan 2026 08:25:04 +0000 (17:25 +0900)
The code adding the WAL information included in a backup manifest is
cross-checked with the contents of the timeline history file of the end
timeline.  A check based on the end timeline, when it fails, reported
the value of the start timeline in the error message.  This error is
fixed to show the correct timeline number in the report.

This error report would be confusing for users if seen, because it would
provide an incorrect information, so backpatch all the way down.

Oversight in 0d8c9c1210c4.

Author: Man Zeng <zengman@halodbtech.com>
Discussion: https://postgr.es/m/tencent_0F2949C4594556F672CF4658@qq.com
Backpatch-through: 14

src/backend/replication/backup_manifest.c

index 2719104487118d5cd0445e74948a1d276e6a32c1..0968d91c61bc55046d1a4f9830efdd6effee838e 100644 (file)
@@ -249,7 +249,7 @@ AddWALInfoToBackupManifest(backup_manifest_info *manifest, XLogRecPtr startptr,
                if (first_wal_range && endtli != entry->tli)
                        ereport(ERROR,
                                        errmsg("expected end timeline %u but found timeline %u",
-                                                  starttli, entry->tli));
+                                                  endtli, entry->tli));
 
                /*
                 * If this timeline entry matches with the timeline on which the