]> git.ipfire.org Git - thirdparty/postgresql.git/commit
Fix misuse of simplehash.h hash operations in pg_waldump.
authorTom Lane <tgl@sss.pgh.pa.us>
Wed, 25 Mar 2026 22:37:28 +0000 (18:37 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Wed, 25 Mar 2026 22:37:28 +0000 (18:37 -0400)
commitff84efe4fdc081545ec68064588dffecfb026527
tree44d4cc39d58d6e94a68a91bc647e0b74a76d465c
parent03b1e30e7aa5c0d83514db4156cfc80632f50493
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
src/bin/pg_waldump/archive_waldump.c