aboutsummaryrefslogtreecommitdiff
path: root/src/backend/utils/adt/varchar.c
diff options
context:
space:
mode:
authorHeikki Linnakangas <heikki.linnakangas@iki.fi>2023-02-23 15:22:53 +0200
committerHeikki Linnakangas <heikki.linnakangas@iki.fi>2023-02-23 15:22:53 +0200
commit009eeee746825090ec7194321a3db4b298d6571e (patch)
tree3483e4f1eac2baeb6d40e743120d0a01ac98a1c2 /src/backend/utils/adt/varchar.c
parent75c737636b8a1e9a110e580f1caee181023447e2 (diff)
downloadpostgresql-009eeee746825090ec7194321a3db4b298d6571e.tar.gz
postgresql-009eeee746825090ec7194321a3db4b298d6571e.zip
pg_rewind: Fix determining TLI when server was just promoted.
If the source server was just promoted, and it hasn't written the checkpoint record yet, pg_rewind considered the server to be still on the old timeline. Because of that, it would claim incorrectly that no rewind is required. Fix that by looking at minRecoveryPointTLI in the control file in addition to the ThisTimeLineID on the checkpoint. This has been a known issue since forever, and we had worked around it in the regression tests by issuing a checkpoint after each promotion, before running pg_rewind. But that was always quite hacky, so better to fix this properly. This doesn't add any new tests for this, but removes the previously-added workarounds from the existing tests, so that they should occasionally hit this codepath again. This is arguably a bug fix, but don't backpatch because we haven't really treated it as a bug so far. Also, the patch didn't apply cleanly to v13 and below. I'm sure sure it could be made to work on v13, but doesn't seem worth the risk and effort. Reviewed-by: Kyotaro Horiguchi, Ibrar Ahmed, Aleksander Alekseev Discussion: https://www.postgresql.org/message-id/9f568c97-87fe-a716-bd39-65299b8a60f4%40iki.fi
Diffstat (limited to 'src/backend/utils/adt/varchar.c')
0 files changed, 0 insertions, 0 deletions