mirror of
https://github.com/postgres/postgres.git
synced 2025-11-09 06:21:09 +03:00
Remove WaitPMResult enum in pg_createsubscriber
A simple boolean suffices. This is cosmetic, so no backpatch. Author: Álvaro Herrera <alvherre@kurilemu.de> Discussion: https://postgr.es/m/202510311750.mxiykx3tp4mx@alvherre.pgsql
This commit is contained in:
@@ -156,12 +156,6 @@ static char *subscriber_dir = NULL;
|
|||||||
static bool recovery_ended = false;
|
static bool recovery_ended = false;
|
||||||
static bool standby_running = false;
|
static bool standby_running = false;
|
||||||
|
|
||||||
enum WaitPMResult
|
|
||||||
{
|
|
||||||
POSTMASTER_READY,
|
|
||||||
POSTMASTER_STILL_STARTING
|
|
||||||
};
|
|
||||||
|
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Cleanup objects that were created by pg_createsubscriber if there is an
|
* Cleanup objects that were created by pg_createsubscriber if there is an
|
||||||
@@ -1584,7 +1578,7 @@ static void
|
|||||||
wait_for_end_recovery(const char *conninfo, const struct CreateSubscriberOptions *opt)
|
wait_for_end_recovery(const char *conninfo, const struct CreateSubscriberOptions *opt)
|
||||||
{
|
{
|
||||||
PGconn *conn;
|
PGconn *conn;
|
||||||
int status = POSTMASTER_STILL_STARTING;
|
bool ready = false;
|
||||||
int timer = 0;
|
int timer = 0;
|
||||||
|
|
||||||
pg_log_info("waiting for the target server to reach the consistent state");
|
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
|
|||||||
/* Did the recovery process finish? We're done if so. */
|
/* Did the recovery process finish? We're done if so. */
|
||||||
if (dry_run || !server_is_in_recovery(conn))
|
if (dry_run || !server_is_in_recovery(conn))
|
||||||
{
|
{
|
||||||
status = POSTMASTER_READY;
|
ready = true;
|
||||||
recovery_ended = true;
|
recovery_ended = true;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@@ -1617,7 +1611,7 @@ wait_for_end_recovery(const char *conninfo, const struct CreateSubscriberOptions
|
|||||||
|
|
||||||
disconnect_database(conn, false);
|
disconnect_database(conn, false);
|
||||||
|
|
||||||
if (status == POSTMASTER_STILL_STARTING)
|
if (!ready)
|
||||||
pg_fatal("server did not end recovery");
|
pg_fatal("server did not end recovery");
|
||||||
|
|
||||||
pg_log_info("target server reached the consistent state");
|
pg_log_info("target server reached the consistent state");
|
||||||
|
|||||||
Reference in New Issue
Block a user