Skip to content

Commit f242dbc

Browse files
committed
Remove WaitPMResult enum in pg_createsubscriber
A simple boolean suffices. This is cosmetic, so no backpatch. Author: Álvaro Herrera <[email protected]> Discussion: https://postgr.es/m/[email protected]
1 parent ad25744 commit f242dbc

File tree

1 file changed

+3
-9
lines changed

1 file changed

+3
-9
lines changed

src/bin/pg_basebackup/pg_createsubscriber.c

Lines changed: 3 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -156,12 +156,6 @@ static char *subscriber_dir = NULL;
156156
static bool recovery_ended = false;
157157
static bool standby_running = false;
158158

159-
enum WaitPMResult
160-
{
161-
POSTMASTER_READY,
162-
POSTMASTER_STILL_STARTING
163-
};
164-
165159

166160
/*
167161
* Cleanup objects that were created by pg_createsubscriber if there is an
@@ -1584,7 +1578,7 @@ static void
15841578
wait_for_end_recovery(const char *conninfo, const struct CreateSubscriberOptions *opt)
15851579
{
15861580
PGconn *conn;
1587-
int status = POSTMASTER_STILL_STARTING;
1581+
bool ready = false;
15881582
int timer = 0;
15891583

15901584
pg_log_info("waiting for the target server to reach the consistent state");
@@ -1596,7 +1590,7 @@ wait_for_end_recovery(const char *conninfo, const struct CreateSubscriberOptions
15961590
/* Did the recovery process finish? We're done if so. */
15971591
if (dry_run || !server_is_in_recovery(conn))
15981592
{
1599-
status = POSTMASTER_READY;
1593+
ready = true;
16001594
recovery_ended = true;
16011595
break;
16021596
}
@@ -1617,7 +1611,7 @@ wait_for_end_recovery(const char *conninfo, const struct CreateSubscriberOptions
16171611

16181612
disconnect_database(conn, false);
16191613

1620-
if (status == POSTMASTER_STILL_STARTING)
1614+
if (!ready)
16211615
pg_fatal("server did not end recovery");
16221616

16231617
pg_log_info("target server reached the consistent state");

0 commit comments

Comments
 (0)