Hello, When I test the patch, I find an issue: I start a stream with 'promote_trigger_file' GUC valid, and exec pg_wal_replay_pause() during recovery and as below it shows success to pause at the first time. I think it use a initialize 'SharedPromoteIsTriggered' value first time I exec the pg_wal_replay_pause().
##################################### postgres=# select pg_wal_replay_pause(); pg_wal_replay_pause --------------------- (1 row) postgres=# select pg_wal_replay_pause(); ERROR: standby promotion is ongoing HINT: pg_wal_replay_pause() cannot be executed after promotion is triggered. postgres=# select pg_wal_replay_pause(); ERROR: recovery is not in progress HINT: Recovery control functions can only be executed during recovery. postgres=# ############################################################## The new status of this patch is: Waiting on Author