Fix misuse of simplehash.h hash operations in pg_waldump.
Tom Lane <tgl@sss.pgh.pa.us>
Fix misuse of simplehash.h hash operations in pg_waldump. Both ArchivedWAL_insert() and ArchivedWAL_delete_item() can cause existing hashtable entries to move. The code didn't account for this and could leave privateInfo->cur_file pointing at a dead or incorrect entry, with hilarity ensuing. Likewise, read_archive_wal_page calls read_archive_file which could result in movement of the hashtable entry it is working with. I believe these bugs explain some odd buildfarm failures, although the amount of data we use in pg_waldump's TAP tests isn't enough to trigger them reliably. This code's all new as of commit b15c15139, so no need for back-patch. Discussion: https://postgr.es/m/374225.1774459521@sss.pgh.pa.us
Files
| Path | Change | +/− |
|---|---|---|
| src/bin/pg_waldump/archive_waldump.c | modified | +36 −0 |
Discussion
- pg_waldump: support decoding of WAL inside tarfile 126 messages · 2025-08-07 → 2026-04-15