postgresql/src/bin/pg_waldump
Tom Lane e9d723487b Remove a low-value, high-risk optimization in pg_waldump.
The code removed here deleted already-used data from a partially-read
WAL segment's hashtable entry.  The intent was evidently to try to
keep the entry's memory consumption below the WAL segment's total
size, but we don't use WAL segments that are so large as to make that
a big win.  The important memory-space optimization is to remove
hashtable entries altogether when done with them, and that's handled
elsewhere.  To buy that, we must accept a substantially more complex
(and under-documented) logical invariant about what is in entry->buf,
as well as complex and under-documented interactions with the entry
spilling logic, various re-checking code paths in xlogreader.c,
and pg_waldump's overall data processing order.  Any of those aspects
could have bugs lurking still, and are quite likely to be prone to
new bugs after future code changes.

Given the number of bugs we've already found in commit b15c15139,
I judge that simplifying anything we possibly can is a good decision.

While here, revise and extend some related comments.

Discussion: https://postgr.es/m/374225.1774459521@sss.pgh.pa.us
2026-03-25 19:15:52 -04:00
..
po Update copyright for 2026 2026-01-01 13:24:10 -05:00
t Report detailed errors from XLogFindNextRecord() failures. 2026-03-24 22:33:09 +09:00
.gitignore Add missing .gitignore entry. 2023-04-07 23:32:49 -04:00
archive_waldump.c Remove a low-value, high-risk optimization in pg_waldump. 2026-03-25 19:15:52 -04:00
compat.c Update copyright for 2026 2026-01-01 13:24:10 -05:00
Makefile pg_waldump: Add support for reading WAL from tar archives 2026-03-20 15:31:35 -04:00
meson.build pg_waldump: Add support for reading WAL from tar archives 2026-03-20 15:31:35 -04:00
nls.mk Add missing source files to nls.mk 2024-06-13 10:17:36 +02:00
pg_waldump.c Fix file descriptor leakages in pg_waldump. 2026-03-25 18:28:42 -04:00
pg_waldump.h Remove read_archive_file()'s "count" parameter. 2026-03-24 12:17:12 -04:00
rmgrdesc.c Move WAL sequence code into its own file 2025-12-01 16:21:41 +09:00
rmgrdesc.h Custom WAL Resource Managers. 2022-04-06 23:06:46 -07:00