Rework redundant code in subtrans.c

Alvaro Herrera <alvherre@alvh.no-ip.org>

Commit: 1a2654b32b546d25e39a0c02410049559a3d4573
Author: Alvaro Herrera <alvherre@alvh.no-ip.org>
Date: 2024-03-05T11:09:18Z
Releases: 17.0
Rework redundant code in subtrans.c

When this code was written the duplicity didn't matter, but with all the
SLRU-bank stuff we just added, it has become excessive.  Turn it into a
simpler loop with no code duplication.  Also add a test so that this
code becomes covered.

Discussion: https://postgr.es/m/202403041517.3a35jw53os65@alvherre.pgsql

Files

PathChange+/−
src/backend/access/transam/subtrans.c modified +7 −22
src/test/recovery/t/009_twophase.pl modified +42 −0

Discussion