pgsql: Fix Coverity issue reported in commit a850be2fe.

2025-09-08 Thread Amit Kapila
Fix Coverity issue reported in commit a850be2fe. Address a potential SIGSEGV that may occur when the tablesync worker attempts to locate a deleted row while applying changes. This situation arises during conflict detection for update-deleted scenarios. To prevent this crash, ensure that the opera

pgsql: Add error codes when vacuum discovers VM corruption

2025-09-08 Thread Melanie Plageman
Add error codes when vacuum discovers VM corruption Commit fd6ec93bf890314a and other previous work established the principle that when an error is potentially reachable in case of on-disk corruption but is not expected to be reached otherwise, ERRCODE_DATA_CORRUPTED should be used. This allows lo

pgsql: meson: build checksums with extra optimization flags.

2025-09-08 Thread Jeff Davis
meson: build checksums with extra optimization flags. Use -funroll-loops and -ftree-vectorize when building checksum.c to match what autoconf does. Discussion: https://postgr.es/m/a81f2f7ef34afc24a89c613671ea017e3651329c.ca...@j-davis.com Reviewed-by: Andres Freund Branch -- master Detail

pgsql: pg_upgrade: Transfer pg_largeobject_metadata's files when possib

2025-09-08 Thread Nathan Bossart
pg_upgrade: Transfer pg_largeobject_metadata's files when possible. Commit 161a3e8b68 taught pg_upgrade to use COPY for large object metadata for upgrades from v12 and newer, which is much faster to restore than the proper large object commands. For upgrades from v16 and newer, we can take this a

pgsql: Fix corruption of pgstats shared hashtable due to OOM failures

2025-09-08 Thread Michael Paquier
Fix corruption of pgstats shared hashtable due to OOM failures A new pgstats entry is created as a two-step process: - The entry is looked at in the shared hashtable of pgstats, and is inserted if not found. - When not found and inserted, its fields are then initialized. This part include a DSA c

pgsql: Remove unused xl_heap_prune member, reason

2025-09-08 Thread Melanie Plageman
Remove unused xl_heap_prune member, reason f83d709760d8 refactored xl_heap_prune and added an unused member, reason. While PruneReason is used when constructing this WAL record to set the WAL record definition, it doesn't need to be stored in a separate field in the record. Remove it. We won't ba

pgsql: Remove unneeded VM pin from VM replay

2025-09-08 Thread Melanie Plageman
Remove unneeded VM pin from VM replay Previously, heap_xlog_visible() called visibilitymap_pin() even after getting a buffer from XLogReadBufferForRedoExtended() -- which returns a pinned buffer containing the specified block of the visibility map. This would just have resulted in visibilitymap_p

pgsql: Add test to prevent premature removal of conflict-relevant data.

2025-09-08 Thread Amit Kapila
Add test to prevent premature removal of conflict-relevant data. A test has been added to ensure that conflict-relevant data is not prematurely removed when a concurrent prepared transaction is being committed on the publisher. This test introduces an injection point that simulates the presence o