postgresql/src/backend
Fujii Masao 1c162c965a Report detailed errors from XLogFindNextRecord() failures.
Previously, XLogFindNextRecord() did not return detailed error information
when it failed to find a valid WAL record. As a result, callers such as
the WAL summarizer, pg_waldump, and pg_walinspect could only report generic
errors (e.g., "could not find a valid record after ..."), making
troubleshooting difficult.

This commit fix the issue by extending XLogFindNextRecord() to return
detailed error information on failure, and updating its callers to include
those details in their error messages.

For example, when pg_waldump is run on a WAL file with an invalid magic number,
it now reports not only the generic error but also the specific cause
(e.g., "invalid magic number").

Author: Anthonin Bonnefoy <anthonin.bonnefoy@datadoghq.com>
Reviewed-by: Mircea Cadariu <cadariu.mircea@gmail.com>
Reviewed-by: Japin Li <japinli@hotmail.com>
Reviewed-by: Chao Li <li.evan.chao@gmail.com>
Reviewed-by: Fujii Masao <masao.fujii@gmail.com>
Discussion: https://postgr.es/m/CAO6_XqoxJXddcT4wkd9Xd+cD6Sz-fyspRGuV4Bq-wbXG4pVNzA@mail.gmail.com
2026-03-24 22:33:09 +09:00
..
access Report detailed errors from XLogFindNextRecord() failures. 2026-03-24 22:33:09 +09:00
archive Don't include wait_event.h in pgstat.h 2026-03-06 16:24:58 +01:00
backup Add missing deflateEnd() for server-side gzip base backups 2026-03-23 09:04:44 +09:00
bootstrap Reduce header inclusions via execnodes.h 2026-03-16 14:34:57 +01:00
catalog Add support for lock statistics in pgstats 2026-03-24 15:32:09 +09:00
commands Prevent spurious "indexes on virtual generated columns are not supported". 2026-03-24 06:28:33 -04:00
executor Make many cast functions error safe 2026-03-24 12:08:22 +01:00
foreign Reduce header inclusions via execnodes.h 2026-03-16 14:34:57 +01:00
jit Reduce header inclusions via execnodes.h 2026-03-16 14:34:57 +01:00
lib dshash: Make it possible to suppress out of memory errors 2026-03-19 11:51:17 -04:00
libpq ssl: Serverside SNI support for libpq 2026-03-18 12:37:11 +01:00
main Update copyright for 2026 2026-01-01 13:24:10 -05:00
nodes Allow IS JSON predicate to work with domain types 2026-03-17 15:20:22 -04:00
optimizer Add some const qualifiers enabled by typeof_unqual change on copyObject 2026-03-19 06:35:54 +01:00
parser json format for COPY TO 2026-03-20 08:40:04 -04:00
partitioning Add some const qualifiers enabled by typeof_unqual change on copyObject 2026-03-19 06:35:54 +01:00
po Update copyright for 2026 2026-01-01 13:24:10 -05:00
port Restore AIX support. 2026-02-23 13:34:22 -05:00
postmaster Report detailed errors from XLogFindNextRecord() failures. 2026-03-24 22:33:09 +09:00
regex Use fallthrough attribute instead of comment 2026-02-19 08:51:12 +01:00
replication Fix WAL flush LSN used by logical walsender during shutdown 2026-03-17 08:10:20 +09:00
rewrite Further improve commentary about ChangeVarNodesWalkExpression() 2026-03-24 09:54:00 +02:00
snowball Fix meson build of snowball code. 2026-01-05 16:51:36 -05:00
statistics Fix inconsistency with HeapTuple freeing in extended_stats_funcs.c 2026-03-06 14:49:00 +09:00
storage Add support for lock statistics in pgstats 2026-03-24 15:32:09 +09:00
tcop Reduce header inclusions via execnodes.h 2026-03-16 14:34:57 +01:00
tsearch Require superuser to install a non-built-in selectivity estimator. 2026-02-09 10:07:31 -05:00
utils Make many cast functions error safe 2026-03-24 12:08:22 +01:00
.gitignore
common.mk Blind attempt to fix LLVM dependency in the backend 2022-09-15 10:53:48 +07:00
Makefile ssl: Serverside SNI support for libpq 2026-03-18 12:37:11 +01:00
meson.build Add backtrace support for Windows using DbgHelp API 2026-02-24 17:34:56 +01:00
nls.mk Create a separate file listing backend types 2025-09-26 15:21:49 +02:00