mirror of
https://github.com/EnterpriseDB/repmgr.git
synced 2026-03-27 08:56:29 +00:00
Restrict "node_name" to maximum 63 characters
In "recovery.conf", the configuration parameter "node_name" is used as the "application_name" value, which will be truncated by PostgreSQL to 63 characters (NAMEDATALEN - 1). repmgr sometimes needs to be able to extract the application name from pg_stat_replication to determine if a node is connected (e.g. when executing "repmgr standby register"), so the comparison will fail if "node_name" exceeds 63 characters.
This commit is contained in:
@@ -213,7 +213,7 @@ do_standby_clone(void)
|
||||
param_set(&recovery_conninfo, "application_name", config_file_options.node_name);
|
||||
|
||||
get_conninfo_value(config_file_options.conninfo, "application_name", application_name);
|
||||
if (strlen(application_name) && strncmp(application_name, config_file_options.node_name, MAXLEN) != 0)
|
||||
if (strlen(application_name) && strncmp(application_name, config_file_options.node_name, sizeof(config_file_options.node_name)) != 0)
|
||||
{
|
||||
log_notice(_("\"application_name\" is set in repmgr.conf but will be replaced by the node name"));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user