standby clone: don't error out if unable to determine cluster size

The cluster size check is purely informative, and is not in any way
essential for the standby clone operation. As it's possible the query
may fail if the repmgr user does not have sufficient privileges to
query all databases in the cluster, we can simply ignore any failure.

Note that the code comment indicated the query also served to sanity-
check that queries can actually be executed. While this was the case
historically, the preceding server version check now serves the same
purpose and will not have the same risk of failure due to missing
permissions.
This commit is contained in:
Ian Barwick
2022-05-10 15:02:24 +09:00
parent 2756d6fd94
commit d9d60fa420
4 changed files with 35 additions and 16 deletions

View File

@@ -5783,20 +5783,18 @@ check_source_server()
}
/*
* If a connection was established, perform some sanity checks on the
* provided upstream connection.
* The server version check will also serve as a sanity-check that we can
* actually execute queries on this connection.
*/
source_server_version_num = check_server_version(source_conn, "primary", true, NULL);
/*
* It's not essential to know the cluster size, but useful to sanity-check
* we can actually run a query before going any further.
* The cluster size is nice to have, but not essential to know, so only display
* something if the user has sufficient permissions to retrieve the size of
* all databases.
*/
if (get_cluster_size(source_conn, cluster_size) == false)
exit(ERR_DB_QUERY);
log_detail(_("current installation size is %s"),
if (get_cluster_size(source_conn, cluster_size) == true)
log_detail(_("current installation size is %s"),
cluster_size);
/*